Repository navigation
test(pkg): validate-lockdir on a direct dune dependency - #15616
Merged
Merged
Conversation
The solver evaluates local dependency formulas with the running version of dune injected and strips dune from the solution, so a local package with a direct dependency on dune locks to an empty lockdir. Validation resolves the same formula without injecting dune and reports the freshly generated lockdir as having no solution, with a regenerate hint that cannot help. Signed-off-by: Ali Caglayan <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds a blackbox regression test for dune pkg validate-lockdir that demonstrates the current mismatch when a local (workspace) package depends directly on dune: the lockdir solver implicitly injects the running Dune version (so it doesn’t appear in the lockdir), but validate-lockdir re-checks the dependency formula without that injection and rejects the freshly generated lockdir.
Changes:
- Extend the existing
validate-lockdirblackbox test to create a local package that directly depends ondune. - Assert that
dune pkg lockproduces a lockdir with no locked dependencies in this case. - Assert that
dune pkg validate-lockdirthen fails with “Package "dune" is missing”, capturing the regression.
punchagan
approved these changes
Jul 29, 2026
punchagan
left a comment
Contributor
There was a problem hiding this comment.
Nice catch! Looks good to me.
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.
Description
Add a regression test showing that
dune pkg validate-lockdirrejects a freshly generated lock directory when a local workspace package depends directly on Dune. The solver injects the running Dune version and omits it from the lock directory, while validation currently resolves the dependency formula without that injection.Related Issue and Motivation
This captures the validation mismatch.
Checklist