test: verify incremental builds with alias re-exported libraries (#4572)#14129
Merged
rgrinberg merged 1 commit intoocaml:mainfrom Apr 10, 2026
Merged
Conversation
98c11e5 to
b0bd29d
Compare
…ml#4572) Add test verifying that when a library re-exports a dependency via a module alias (module Impl = Impl), incremental builds correctly recompile consumers when the re-exported library's .cmi changes. Soft changes (implementation only, no .cmi change) can safely skip recompilation due to -opaque. Hard changes (.cmi modified) must trigger recompilation to avoid inconsistent interface assumptions. Reproduction case from @art-w. Signed-off-by: Robin Bate Boerop <me@robinbb.com>
b0bd29d to
8c2e3b2
Compare
rgrinberg
reviewed
Apr 10, 2026
| Main is rebuilt (necessary — impl.cmi changed and main.ml uses | ||
| Impl through the Alias re-export): | ||
|
|
||
| $ dune trace cat | jq -s 'include "dune"; [.[] | targetsMatchingFilter(test("Main"))] | length | . > 0' |
Member
There was a problem hiding this comment.
Do we need the length and predicate here? Seeing the target would be enough.
Contributor
Author
There was a problem hiding this comment.
Alas, yes, as the length is actually different on different platforms (Mac vs. non-Mac), which caused what I had here originally (the unfiltered uncounted output) to fail CI.
Contributor
Author
There was a problem hiding this comment.
... because the output was different on different platforms, and even the filtered output was different (hence the non-zero count check instead of a firm count).
Contributor
Author
|
@rgrinberg Back to you. I can't give you what you want (per my comment). I wanted it, too. :-( |
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
Add test verifying that when a library re-exports a dependency via a
module alias (
module Impl = Impl), incremental builds correctlyrecompile consumers when the re-exported library's
.cmichanges..cmichange) can safely skiprecompilation due to
-opaque.cmimodified) must trigger recompilation to avoidinconsistent interface assumptions
executables skip ocamldep)
Reproduction case from @art-w.
Ref: #4572
Test plan
main(no filtering active, all deps present)