Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On windows, (run ./configure) results in CreateProcess(): Exec format error #11174

Open
Tracked by #11161
gridbugs opened this issue Dec 2, 2024 · 5 comments
Open
Tracked by #11161

Comments

@gridbugs
Copy link
Collaborator

gridbugs commented Dec 2, 2024

Windows uses file extensions to determine how to open files. This means that actions that run shell scripts without extensions (such as configure scripts) do not work on windows. Opam has explicit support for running scripts, added in ocaml/opam#3348. Dune should be extended in the same way.

Without this change, dune is unable to install any packages with configure scripts. Notably this includes the ocaml compiler itself.

@nojb
Copy link
Collaborator

nojb commented Dec 2, 2024

From my point of view the problem is not the file extension, but the fact that such shell scripts are not binaries and so cannot be "executed" (= passed to CreateProcess). Instead, shouldn't the Dune file be fixed to call the needed interpreter explicitly, eg (run bash ./configure), or (bash "./configure"), etc?

@gridbugs
Copy link
Collaborator Author

gridbugs commented Dec 2, 2024

The problem is that dune generates package lockfiles by parsing opam files, and so when ./configure appears in an opam file, the corresponding lockfile will include (run ./configure).

@nojb
Copy link
Collaborator

nojb commented Dec 2, 2024

The problem is that dune generates package lockfiles by parsing opam files, and so when ./configure appears in an opam file, the corresponding lockfile will include (run ./configure).

OK, thanks.

@Leonidas-from-XIV
Copy link
Collaborator

This issue is not limited to package management either, any package that runs (run ./script) will fail on Windows, thus I would suggest changing the run action to do something smarter on Windows.

@rgrinberg
Copy link
Member

Probably making the same change to user written run actions is the right thing to do as well.

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

No branches or pull requests

4 participants