Skip to content

Conversation

@tobil4sk
Copy link
Contributor

@tobil4sk tobil4sk commented Feb 3, 2025

Carriage returns will appear when running the command on windows, which means that the configure script cannot function correctly because it relies on the host value to locate certain executables (such as ar).

This is actually the cause of #162. Fixing this doesn't completely solve (local) windows builds, as dune doesn't currently run the correct bash executable, see: ocaml/dune#11438. This can be worked around by adding the output of $(opam exec -- cygpath -w /bin) to PATH.

Alternatively, this could all be replaced with ocamlc -config-var host which is cleaner, but that would increase the required ocaml version to 4.08. What would your preference be? @aantron

Closes #162

Carriage returns will appear when running the command on windows, which
means that the configure script cannot function correctly because it
relies on the host value to locate certain executables (such as `ar`).
@tobil4sk
Copy link
Contributor Author

tobil4sk commented Feb 4, 2025

Alternatively, this could all be replaced with ocamlc -config-var host which is cleaner

I've changed it to the built-in dune variable ocaml-config:host, which is available from dune 2.0 and is even cleaner.

@tobil4sk tobil4sk changed the title Handle carriage returns from ocamlc -config output Avoid carriage return bug when configuring libuv on Windows Feb 6, 2025
@tobil4sk
Copy link
Contributor Author

tobil4sk commented Jan 13, 2026

@aantron Please could you consider merging this? It's currently the easiest fix to help improve windows support, to avoid having to manually add $CYGWIN_ROOT/usr/x86_64-w64-mingw32/bin to PATH.

It's worth noting that this issue didn't affect github ci using setup-ocaml because that uses the -o igncr option for cygwin bash, so the CR is automatically stripped. However, this is not set by default for local installations of cygwin so it would be helpful if this could be fixed.

You can also reproduce the failure with setup-ocaml by overriding BASH_ENV so that igncr doesn't get set:

- run: opam exec -- dune build -p luv
  env:
    BASH_ENV:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Try to reproduce opam-repository CI failure on Windows

1 participant