You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, dune simply looks for bash in PATH and executes it. With native opam set up with cygwin on Windows, this can lead to problems as cygwin's bash tends to not be available in PATH, so another bash may end up being used (e.g. WSL's). Additionally, even if bash is available in PATH, it is missing cygwin's PATH entries to make it usable.
Desired Behavior
The desired behaviour would be to:
Prioritise opam's configured cygwin install when looking for bash (over existing PATH entries)
Run the cygwin bash with PATH set up correctly so that scripts can run properly (via --login option for bash)
Sorry for the orthogonal comment, but I'll repeat my opinion here that I think (bash) is basically a mistake (even if a useful escape hatch sometimes), as it makes it easy to write non-cross-platform Dune files. The fact that OPAM currently includes a Cygwin install behind the scenes is an implementation detail; OCaml itself (apart from its build system) has no dependency on Cygwin.
That said, given that it already exists, I'm not against improving it :)
Currently, dune simply looks for bash in
PATH
and executes it. With native opam set up with cygwin on Windows, this can lead to problems as cygwin's bash tends to not be available inPATH
, so another bash may end up being used (e.g. WSL's). Additionally, even if bash is available in PATH, it is missing cygwin'sPATH
entries to make it usable.Desired Behavior
The desired behaviour would be to:
PATH
set up correctly so that scripts can run properly (via --login option for bash)Example
(rule (targets bash.txt) (action (bash "echo \"$(cygpath -w $0)\n$PATH\" > bash.txt") ) )
The expected output would be the path to bash that belongs to opam's cygwin install, and the
PATH
entries should include/usr/local/bin:/usr/bin:...
.The text was updated successfully, but these errors were encountered: