Skip to content

test: regression guard for modules_without_implementation cross-lib alias#14351

Merged
Alizter merged 1 commit into
ocaml:mainfrom
robinbb:robinbb-test-modules-without-implementation-cross-lib
Apr 29, 2026
Merged

test: regression guard for modules_without_implementation cross-lib alias#14351
Alizter merged 1 commit into
ocaml:mainfrom
robinbb:robinbb-test-modules-without-implementation-cross-lib

Conversation

@robinbb
Copy link
Copy Markdown
Collaborator

@robinbb robinbb commented Apr 27, 2026

Summary

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 regression guard for future per-module dep-filter
work (see #14116). The concern was raised by @art-w during review:
the intra-stanza trans_deps graph skips
(modules_without_implementation) entries, so a per-module filter
that 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@robinbb robinbb marked this pull request as ready for review April 27, 2026 05:19
…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>
@robinbb robinbb force-pushed the robinbb-test-modules-without-implementation-cross-lib branch from 3b35ef2 to 397bd1f Compare April 27, 2026 15:41
@Alizter Alizter self-assigned this Apr 29, 2026
@Alizter Alizter merged commit 35849a5 into ocaml:main Apr 29, 2026
55 of 59 checks passed
@robinbb robinbb deleted the robinbb-test-modules-without-implementation-cross-lib branch April 29, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants