Repository navigation
test: regression guard for cross-lib reads of unwrapped libs with [private_modules] - #14388
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a blackbox regression guard to ensure a consumer can compile against an unwrapped library that uses (private_modules ...), protecting against future inter-library/per-module dependency tracking regressions that might accidentally depend on internal .cmi paths instead of the public ones.
Changes:
- Add a new blackbox test case
private-modules.tunderper-module-lib-deps/. - Test sets up an unwrapped library with one public module that depends on a private module, plus a separate consumer library that references only the public module.
- Asserts the build succeeds (intended to catch regressions where public
.cmimaterialization isn’t triggered/available to the consumer).
robinbb
force-pushed
the
robinbb-test-private-modules
branch
2 times, most recently
from
April 30, 2026 23:15
96c8d45 to
82ee202
Compare
robinbb
marked this pull request as ready for review
April 30, 2026 23:39
robinbb
force-pushed
the
robinbb-test-private-modules
branch
from
May 1, 2026 01:05
82ee202 to
196cb45
Compare
Leonidas-from-XIV
previously requested changes
May 1, 2026
…ivate_modules] Adds [test-cases/per-module-lib-deps/private-modules.t]. Documents that a consumer of an unwrapped library that uses [private_modules] builds without error today. Companion to the other observational baselines under [test-cases/per-module-lib-deps/]: each pins a structural shape that an inter-library filter must respect. Signed-off-by: Robin Bate Boerop <[email protected]>
robinbb
force-pushed
the
robinbb-test-private-modules
branch
from
May 1, 2026 14:09
196cb45 to
d62a088
Compare
robinbb
dismissed
Leonidas-from-XIV’s stale review
May 1, 2026 16:30
I have made the requested change, but don't want to wait for the reviewer to verify that.
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
Adds
test-cases/per-module-lib-deps/private-modules.t, an observational baseline asserting that a consumer of an unwrapped library that usesprivate_modulesbuilds without error.Why
When an unwrapped library has
private_modules, dune produces public modules' cmis in a separate.objs/public_cmidirectory (via a copy rule from the internal object dir), so consumers see only the public cmis on their-Isearch path. Any future inter-library dependency tracking that emits per-module cmi deps must point at the public cmi path, not the internal one — otherwise the produce-public-cmi rule doesn't run and sandboxed compiles fail to find the cmi.This pitfall surfaced during #14116 development. The test guards against the same shape of regression in any future inter-library dep-tracking change.
Test plan
maintoday:dune runtest test/blackbox-tests/test-cases/per-module-lib-deps/private-modules.tpasses.consumer/c.mlto reference an unbound module — the test diffs against the resulting compile error, confirming the assertion catches build failures.Companion to the other observational baselines under
test-cases/per-module-lib-deps/(transitive-unreferenced-module.t,cross-lib-ppx.t, etc.): each pins a structural shape that an inter-library filter must respect.Related: #14116