Skip to content

Explicit executable dependencies and cross-compilation #3917

@TheLortex

Description

@TheLortex

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions