-
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.
Error when multiple dev-repos collide on dir
The duniverse directory of a package is implied by its dev-repo. It's possible for different dev-repos to map to the same directory. Prior to this change, one lucky package would be downloaded to the expected place and the others would be silently ignored. More precisely, each package would be downloaded and placed in the duniverse dir implied by their dev-repo, but first any existing duniverse dir of the same name would be removed. After this change, the same situation results in an error when running `opam monorepo lock`. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
9 changed files
with
120 additions
and
4 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
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
12 changes: 12 additions & 0 deletions
12
test/bin/error-on-directory-conflict.t/repo/packages/bar/bar.0.1.0/opam
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,12 @@ | ||
opam-version: "2.0" | ||
dev-repo: "git+https://github.com/bar/project" | ||
depends: [ | ||
"dune" | ||
] | ||
build: [ "dune" "build" ] | ||
url { | ||
src: "https://test.com/bar.tbz" | ||
checksum: [ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000000" | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
test/bin/error-on-directory-conflict.t/repo/packages/foo-branch/foo-branch.0.1.0/opam
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,12 @@ | ||
opam-version: "2.0" | ||
dev-repo: "git+https://github.com/foo/project.git#branch" | ||
depends: [ | ||
"dune" | ||
] | ||
build: [ "dune" "build" ] | ||
url { | ||
src: "https://test.com/foo-branch.tbz" | ||
checksum: [ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000000" | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
test/bin/error-on-directory-conflict.t/repo/packages/foo/foo.0.1.0/opam
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,12 @@ | ||
opam-version: "2.0" | ||
dev-repo: "git+https://github.com/foo/project" | ||
depends: [ | ||
"dune" | ||
] | ||
build: [ "dune" "build" ] | ||
url { | ||
src: "https://test.com/foo.tbz" | ||
checksum: [ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000000" | ||
] | ||
} |
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,16 @@ | ||
We have a project which depends on multiple packages with different dev-repos | ||
but which happen to resolve to the same directory under duniverse. This tests | ||
that such a situation results in an explicit error. | ||
|
||
$ gen-minimal-repo | ||
$ opam-monorepo lock | ||
==> Using 1 locally scanned package as the target. | ||
==> Found 11 opam dependencies for the target package. | ||
==> Querying opam database for their metadata and Dune compatibility. | ||
==> Calculating exact pins for each of them. | ||
opam-monorepo: [ERROR] Multiple dev-repos would be vendored into the directory: duniverse/project | ||
Dev-repos: | ||
- git+https://github.com/foo/project.git#branch | ||
- git+https://github.com/foo/project | ||
- git+https://github.com/bar/project | ||
[1] |
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,10 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"foo" | ||
"foo-branch" | ||
"bar" | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
"file://$OPAM_MONOREPO_CWD/repo" | ||
] |