Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cygwin support #43

Open
geekyme opened this issue Sep 14, 2017 · 4 comments
Open

Cygwin support #43

geekyme opened this issue Sep 14, 2017 · 4 comments

Comments

@geekyme
Copy link

geekyme commented Sep 14, 2017

Running elm-install on cygwin produces errors:

$ pwd
/cygdrive/c/work/project/

$ elm-install
error: git clone "--" "https://github.com/NoRedInk/elm-decode-pipeline" "C:/work/ext/cygwin/home/user/.elm-install/github.com/NoRedInk/elm-decode-pipeline" 2>&1:fatal: Invalid path '/cygdrive/c/work/project/C:/work': No such file or directory. Use --trace to view backtrace
Resolving packages...
▶ Package: https://github.com/NoRedInk/elm-decode-pipeline not found in cache, cloning...

I've debugged further and it turns out that path here is receiving a path with the windows volume:

C:/work/ext/cygwin/home/user/.elm-install/github.com/NoRedInk/elm-decode-pipeline

The problem with this is that when passed to git, git interprets C:/..... as a path relative to pwd, hence we see the invalid path /cygdrive/c/work/project/C:/work in the error above.

After monkey patching the paths to have a proper absolute Unix path, we get more errors:

C:/work/ext/cygwin/home/user/elm-install-1.4.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir': Invalid argument @ dir_s_mkdir - /work/ext/cygwin/home/user/.elm-install/github.com/elm-lang/core (Errno::EINVAL)

Afraid I've hit a wall here as I'm not a ruby expert.

@gdotdesign
Copy link
Owner

I'm not familiar with cygwin so I need to look into it, also some more information would be helpful:

  • how did you install? (npm installer / as a gem / binary from the releases page)
  • windows version
  • elm-package.json if available

@geekyme
Copy link
Author

geekyme commented Sep 14, 2017

installed via npm install -g elm-github-install
windows 7
elm-package.json is the stock template from https://github.com/halfzebra/create-elm-app

@gdotdesign
Copy link
Owner

elm-github-install in windows runs with a portable ruby environment called traveling-ruby this means that it uses windows paths, the git commands in cygwins accepts linux paths which leads to a conflict.

It is probably possible to detect if the environment is cygwin and then the paths can be converted with cygpath. I can do it some time but it's not in the top of my priorities.

You could try:

  • installing Ruby inside cygwin and then install the gem but I cannot guarantee that it would work
  • installing everything outside of cygwin

@geekyme
Copy link
Author

geekyme commented Sep 15, 2017

Trying to install everything outside cygwin now

https://github.com/gdotdesign/elm-github-install/releases/download/v1.4.0/elm-install-1.4.0-win32.zip is not completely portable because its assumed git is installed.

It is probably possible to detect if the environment is cygwin and then the paths can be converted with cygpath. I can do it some time but it's not in the top of my priorities.

I did that, but ran into more path errors.

Trying to use the linux release in cygwin doesn't work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants