Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opam monorepo lock fails if repos specified #333

Open
RyanGibb opened this issue Sep 22, 2022 · 4 comments
Open

opam monorepo lock fails if repos specified #333

RyanGibb opened this issue Sep 22, 2022 · 4 comments
Labels
good first issue Good for newcomers investigate Issues that require further investigation to understand the issue

Comments

@RyanGibb
Copy link

opam monorepo fails if the repos are specified:

$ ~/projects/opam-monorepo/_build/default/bin/opam_monorepo.exe lock --require-cross-compile --build-only hello-unix -l mirage/hello-unix.opam.locked --ocaml-version $(ocamlc --version) --opam-repositories '[/home/ryan/projects/opam-repository,/home/ryan/projects/opam-overlays,/home/ryan/projects/mirage-opam-overlays]'
==> Using 1 locally scanned package as the target.
opam_monorepo.exe: [ERROR] Solving opam-provided dependencies could not find a solution
opam_monorepo.exe: [ERROR] There is no eligible version of mirage that matches >= 4.1.0 & < 4.2.0
opam_monorepo.exe: [ERROR] Can't find all required versions.
...
- mirage -> (problem)
    hello-unix zdev requires >= 4.1.0 & < 4.2.0
    Rejected candidates:
      mirage.3.10.8: Incompatible with restriction: >= 4.1.0 & < 4.2.0
      mirage.3.10.7: Incompatible with restriction: >= 4.1.0 & < 4.2.0
      mirage.3.10.6: Incompatible with restriction: >= 4.1.0 & < 4.2.0
      mirage.3.10.5: Incompatible with restriction: >= 4.1.0 & < 4.2.0
      mirage.3.10.4: Incompatible with restriction: >= 4.1.0 & < 4.2.0
      ...
...

But works if the switch's repos are used:

$ opam repo list
[NOTE] These are the repositories in use by the current switch. Use '--all' to see all configured repositories.

<><> Repository configuration for switch default ><><><><><><><><><><><><><><><>
 1 mirage-overlays git+https://github.com/dune-universe/mirage-opam-overlays.git
 2 opam-overlays   git+https://github.com/dune-universe/opam-overlays.git
 3 default         https://opam.ocaml.org/
$ ~/projects/opam-monorepo/_build/default/bin/opam_monorepo.exe lock --require-cross-compile --build-only hello-unix -l mirage/hello-unix.opam.locked --ocaml-version $(ocamlc --version)
==> Using 1 locally scanned package as the target.
==> Found 64 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 33 entries to mirage/hello-unix.opam.locked. You can now run opam monorepo pull to fetch their sources.
@RyanGibb
Copy link
Author

This seems to be mirage specific as testing with a minimal project depending on package with an overlay in opam-overlays works

@RyanGibb
Copy link
Author

Notably mirage changed dune to a test dependency in 4.0.0. But that begs the question why it works with the switch repos but not manually specified ones.

@RyanGibb
Copy link
Author

Also the same error results with --add-opam-repositories or in the opam file x-opam-monorepo-opam-repositories.

@Leonidas-from-XIV
Copy link
Member

Whether dune is a test dependency shouldn't matter I think, because it is special-cased in the code. If there is no dune, we can't build anything anyway :)

@tmattio tmattio added investigate Issues that require further investigation to understand the issue good first issue Good for newcomers labels Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers investigate Issues that require further investigation to understand the issue
Projects
None yet
Development

No branches or pull requests

3 participants