ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.21k stars 348 forks source link

The instructions for compiling the repo using `opam pin` appear to be out of date? #5945

Open shonfeder opened 2 months ago

shonfeder commented 2 months ago

The README currently advises

https://github.com/ocaml/opam/blob/b3d2f5c554e6ef3cc736a9f97e252486403e050f/README.md#L18-L19

But to get a working install I actually had to pin all the dependencies of the various opam libraries in the right order. Based on my notes, I think this command should currently give a working install:

opam pin opam-core --dev-repo -y &&\
    opam pin opam-format --dev-repo -y &&\
    opam pin opam-repository --dev-repo -y &&\
    opam pin opam-state --dev-repo -y &&\
    opam pin opam-solver --dev-repo -y &&\
    opam pin opam-client --dev-repo -y &&\
    opam pin add opam-devel --dev -y

I kind of doubt we want to replace the current readme line with this recipe, but maybe we could do something like...

  1. Put it in a script or a phony make target
  2. Change https://github.com/ocaml/opam/tree/b3d2f5c554e6ef3cc736a9f97e252486403e050f/opam-devel.opam so that it includes all the libraries as pin-depends and advise people to pin this package from the source rather than from the opam repo. (I think this would work around the non-transitive nature of pins?)

Hopefully there is a nicer option (I'm happy to help with that), but in the meantime this issue may offer a recipe to help others along who hit the same snag.

rjbou commented 2 months ago

Thanks for the issue and for testing!

Indeed, the pinning command is incomplete. It is better to use pinning with an url instead

opam pin git+https://github.com/ocaml/opam

like that it will pin all packages in the same time.

shonfeder commented 2 months ago

Ah of course. Don't know why I didn't remember this :) thanks!