Skip to content

Commit

Permalink
Fix #2974
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremie Dimino <[email protected]>
Co-Authored-By: Andrey Mokhov <[email protected]>
  • Loading branch information
jeremiedimino and snowleopard committed Jan 16, 2020
1 parent 44c433f commit 3359f34
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.1.3 (unreleased)
------------------

- Fix building the OCaml compiler with Dune (#3038, fixes #2974,
@diml)

2.1.2 (08/01/2020)
------------------

Expand Down
29 changes: 19 additions & 10 deletions src/dune/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,26 @@ module Link_params = struct
| Native -> List.rev_append (Lib_info.native_archives t.info) lib_files
in
let include_dirs =
let dirs files =
List.sort_uniq ~compare:Path.compare (List.map files ~f:Path.parent_exn)
(* TODO: Remove the above unsafe call to [parent_exn] by separating
files and directories at the type level. Then any file will have a
well-defined parent directory, possibly ".". *)
let files =
match mode with
| Byte -> dll_files
| Byte_with_stubs_statically_linked_in
| Native ->
lib_files
in
match mode with
| Byte -> dirs dll_files
| Byte_with_stubs_statically_linked_in
| Native ->
dirs lib_files
let files =
match Lib_info.exit_module t.info with
| None -> files
| Some _ ->
(* The exit module is copied next to the archive, so we add the
archive here so that its directory ends up in [include_dirs]. *)
files @ deps
in
(* TODO: Remove the below unsafe call to [parent_exn] by separating files
and directories at the type level. Then any file will have a
well-defined parent directory, possibly ".". *)
let dirs = List.map files ~f:Path.parent_exn in
List.sort_uniq dirs ~compare:Path.compare
in
let hidden_deps =
match Lib_info.exit_module t.info with
Expand Down

0 comments on commit 3359f34

Please sign in to comment.