Skip to content

Commit

Permalink
Fix dune-package for byte only libs
Browse files Browse the repository at this point in the history
Such libraries do not contain a lib.a file

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Dec 16, 2020
1 parent 9aa82ad commit 75f32e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ Unreleased
useless and deprecated. Dune now conflicts with `merlin < 3.4.0` and
`ocaml-lsp-server < 1.3.0` (#3554, @voodoos)

- Remove non-existent `(native_archives ..)` entries in `dune-package` files in
bytecode only libraries. (#4041, @rgrinberg)

2.7.1 (2/09/2020)
-----------------

Expand Down
6 changes: 5 additions & 1 deletion src/dune_rules/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,11 @@ module Library = struct
let virtual_library = is_virtual conf in
let foreign_archives = foreign_lib_files conf ~dir ~ext_lib in
let native_archives =
[ Path.Build.relative dir (Lib_name.Local.to_string lib_name ^ ext_lib) ]
if modes.native then
[ Path.Build.relative dir (Lib_name.Local.to_string lib_name ^ ext_lib)
]
else
[]
in
let foreign_dll_files = foreign_dll_files conf ~dir ~ext_dll in
let exit_module = Option.bind conf.stdlib ~f:(fun x -> x.exit_module) in
Expand Down
1 change: 0 additions & 1 deletion test/blackbox-tests/test-cases/dune-package.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
(kind normal)
(archives (byte byte_only/d.cma))
(plugins (byte byte_only/d.cma))
(native_archives byte_only/d$ext_lib)
(main_module_name D)
(modes byte)
(modules
Expand Down

0 comments on commit 75f32e2

Please sign in to comment.