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

Explicit executable dependencies and cross-compilation #3917

Open
TheLortex opened this issue Nov 4, 2020 · 3 comments
Open

Explicit executable dependencies and cross-compilation #3917

TheLortex opened this issue Nov 4, 2020 · 3 comments

Comments

@TheLortex
Copy link
Collaborator

When packages use configure scripts, they usually have something like this:

rule
  (targets ...)
  (deps discover.exe)
  (action (run ./discover.exe)))

As of today, this does not work in a cross-compilation setting, because it adds a dependency towards config.exe in the cross-compiled workspace, which is not a good thing (and fails due to missing unix, usually).

My guess is that dune performs the following expansions:

  • (deps discover.exe) -> (deps %{dep:discover.exe}) -- pointing to the cross-compiled workspace
  • (run ./discover.exe) -> (run %{exe:./discover.exe}) -- pointing to the host workspace (as intended)

A simple workaround is to remove the explicit deps field towards executables, but that might seem counter-intuitive to some package maintainers so I was wondering if this behavior was intended. Thanks !

Using dune master branch and ocaml 4.11.1

@TheLortex
Copy link
Collaborator Author

For reference, here is a small list of packages where I've encountered the issue, along with the workaround commit:

@rgrinberg
Copy link
Member

We discussed this in the meeting, and we think that modifying the build rules as you're doing now is the way to go.

We agree that it's unfortunate that the two forms seem interchangeable to the user, but we're not sure how to guide them to use %{exe:..} over %{dep:..} for running the executable.

@TheLortex
Copy link
Collaborator Author

Thank you for the confirmation. I'll move forward updating packages that have this issue then.

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

3 participants