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 e0fb6ee commit ded8bd5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 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 @@ -40,6 +48,7 @@ let setup_copy_rules_for_impl ~sctx ~dir vimpl =
>>> 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))
>>> copy_ocamldep_file src
>>> Memo.when_ native (fun () ->
copy_obj_file src (Ocaml Cmx)
>>>
Expand Down

0 comments on commit ded8bd5

Please sign in to comment.