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

Unable to verify version bounds for a pin-depend #13

Closed
ralsei opened this issue Jul 5, 2022 · 6 comments
Closed

Unable to verify version bounds for a pin-depend #13

ralsei opened this issue Jul 5, 2022 · 6 comments

Comments

@ralsei
Copy link

ralsei commented Jul 5, 2022

Describe the bug
When placing version bounds in depends as well as having a pin-depend for the same dependency, opam-nix (or its call to OPAM) fails to verify that the package is of the correct version (despite running OPAM manually succeeding):

error: builder for '/nix/store/9rlbv11lhf3ghpxdyclr1f2x2n0mxy47-resolve.drv' failed with exit code 20;
       last 5 log lines:
       > [ERROR] No solution including optional dependencies for cooltt.0.0 & ocaml-base-compiler:   * Missing dependency:
       >             - bantorra < 0.2
       >             no matching version
       >
       >

To Reproduce
flake.nix is exactly the same as in #12.

cooltt.opam (different):

opam-version: "2.0"
name: "cooltt"
version: "0.0"
maintainer: "Jonathan Sterling <[email protected]>"
authors: ["The RedPRL Development Team"]
homepage: "https://github.com/RedPRL/cooltt"
bug-reports: "https://github.com/RedPRL/cooltt/issues"
dev-repo: "git+https://github.com/RedPRL/cooltt.git"
synopsis: "Experimental implementation of Cartesian cubical type theory"
license: "Apache-2.0"
depends: [
  "dune" {>= "2.0"}
  "ocaml" {>= "4.10.0"}
  "ppx_deriving" {>= "4.4.1"}
  "bantorra" {>= "0.1" & < "0.2"}
  "bwd" {>= "1.2"}
  "cmdliner" {>= "1.1"}
  "containers" {>= "3.4"}
  "ezjsonm" {>= "1.2.0"}
  "menhir" {>= "20180703"}
  "uuseg" {>= "12.0.0"}
  "uutf" {>= "1.0.2"}
  "yuujinchou" {>= "2.0.0" & < "3"}
  "odoc" {with-doc}
  "kado"
]
pin-depends: [
  [ "kado.~dev" "git+https://github.com/RedPRL/kado" ]
  [ "bantorra.0.1.0" "git+https://github.com/RedPRL/bantorra#1e78633d9a2ef7104552a24585bb8bea36d4117b" ]
]
build: [
  ["dune" "build" "-p" name "-j" jobs]
  ["dune" "build" "-p" name "-j" jobs "@runtest"] {with-test}
  ["dune" "build" "-p" name "-j" jobs "@doc"] {with-doc}
]

Expected behavior
It should find the package and build normally.

Environment

  • OS name + version: NixOS 22.05
  • Version of the code: Latest as of writing
@balsoft
Copy link
Collaborator

balsoft commented Jul 5, 2022

https://github.com/RedPRL/bantorra/blob/1e78633d9a2ef7104552a24585bb8bea36d4117b/bantorra.opam doesn't specify its version in any way, so opam-nix resorts to adding it as packages/bantorra/bantorra.dev. I wonder how opam deals with this when "building manually". Could you provide some example commands which work for you?

@balsoft
Copy link
Collaborator

balsoft commented Jul 5, 2022

As a workaround, you can either

  1. Specify version in the bantorra.opam package
  2. Remove the constraint (I know this is not great, but I don't understand how opam handles this here anyways)

@balsoft
Copy link
Collaborator

balsoft commented Jul 5, 2022

Ah, sorry, I just realised that the version is specified right there in pin-depends 🤦. I'll fix this.

@balsoft balsoft closed this as completed in 09accb1 Jul 5, 2022
@balsoft
Copy link
Collaborator

balsoft commented Jul 5, 2022

Please check if this is fixed :)

balsoft added a commit that referenced this issue Jul 5, 2022
@balsoft
Copy link
Collaborator

balsoft commented Jul 5, 2022

Whoops, sorry, the first commit was broken. This one should be better.

@ralsei
Copy link
Author

ralsei commented Jul 5, 2022

Works fine, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants