test: regression guard for modules_without_implementation cross-lib alias#14351
Merged
Alizter merged 1 commit intoApr 29, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a blackbox regression test to ensure that (modules_without_implementation ...) modules whose .mli contains a cross-library module alias still propagate correct .cmi dependencies, so that changing the aliased library’s interface triggers a clean rebuild (no “inconsistent assumptions over interface” failures). This guards the behavior ahead of future per-module inter-library dependency filtering work discussed in #14116.
Changes:
- Introduce a new blackbox test case covering cross-library aliases in a
(modules_without_implementation ...)module interface. - Assert that a dependent consumer rebuilds exactly once after the aliased library’s interface change (via
dune trace+jq).
…lias Documents that a stanza with [(modules_without_implementation foo)] whose [foo.mli] aliases a module from another library produces a sound rebuild when the aliased lib's interface changes — the consumer must rebuild without "inconsistent assumptions over interface" errors. Trunk satisfies this property today via cctx-wide compile-rule deps. The test asserts count = 1 and passes on [main]. Pre-emptive guard for future per-module dep-filter work (see ocaml#14116). The concern was raised by @art-w in ocaml#14116: the intra-stanza [trans_deps] graph skips [modules_without_implementation] entries, so a per-module filter that relies on it could miss the cross-lib alias and leave the consumer's rule without a dep on the aliased lib's [.cmi]. Signed-off-by: Robin Bate Boerop <me@robinbb.com>
3b35ef2 to
397bd1f
Compare
Alizter
approved these changes
Apr 29, 2026
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.
Summary
Documents that a stanza with
(modules_without_implementation foo)whose
foo.mlialiases a module from another library produces asound rebuild when the aliased lib's interface changes — the
consumer must rebuild without "inconsistent assumptions over
interface" errors.
Trunk satisfies this property today via cctx-wide compile-rule
deps. The test asserts count = 1 and passes on
main.Pre-emptive regression guard for future per-module dep-filter
work (see #14116). The concern was raised by @art-w during review:
the intra-stanza
trans_depsgraph skips(modules_without_implementation)entries, so a per-module filterthat relied on it could miss the cross-lib alias and leave the
consumer's rule without a dep on the aliased lib's
.cmi—surfacing on rebuild as an "inconsistent assumptions" error.