feat(pkg): ignore opam upper bounds on dune#14638
Draft
Alizter wants to merge 1 commit into
Draft
Conversation
Opam packages occasionally declare upper bounds on dune, e.g.
```
depends: [ "dune" {>= "3.0" & < "3.17"} ]
```
Dune's backward-compatibility guarantee makes these bounds grow stale
quickly, but until now they would cause a hard solver failure whenever
the running dune didn't fit.
In many cases, asking the (archive) repository maintainers to lift these
boudns is impractical because they have been added from an opam point of
view.
There isn't anything meaningful we can do with an upper bound of dune.
Relaxing this restriction adds flexibility to the kinds of packages that
dune pkg is interoperable with.
We therefore strip upper bounds ([<], [<=]) on the dune atom from
depends formulas before they reach the solver. Lower bounds, equality,
inequality, and filter sub-atoms are preserved. The lower bound is still
a meaningful "minimum dune required" signal, that would otherwise be an
error much later in the build.
Two tests for this restriction have been accordingly updated:
- `test/blackbox-tests/test-cases/pkg/implicit-dune-constraint.t`
- `test/blackbox-tests/test-cases/pkg/unsatisfied-version-constraint-on-dune.t`
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Collaborator
Author
|
I'll let this sit as draft for a bit so the consequences of this change can marinate in my brain. |
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.
Opam packages occasionally declare upper bounds on dune, e.g.
Dune's backward-compatibility guarantee makes these bounds grow stale quickly, but until now they would cause a hard solver failure whenever the running dune didn't fit.
In many cases, asking the (archive) repository maintainers to lift these boudns is impractical because they have been added from an opam point of view.
There isn't anything meaningful we can do with an upper bound of dune. Relaxing this restriction adds flexibility to the kinds of packages that dune pkg is interoperable with.
We therefore strip upper bounds ([<], [<=]) on the dune atom from depends formulas before they reach the solver. Lower bounds, equality, inequality, and filter sub-atoms are preserved. The lower bound is still a meaningful "minimum dune required" signal, that would otherwise be an error much later in the build.
Two tests for this restriction have been accordingly updated:
test/blackbox-tests/test-cases/pkg/implicit-dune-constraint.ttest/blackbox-tests/test-cases/pkg/unsatisfied-version-constraint-on-dune.t