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

package ~pin doesn't always respect the pin #1375

Open
reynir opened this issue Nov 17, 2022 · 1 comment
Open

package ~pin doesn't always respect the pin #1375

reynir opened this issue Nov 17, 2022 · 1 comment

Comments

@reynir
Copy link
Member

reynir commented Nov 17, 2022

This may be an issue with opam-monorepo, but I observe it when using mirage.

When I pin a package in Mirage it is not always reflected in the lock file:

let packages = [
  package ~min:"3.7.0" "git-paf" ~pin_version:"3.10.0" ~pin:"git+https://github.com/mirage/ocaml-git.git#fix-http-and-smart-version";
  package ~min:"3.7.0" "git" ~pin_version:"3.10.0" ~pin:"git+https://github.com/mirage/ocaml-git.git#fix-http-and-smart-version";
  package "git-kv";
  package "tls-mirage";
  package ~min:"1.3.0" "magic-mime";
  package "logs";
  package "awa";
  package "awa-mirage";
  package ~min:"0.3.0" "letsencrypt";
  package ~min:"0.3.0" "paf" ~sublibs:[ "mirage" ];
  package ~min:"0.3.0" "paf-le";
  package "oneffs" ~pin:"git+https://github.com/reynir/oneffs.git" ~pin_version:"42";
]

mirage/unipi-unix.opam:

depends: [
[[[...SNIP...]]]
  "git" { ?monorepo & >= "3.7.0" }
  "git-kv" { ?monorepo }
  "git-mirage" { ?monorepo & >= "3.10.0" & < "3.11.0" }
  "git-paf" { ?monorepo & >= "3.7.0" }
  "happy-eyeballs-mirage" { ?monorepo & >= "0.3.0" & < "1.0.0" }
[[[...SNIP...]]]
  "oneffs" { ?monorepo }
  "opam-monorepo" { build & >= "0.3.2" }
[[[...SNIP...]]]
]
[[[...SNIP...]]]
pin-depends: [ ["oneffs.42" "git+https://github.com/reynir/oneffs.git"]
               ["git-paf.3.10.0" "git+https://github.com/mirage/ocaml-git.git#fix-http-and-smart-version"]
               ["git.3.10.0" "git+https://github.com/mirage/ocaml-git.git#fix-http-and-smart-version"]
]

mirage/unipi-unix.opam.locked:

[[[...SNIP...]]]
  [
    "git.3.10.0"
    "https://github.com/mirage/ocaml-git/releases/download/3.10.0/git-3.10.0.tbz"
  ]
  [
    "git-kv.0.0.1"
    "https://github.com/roburio/git-kv/releases/download/v0.0.1/git-kv-0.0.1.tbz"
  ]
  [
    "git-mirage.3.10.0"
    "https://github.com/mirage/ocaml-git/releases/download/3.10.0/git-3.10.0.tbz"
  ]
  [
    "git-paf.3.10.0"
    "https://github.com/mirage/ocaml-git/releases/download/3.10.0/git-3.10.0.tbz"
  ]
  [
    "git-unix.3.10.0"
    "https://github.com/mirage/ocaml-git/releases/download/3.10.0/git-3.10.0.tbz"
  ]
[[[...SNIP...]]]
  [
    "oneffs.42"
    "git+https://github.com/reynir/oneffs.git#ccba8241a1a687ca2e6ecdd518c5b687034257ce"
  ]
[[[...SNIP...]]]

As you can see the source for git*.3.10.0 is the opam source even though we pinned git.3.10.0 and git-paf.3.10.0. Meanwhile oneffs.42 is correctly pinned to the git repository.

Since git, git-mirage, git-paf and git-unix all share the same source directory it would not be possible to use both the opam source as well as the git repository, but I would rather expect an error than ignoring the pin.

@reynir
Copy link
Member Author

reynir commented Nov 18, 2022

See tarides/opam-monorepo#145

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

1 participant