Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3636 #5150

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 20 additions & 26 deletions src/dune_rules/install_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,20 @@ end = struct
[]
in
let cm_dir = cm_dir m in
let other_cm_files =
let open Cm_kind in
[ if_ true (Cmi, cm_file Cmi)
; if_ native (Cmx, cm_file Cmx)
; if_ (byte && virtual_library) (Cmo, cm_file Cmo)
; if_
(native && virtual_library)
(Cmx, Obj_dir.Module.o_file obj_dir m ~ext_obj)
; List.filter_map Ml_kind.all ~f:(fun ml_kind ->
let open Option.O in
let+ cmt = Obj_dir.Module.cmt_file obj_dir m ~ml_kind in
(Cmi, cmt))
]
|> List.concat
|> List.map ~f:(fun (cm_kind, f) -> (cm_dir cm_kind, f))
in
other_cm_files)
let open Cm_kind in
[ if_ true (Cmi, cm_file Cmi)
; if_ native (Cmx, cm_file Cmx)
; if_ (byte && virtual_library) (Cmo, cm_file Cmo)
; if_
(native && virtual_library)
(Cmx, Obj_dir.Module.o_file obj_dir m ~ext_obj)
; List.filter_map Ml_kind.all ~f:(fun ml_kind ->
let open Option.O in
let+ cmt = Obj_dir.Module.cmt_file obj_dir m ~ml_kind in
(Cmi, cmt))
]
|> List.concat
|> List.map ~f:(fun (cm_kind, f) -> (cm_dir cm_kind, f)))
in
let* lib_files, dll_files =
let+ lib_files = lib_files ~dir ~dir_contents ~lib_config info in
Expand All @@ -189,10 +186,8 @@ end = struct
in
let+ execs = lib_ppxs sctx ~scope ~lib in
let install_c_headers =
List.map
~f:(fun base ->
List.map lib.install_c_headers ~f:(fun base ->
Path.Build.relative dir (base ^ Foreign_language.header_extension))
lib.install_c_headers
in
List.concat
[ sources
Expand Down Expand Up @@ -235,12 +230,11 @@ end = struct
Scope.project scope |> Dune_project.dune_version
in
let+ pps =
Resolve.Build.read_memo_build
(Preprocess.Per_module.with_instrumentation
exes.buildable.preprocess
~instrumentation_backend:
(Lib.DB.instrumentation_backend (Scope.libs scope)))
>>| Preprocess.Per_module.pps
Preprocess.Per_module.with_instrumentation
exes.buildable.preprocess
~instrumentation_backend:
(Lib.DB.instrumentation_backend (Scope.libs scope))
|> Resolve.Build.read_memo_build >>| Preprocess.Per_module.pps
in
Lib.DB.resolve_user_written_deps_for_exes (Scope.libs scope)
exes.names exes.buildable.libraries ~pps ~dune_version
Expand Down