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

Promotion and cross-compilation #11138

Open
sir4ur0n opened this issue Nov 20, 2024 · 0 comments
Open

Promotion and cross-compilation #11138

sir4ur0n opened this issue Nov 20, 2024 · 0 comments

Comments

@sir4ur0n
Copy link

sir4ur0n commented Nov 20, 2024

Desired Behavior

Clarify and make deterministic the behavior of promotion with cross-compilation.

Currently, based on several tests, it seems that the file being promoted is not deterministic, and it is also not always the cross-compilation one being copied.

Example

Consider the following promotion rule:

(rule
 (mode
  (promote (until-clean)))
 (action
  (copy foobar/something.exe something)))

Now run dune build -x sometoolchain something.

Dune will build 2 binaries (as documented in https://dune.readthedocs.io/en/stable/cross-compilation.html):

  • the native one (_build/default/foobar/something.exe)
  • the cross-compilation one (_build/default.sometoolchain/foobar/something.exe)

But then Dune will copy one of those 2 (binary) files to ./something.

  1. It is not clear which will be copied
  2. It seems to change, sometimes it is the native one, sometimes the cross-compilation one

Note that since Dune supports passing several cross-compilation targets, I don't even know what should be the semantic of promotion with cross-compilation.

At least I would have liked an error/warning, e.g.,

⚠ Promotion is incompatible with more than 1 target, but you passed targets (native sometoolchain)

Kinda related question: is it possible to remove targets from the CLI? E.g. to only build for target sometoolchain without building the native target?

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

No branches or pull requests

1 participant