Repository navigation
test(pkg): validate-lockdir on a self-referencing constraint - #15617
Merged
Merged
Conversation
This was referenced Jul 29, 2026
punchagan
approved these changes
Jul 29, 2026
The solver evaluates local dependency formulas with the package's own name and version bound as self variables, so a constraint like (= :version) resolves against the depending package. Validation evaluates the same formula without the self bindings: the version constraint silently drops instead of binding, and a lockdir whose locked dependency violates the constraint is accepted. Signed-off-by: Ali Caglayan <[email protected]>
Alizter
force-pushed
the
push-svyovxtrqrwy
branch
from
July 29, 2026 12:02
b84ba04 to
1d1f1e8
Compare
Collaborator
Author
|
Just tweaked the sed line because of macos |
Alizter
added a commit
that referenced
this pull request
Jul 31, 2026
…15618) ## Description Factor local-package dependency-formula evaluation into `Lock_pkg.local_package_dependencies` and use it from both the solver and `Package_universe`. The shared path binds the local package name and version as self variables, injects the running Dune version, and removes the Dune pseudo-package from the concrete dependency list. This keeps validation aligned with lock solving and fixes both self-referencing version constraints and direct dependencies on Dune. ## Related Issue and Motivation Depends on #15617, which adds the self-referencing constraint regression test. This PR is stacked on that change and remains a draft while the predecessor is under review. ## Checklist - [x] Tests added in #15617. - [ ] [Change log entry added](../CONTRIBUTING.md#updating-the-changelog) for any user-facing changes. - [x] Documentation not applicable; this is an internal consistency fix.
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-lockdiraccepts an invalid lockdir when a local package dependency constraint refers to the package own version with:version.The solver evaluates local dependency formulas with the package name and version bound as self variables. Validation currently evaluates the same formula without those bindings, so the guarded version constraint is silently dropped.
Related Issue and Motivation
This is the first change in the fix series and captures the current behavior before the validation fix.
Checklist