-
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.
- Loading branch information
Showing
9 changed files
with
196 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
"b" | ||
"c" | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
"file://$OPAM_MONOREPO_CWD/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 @@ | ||
thomas@girolata.local.73356 |
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,14 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
"b" | ||
"c" | ||
] | ||
pin-depends:[ | ||
["a" "https://x"] | ||
["base-bigarrays" "https://y"] | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
"file://$OPAM_MONOREPO_CWD/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,10 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
"b" | ||
"c" | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
"file://$OPAM_MONOREPO_CWD/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,12 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
] | ||
build: [ "dune" "build" ] | ||
dev-repo: "git+https://github.com/b/b" | ||
url { | ||
src: "https://b.com/b.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,12 @@ | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
] | ||
build: [ "dune" "build" ] | ||
dev-repo: "git+https://github.com/c/c" | ||
url { | ||
src: "https://c.com/c.tbz" | ||
checksum: [ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000001" | ||
] | ||
} |
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 @@ | ||
opam-version: "2.0" |
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,70 @@ | ||
We have a simple project with a single package defined at the root. | ||
It has a `x-opam-monorepo-opam-repositories` field set to use a local | ||
opam-repository for locking and a pinned package. | ||
|
||
$ cat pin-depends.opam | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
"b" | ||
"c" | ||
] | ||
pin-depends:[ | ||
["a" "https://x"] | ||
["base-bigarrays" "https://y"] | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
"file://$OPAM_MONOREPO_CWD/repo" | ||
] | ||
|
||
We provided a minimal opam-repository but locking should be successful. | ||
|
||
$ gen-minimal-repo | ||
$ opam-monorepo lock | ||
==> Using 1 locally scanned package as the target. | ||
==> Found 10 opam dependencies for the target package. | ||
==> Querying opam database for their metadata and Dune compatibility. | ||
==> Calculating exact pins for each of them. | ||
==> Wrote lockfile with 2 entries to $TESTCASE_ROOT/pin-depends.opam.locked. You can now run opam monorepo pull to fetch their sources. | ||
|
||
The lockfile should contain the base packages, dune and our 2 dependencies | ||
`b` and `c` which should be pulled in the duniverse | ||
|
||
$ cat pin-depends.opam.locked | ||
opam-version: "2.0" | ||
synopsis: "opam-monorepo generated lockfile" | ||
maintainer: "opam-monorepo" | ||
depends: [ | ||
"b" {= "1" & ?vendor} | ||
"base-bigarray" {= "base"} | ||
"base-threads" {= "base"} | ||
"base-unix" {= "base"} | ||
"c" {= "1" & ?vendor} | ||
"dune" {= "2.9.1"} | ||
"ocaml" {= "4.13.1"} | ||
"ocaml-base-compiler" {= "4.13.1"} | ||
"ocaml-config" {= "2"} | ||
"ocaml-options-vanilla" {= "1"} | ||
] | ||
x-opam-monorepo-duniverse-dirs: [ | ||
[ | ||
"https://b.com/b.tbz" | ||
"b" | ||
[ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000000" | ||
] | ||
] | ||
[ | ||
"https://c.com/c.tbz" | ||
"c" | ||
[ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000001" | ||
] | ||
] | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" "file://$OPAM_MONOREPO_CWD/repo" | ||
] | ||
x-opam-monorepo-root-packages: ["pin-depends"] | ||
x-opam-monorepo-version: "0.3" |
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,66 @@ | ||
We have a simple project with a single package defined at the root. | ||
It has a `x-opam-monorepo-opam-repositories` field set to use a local | ||
opam-repository for locking | ||
|
||
$ cat simple-lock.opam | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" | ||
"b" | ||
"c" | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" | ||
"file://$OPAM_MONOREPO_CWD/repo" | ||
] | ||
|
||
We provided a minimal opam-repository but locking should be successful. | ||
|
||
$ gen-minimal-repo | ||
$ opam-monorepo lock | ||
==> Using 1 locally scanned package as the target. | ||
==> Found 10 opam dependencies for the target package. | ||
==> Querying opam database for their metadata and Dune compatibility. | ||
==> Calculating exact pins for each of them. | ||
==> Wrote lockfile with 2 entries to $TESTCASE_ROOT/simple-lock.opam.locked. You can now run opam monorepo pull to fetch their sources. | ||
|
||
The lockfile should contain the base packages, dune and our 2 dependencies | ||
`b` and `c` which should be pulled in the duniverse | ||
|
||
$ cat simple-lock.opam.locked | ||
opam-version: "2.0" | ||
synopsis: "opam-monorepo generated lockfile" | ||
maintainer: "opam-monorepo" | ||
depends: [ | ||
"b" {= "1" & ?vendor} | ||
"base-bigarray" {= "base"} | ||
"base-threads" {= "base"} | ||
"base-unix" {= "base"} | ||
"c" {= "1" & ?vendor} | ||
"dune" {= "2.9.1"} | ||
"ocaml" {= "4.13.1"} | ||
"ocaml-base-compiler" {= "4.13.1"} | ||
"ocaml-config" {= "2"} | ||
"ocaml-options-vanilla" {= "1"} | ||
] | ||
x-opam-monorepo-duniverse-dirs: [ | ||
[ | ||
"https://b.com/b.tbz" | ||
"b" | ||
[ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000000" | ||
] | ||
] | ||
[ | ||
"https://c.com/c.tbz" | ||
"c" | ||
[ | ||
"sha256=0000000000000000000000000000000000000000000000000000000000000001" | ||
] | ||
] | ||
] | ||
x-opam-monorepo-opam-repositories: [ | ||
"file://$OPAM_MONOREPO_CWD/minimal-repo" "file://$OPAM_MONOREPO_CWD/repo" | ||
] | ||
x-opam-monorepo-root-packages: ["simple-lock"] | ||
x-opam-monorepo-version: "0.3" |