Hi there,
I finally got my cygwin+mingw32 environment to build nim. Everything works nicely except nimble barfs when trying to install anything. Is there a way I can tell it exactly what path to use or force nimble to use *nix pathing? Programs I write with nim work with *nix style paths on my system just fine.
$ nimble install nimcl
... <redacted>
... Output: Cloning into 'C:\cygwin64\tmp\nimble_4860\githubcom_unicreditnimcl'...
... fatal: Invalid path '/cygdrive/c/Users/me/C:\cygwin64\tmp\nimble_4860\githubcom_unicreditnimcl': No such file or directory
$ nimble install nimcl --nimbleDir:/cygdrive/c/Users/me --verbose
Error: unhandled exception: The system cannot find the path specified.
[OSError]
"solved"
Here's my hack, but it would be great to have a good way to specify that you're in a posix-like environment for pathing despite being on windows, and to use the cygpath utility as needed.
I modified the source of nimble (src/nimblepkg/download.nim) in the doClone() function I modified/added lines to the effect of:
let res = doCmdEx("cygpath " & downloadDir)
let fixedPath = string(res.output).strip()
doCmd("git clone --recursive " & depthArg & branchArg & url & " " & fixedPath)
You need to be very careful not to mix posix with win32 on cygwin if you want to remain sane.
That looks like mingw32 nimble running cygwin git. Using a mingw32 git (or any win32 git binary) should work.
Programs I write with nim work with *nix style paths on my system just fine.
I doubt that's the case if they are complied with mingw32. IIRC when you run a win32 binary from a cygwin shell it automatically converts and paths on the CLI args to the equivalent windows path.