Skip to content

Commit

Permalink
fix(virtual_lib_compilation_test): only add dependency if impl exists
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro committed Mar 22, 2024
1 parent a5b6c5a commit c26c83f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/dune_rules/melange/melange_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,14 @@ let build_js
let+ module_deps =
Dep_rules.immediate_deps_of m modules ~obj_dir ~ml_kind:Impl
in
List.map module_deps ~f:(fun dep_m ->
Obj_dir.Module.cm_file_exn obj_dir dep_m ~kind:(Melange Cmj) |> Path.build)
List.fold_left module_deps ~init:[] ~f:(fun acc dep_m ->
if Module.has dep_m ~ml_kind:Impl
then (
let cmj_file =
Obj_dir.Module.cm_file_exn obj_dir dep_m ~kind:(Melange Cmj)
in
Path.build cmj_file :: acc)
else acc)
| None -> Action_builder.return []
in
Action_builder.dyn_paths_unit local_library_paths >>> command)
Expand Down

0 comments on commit c26c83f

Please sign in to comment.