diff --git a/CHANGES.md b/CHANGES.md index 1693a577f1c..1da6c875c8d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) ----------------- diff --git a/src/dune_rules/dune_file.ml b/src/dune_rules/dune_file.ml index e2cd91d0a45..724033e7f14 100644 --- a/src/dune_rules/dune_file.ml +++ b/src/dune_rules/dune_file.ml @@ -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 diff --git a/test/blackbox-tests/test-cases/dune-package.t/run.t b/test/blackbox-tests/test-cases/dune-package.t/run.t index 8ad9311a5b5..2946e877c20 100644 --- a/test/blackbox-tests/test-cases/dune-package.t/run.t +++ b/test/blackbox-tests/test-cases/dune-package.t/run.t @@ -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