Skip to content

Commit

Permalink
fix(cross): expand artifacts in the right context
Browse files Browse the repository at this point in the history
Fixes #9199

Signed-off-by: Etienne Millon <[email protected]>
  • Loading branch information
emillon committed Nov 16, 2023
1 parent 5176356 commit 68723da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/dune_rules/expander.ml
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,12 @@ let expand_lib_variable t source ~lib ~file ~lib_exec ~lib_private =
|> String.quoted)
])
else (
let artifacts = if lib_exec then t.lib_artifacts_host else t.lib_artifacts in
file_of_lib artifacts (Context.host t.context) ~loc ~lib ~file)
let artifacts, context =
if lib_exec
then t.lib_artifacts_host, Context.host t.context
else t.lib_artifacts, t.context
in
file_of_lib artifacts context ~loc ~lib ~file)
in
let p =
let open Memo.O in
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/github9199.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ See #9199.
$ cat _build/host/target
../install/host/lib/somelib/somelib.a
$ cat _build/cross/target
../install/host/lib/somelib/somelib.a
../install/cross/lib/somelib/somelib.a

0 comments on commit 68723da

Please sign in to comment.