-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from NathanReb/fix-empty-duniverse-dirs
Fix parsing of lock files with empty duniverses
- Loading branch information
Showing
4 changed files
with
49 additions
and
6 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
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,8 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"ocaml" | ||
"dune" | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
] |
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,27 @@ | ||
One should be able to generate a lock file where no dependencies need to | ||
be vendored and that should result in an empty duniverse. | ||
That can happen if one has no external deps besides 'dune' and 'ocaml' | ||
or if those are marked as 'opam-provided' for example. | ||
|
||
Here our local package only depends on 'ocaml' and 'dune': | ||
|
||
$ opam show --just-file -fdepends ./empty-duniverse.opam | ||
ocaml, dune | ||
|
||
We should be able to successfully lock: | ||
|
||
$ gen-minimal-repo | ||
$ opam-monorepo lock > /dev/null | ||
|
||
And the lock file should not contain anything to vendor: | ||
|
||
$ opam show --just-file -fdepends ./empty-duniverse.opam.locked | grep "\?vendor" | ||
[1] | ||
|
||
Finally, we should be able to pull this lock file, the tool will inform us that | ||
there is nothing to pull and will not create a duniverse: | ||
|
||
$ opam-monorepo pull | ||
==> Using lockfile $TESTCASE_ROOT/empty-duniverse.opam.locked | ||
==> No dependencies to pull, there's nothing to be done here! | ||
$ find . -type d -name 'duniverse' |