Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/changes/added/14492.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Filter inter-library dependencies per-module using `ocamldep` output, and
match the `-I`/`-H` include flags to that filter. When a dependency
library's cmi changes, only consumer modules that reference it get rebuilt
— eliminating spurious recompilations of unrelated sibling modules.
Applies to unwrapped dependency libraries; wrapped libraries continue to
use a glob over the whole library's objdir. (#14492, fixes #4572,
@robinbb)
632 changes: 632 additions & 0 deletions doc/dev/per-module-narrowing.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/dune_lang/lib_mode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ let equal x y =
| Melange, Melange -> true
;;

let hash = function
| Ocaml Byte -> 0
| Ocaml Native -> 1
| Melange -> 2
;;

let decode =
let open Decoder in
enum [ "byte", Ocaml Byte; "native", Ocaml Native; "melange", Melange ]
Expand Down
1 change: 1 addition & 0 deletions src/dune_lang/lib_mode.mli
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type t =

val decode : t Decoder.t
val equal : t -> t -> bool
val hash : t -> int
val to_dyn : t -> Dyn.t

module Cm_kind : sig
Expand Down
6 changes: 6 additions & 0 deletions src/dune_rules/cinaps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ let gen_rules sctx t ~dir ~scope =
in
let requires_compile = Lib.Compile.direct_requires compile_info ~for_ in
let requires_link = Lib.Compile.requires_link compile_info ~for_ in
let pps_runtime_libs =
let open Resolve.Memo.O in
let* pps = Lib.Compile.pps compile_info ~for_ in
Resolve.Memo.List.concat_map pps ~f:(Lib.ppx_runtime_deps ~for_)
in
let obj_dir = Obj_dir.make_exe ~dir:cinaps_dir ~name in
Compilation_context.create
for_
Expand All @@ -217,6 +222,7 @@ let gen_rules sctx t ~dir ~scope =
~opaque:(Explicit false)
~requires_compile
~requires_link
~pps_runtime_libs
~flags
~js_of_ocaml:(Js_of_ocaml.Mode.Pair.make None)
~melange_package_name:None
Expand Down
Loading
Loading