Skip to content

Commit

Permalink
fix: symlink .impl.d files for virtual library modules too
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 20, 2024
1 parent 34ade5f commit 58dd3ba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/dune_rules/virtual_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ let setup_copy_rules_for_impl ~sctx ~dir vimpl =
let dst = Obj_dir.Module.cm_file_exn impl_obj_dir m ~kind in
copy_to_obj_dir ~src ~dst
in
let copy_ocamldep_file m =
match Obj_dir.to_local vlib_obj_dir with
| None -> Memo.return ()
| Some vlib_obj_dir ->
let src = Obj_dir.Module.dep vlib_obj_dir (Immediate (m, Impl)) |> Path.build in
let dst = Obj_dir.Module.dep impl_obj_dir (Immediate (m, Impl)) in
copy_to_obj_dir ~src ~dst
in
let copy_interface_to_impl ~src kind () =
let dst = Obj_dir.Module.cm_public_file_exn impl_obj_dir src ~kind in
let src = Obj_dir.Module.cm_public_file_exn vlib_obj_dir src ~kind in
Expand All @@ -39,7 +47,8 @@ let setup_copy_rules_for_impl ~sctx ~dir vimpl =
>>> Memo.when_ melange (copy_interface_to_impl ~src (Melange Cmi)))
>>> Memo.when_ (Module.has src ~ml_kind:Impl) (fun () ->
Memo.when_ byte (fun () -> copy_obj_file src (Ocaml Cmo))
>>> Memo.when_ melange (fun () -> copy_obj_file src (Melange Cmj))
>>> Memo.when_ melange (fun () ->
copy_obj_file src (Melange Cmj) >>> copy_ocamldep_file src)
>>> Memo.when_ native (fun () ->
copy_obj_file src (Ocaml Cmx)
>>>
Expand Down

0 comments on commit 58dd3ba

Please sign in to comment.