test: regression guard for (root_module ...) + (libraries ...)#14439
Draft
robinbb wants to merge 1 commit intoocaml:mainfrom
Draft
test: regression guard for (root_module ...) + (libraries ...)#14439robinbb wants to merge 1 commit intoocaml:mainfrom
robinbb wants to merge 1 commit intoocaml:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new blackbox regression test to guard Dune’s build correctness when a library uses (root_module ...) alongside (libraries ...), specifically when consumer modules reference a dependency through the synthesized Root alias (covering the synthesized-.d dependency-rule path for root modules).
Changes:
- Add a new cram/blackbox test case
root-module-tight-deps.tunderper-module-lib-deps/to assert the scenario builds successfully.
1 task
Adds [test-cases/per-module-lib-deps/root-module-tight-deps.t]. Asserts that a library declaring [(root_module ...)] alongside [(libraries ...)] builds correctly when its modules reference the dep library through the Root alias. Root modules carry their own dep-rule shape: dune synthesises the [.d] file for the Root module (no [.all-deps], to avoid the cycle that would arise from a Root that references itself transitively). Any future change to inter-library dep handling that misses the synthesised-[.d] path would regress this scenario. Forward-looking guard. The build path on current main uses a broad-glob over the dep library's objdir, so the test passes trivially today. The synthesised-[.d] path is still exercised by rule generation, and that is what the test pins. Signed-off-by: Robin Bate Boerop <me@robinbb.com>
b0d33fe to
960145f
Compare
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/blackbox-tests/test-cases/per-module-lib-deps/root-module-tight-deps.t, a forward-looking guard that asserts a library declaring(root_module ...)alongside(libraries ...)builds correctly when its modules reference the dep library through the Root alias.Root modules carry their own dep-rule shape: dune synthesises the
.dfile for the Root module (no.all-deps, to avoid the cycle that would arise from a Root that references itself transitively). Any future change to inter-library dep handling that misses the synthesised-.dpath would regress this scenario. On currentmainthe build path uses a broad-glob over the dep library's objdir, so the test passes trivially today; the synthesised-.dpath is still exercised by rule generation, and that is what the test pins.Same shape as #14400 (cross-lib pre-pp guard) and #14403 (invalid
-openguard) — small standalone tests landed ahead of larger work that would touch the same code paths. Spun out of #14116 so #14116's chain doesn't carry the test.Test plan
dune runtest test/blackbox-tests/test-cases/per-module-lib-deps/root-module-tight-deps.tpasses on this branch.