elm-github-install icon indicating copy to clipboard operation
elm-github-install copied to clipboard

Cygwin support

Open geekyme opened this issue 8 years ago • 4 comments

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.

geekyme avatar Sep 14 '17 09:09 geekyme

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

gdotdesign avatar Sep 14 '17 12:09 gdotdesign

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

geekyme avatar Sep 14 '17 12:09 geekyme

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

gdotdesign avatar Sep 14 '17 13:09 gdotdesign

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.

geekyme avatar Sep 15 '17 02:09 geekyme