Skip to content

Provide working bash action on cygwin #11438

Open
@tobil4sk

Description

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)

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:....

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions