Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed May 14, 2024
1 parent f931718 commit cf79e4b
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/dune_rules/merlin/ocaml_index.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,31 @@ let cctx_rules cctx =
the typedtree. This step is therefore dependent on all the cmts of those
definitions are used by all the cmts of modules in this cctx. *)
let sctx = Compilation_context.super_context cctx in
let* additional_libs =
let open Resolve.Memo.O in
let+ non_compile_libs =
(* The indexer relies on the load_path of cmt files. When
[implicit_transitive_deps] is set to [false] some necessary paths will
be missing.These are passed to the indexer with the `-I` flag.
The implicit transitive libs correspond to the set:
(requires_link \ req_compile) *)
let* req_link = Compilation_context.requires_link cctx in
let+ req_compile = Compilation_context.requires_compile cctx in
List.filter req_link ~f:(fun l -> not (List.exists req_compile ~f:(Lib.equal l)))
in
Lib_flags.L.include_flags non_compile_libs (Lib_mode.Ocaml Byte)
in
let dir = Compilation_context.dir cctx in
let aggregate =
let obj_dir = Compilation_context.obj_dir cctx in
let fn = index_path_in_obj_dir obj_dir in
let includes =
Resolve.peek additional_libs |> Result.value ~default:Command.Args.empty
Command.Args.Dyn
(Action_builder.of_memo
@@
let+ additional_libs =
let open Resolve.Memo.O in
let+ non_compile_libs =
(* The indexer relies on the load_path of cmt files. When
[implicit_transitive_deps] is set to [false] some necessary paths will
be missing.These are passed to the indexer with the `-I` flag.
The implicit transitive libs correspond to the set:
(requires_link \ req_compile) *)
let* req_link = Compilation_context.requires_link cctx in
let+ req_compile = Compilation_context.requires_compile cctx in
List.filter req_link ~f:(fun l ->
not (List.exists req_compile ~f:(Lib.equal l)))
in
Lib_flags.L.include_flags non_compile_libs (Lib_mode.Ocaml Byte)
in
Resolve.peek additional_libs |> Result.value ~default:Command.Args.empty)
in
let context_dir =
Compilation_context.context cctx
Expand Down

0 comments on commit cf79e4b

Please sign in to comment.