-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(pkg): add implicit constraint on dune (#8899)
This constraint is almost always what the user wants if they are planning to use the same dune that generated the build plan to build it Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
- Loading branch information
Showing
3 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
31 changes: 31 additions & 0 deletions
31
test/blackbox-tests/test-cases/pkg/implicit-dune-constraint.t
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
By default, we introduce a constraint on in the build plan that will require | ||
the dune version to match the version of dune being used to generate the | ||
constraint. | ||
|
||
$ . ./helpers.sh | ||
$ mkrepo | ||
|
||
$ mkpkg dune 3.11.0 <<EOF | ||
> EOF | ||
|
||
$ test() { | ||
> mkpkg foo <<EOF | ||
> depends: [ "dune" {<= "$1"} ] | ||
> EOF | ||
> solve foo | ||
> } | ||
|
||
$ test "2.0.0" | ||
Error: Unable to solve dependencies in build context: default | ||
Can't find all required versions. | ||
Selected: foo.0.0.1 x.dev | ||
- dune -> (problem) | ||
User requested = 3.11 | ||
Rejected candidates: | ||
dune.3.11.0: Incompatible with restriction: = 3.11 | ||
[1] | ||
$ test "4.0.0" | ||
Solution for dune.lock: | ||
dune.3.11.0 | ||
foo.0.0.1 | ||
|