fdopen / opam-repository-mingw

windows package repository for OPAM (mingw and msvc)
https://fdopen.github.io/opam-repository-mingw/
Creative Commons Zero v1.0 Universal
96 stars 33 forks source link

Path issue from within Cygwin Terminal #37

Closed prateek-khandelwal closed 7 years ago

prateek-khandelwal commented 7 years ago

Hi,

I have followed the installation steps and have got the cygwin terminal setup. Infact, I am able to execute opam and install packages too. However, I am facing issue with using the ocaml-env and ocaml-win-env commands. Whenever I execute these to launch a VSCode, the error message suggests that it is not able to locate the executable. However, I am able to launch VSCode from within cygwin terminal perfectly fine.

Can you please suggest what I need to do ? The error message I am observing is this:

$ ocaml-env-win -- /cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ VS\ Code/Code.exe
fatal error: program "/cygdrive/c/Program Files (x86)/Microsoft VS Code/Code.exe" not found

And providing the Windows-style path gives me this:

$ ocaml-env-win -- "C:\Program Files (x86)\Microsoft VS Code\bin\Code"
exec: internal error, uncaught exception:
      Unix.Unix_error(21, "create_process", "C:\\Program Files (x86)\\Microsoft VS Code\\bin\\Code")

Thanks.

fdopen commented 7 years ago

C:\\Program Files (x86)\\Microsoft VS Code\\bin\\Code is a shell script. A cygwin program can execute it, but not a native windows application like ocaml-env-win.

try it with ocaml-env-win -- bash "C:\Program Files (x86)\Microsoft VS Code\bin\Code"

Or even better just use: ocaml-env-win -- "C:\Program Files (x86)\Microsoft VS Code\Code.exe"

prateek-khandelwal commented 7 years ago

Thanks ! I also noticed that if I simply call code from the terminal, the integrated terminal in VS code borrows the environment settings, that is I can call the compiler directly.