Repository navigation
dep_rules: don't run (transitive) ocamldep on single module buildables - #12555
Merged
anmonteiro merged 2 commits intoOct 13, 2025
Conversation
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
marked this pull request as ready for review
October 12, 2025 07:44
rgrinberg
approved these changes
Oct 12, 2025
rgrinberg
left a comment
Member
There was a problem hiding this comment.
LGTM. A further improvement would be not to generate the rule for such singleton modules
Collaborator
Author
|
I'm not sure it's being generated now? |
anmonteiro
enabled auto-merge (squash)
October 13, 2025 03:34
…ingle-module-buildables
anmonteiro
deleted the
anmonteiro/dont-run-ocamldep-transitive-on-single-module-buildables
branch
October 13, 2025 07:31
Sudha247
pushed a commit
to Sudha247/dune
that referenced
this pull request
Oct 13, 2025
…les (ocaml#12555) Signed-off-by: Antonio Nuno Monteiro <[email protected]>
davesnx
added a commit
to davesnx/dune
that referenced
this pull request
Oct 14, 2025
* 'main' of github.com:/ocaml/dune: (147 commits) cram test: test only parameter flags in merlin generation fix(oxcaml): import eta-expansion changes from opam-repo (ocaml#12563) address review comments Mask the path to the stdlib fix(oxcaml): generate merlin config for library parameters fix(melange + include_qualified): track correct `.cmj` dependencies in emit (ocaml#12531) refactor: remove some unused code in [Path] (ocaml#12558) dep_rules: don't run (transitive) `ocamldep` on single module buildables (ocaml#12555) fix(pkg): ignore project settings for building packages test(pkg): reproduce ocaml#12131 melange: add a test for module cycle checks (ocaml#12554) chore: lint check for new changes entries (ocaml#12553) feature(cram): allow for conflict detection (ocaml#12538) ci: update for ocaml 5.4 release (ocaml#12552) chore(script): generate changelog from structure (ocaml#12516) Reuse dependencies between project and tools (ocaml#12526) Introduce Io.overwrite_file test: fix dune install requiring a mandir Enable package management for more tests Add a `dune tools env` command to add dev tools to PATH (ocaml#12521) ...
MisterDA
pushed a commit
to MisterDA/dune
that referenced
this pull request
Nov 13, 2025
…les (ocaml#12555) Signed-off-by: Antonio Nuno Monteiro <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 22, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 22, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 23, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 24, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 25, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 25, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 25, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 25, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 26, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 27, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 27, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 29, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 29, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 29, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 29, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
Apr 29, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
Apr 30, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
Apr 30, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
Apr 30, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
Apr 30, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 1, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 1, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 1, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 1, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 1, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 1, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 2, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 2, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 3, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 3, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 3, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 3, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, since in that case there is no filter benefit to gain. When `(libraries ...)` is declared, run ocamldep even for a single-module stanza so the filter has the data it needs. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 4, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 6, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 6, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 6, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 7, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 7, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 7, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 7, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 7, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 8, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 9, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
to robinbb/dune
that referenced
this pull request
May 9, 2026
…4572) Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to ocaml#3847 / ocaml#12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in ocaml#14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in ocaml#14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 10, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
added a commit
that referenced
this pull request
May 10, 2026
Previously, dune short-circuited ocamldep for every single-module stanza as an optimisation (dating back to #3847 / #12555, when ocamldep output was used only for intra-stanza dependencies). The short-circuit silently defeats the per-module inter-library filter introduced in #14116, because the filter reads ocamldep output to determine which libraries a module references. Narrow the short-circuit: apply it only when the stanza has no library dependencies at all, or when the stanza is built for Melange. In the no-deps case there is no filter benefit to gain; in the Melange case [lib_deps_for_module]'s [can_filter] guard returns [false] for melange [cm_kind]s, so the dep graph is never read and computing it is wasted work. Reported by @nojb in #14116 (comment) Includes a new test `single-module-unreferenced-lib.t` capturing the exact reproducer: libA and libB are both single-module, libB depends on libA but its only module does not reference libA's; modifying libA's module must not recompile libB's. Adding `.impl.d` / `.impl.all-deps` rules for these stanzas slightly changes the build-graph nodes traversed when dune reports error chains and dependency cycles. Update affected snapshots: * `enabled_if/eif-context_name.t`, `enabled_if/eif-ocaml_version.t`, `invalid-dune-package.t`, `optional-executable.t`, `stanzas/forbidden_libraries.t`, three `virtual-libraries/*` tests: a `-> required by _build/default/...dune__exe__*.cmx` chain entry is no longer visited before the error is reported, since the library-resolution failure is reached through an ocamldep rule that precedes the .cmx rule in the build graph. * `inline-tests/alias-cycle.t`: the dependency cycle is now walked through `.cmx` / `.cmxa` instead of `.cmi` / inline-tests exe nodes. Same cycle, different traversal. (A later commit replaces this snapshot with a walk-invariant assertion.) * `watching/multiple-errors-output.t`: ocamldep now runs on a deliberately malformed source (`let f = Bar.x + Baz.y + invalid_syntax : ? = !`) and reports a syntax error that compilation alone previously missed. The aggregated error count grows from 2 to 3. The Melange branch of the short-circuit means [emit-installed.t] and [emit-installed-two-modes.t] do not gain an [ocamldep (internal)] trace line: their [b/dune] stanzas are single-module melange libraries with library deps, exactly the case the new disjunct covers. Signed-off-by: Robin Bate Boerop <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
same as #3847, for
.all-deps