opam
opam copied to clipboard
doesn't work: custom repo when creating switch
In the manual:
Prepare a local switch for building the packages defined in ./. This scans the current directory for package definitions, chooses a compatible compiler, creates a local switch and installs the local package dependencies.
opam switch create trunk --repos default,beta=https://github.com/ocaml/ocaml-beta-repository.git ocaml-variants.4.10.0+trunk
This command fails with:
Creating repository beta...
[ERROR] Could not update repository "beta": OpamDownload.Download_fail(_, "curl: code 404 while
downloading https://github.com/ocaml/ocaml-beta-repository.git/index.tar.gz")
[ERROR] Initial fetch of these repositories failed: beta
I also tried with my own custom repo and it fails with the same error.
(opam version 2.0.8)
That's embarrassing, the manual is wrong! It should be beta=git+https://.
@AltGr - is repo type inference supposed to work here?
Re-opening - the docs are fixed; but it's inconsistent that opam repo add beta https://github.com/ocaml/ocaml-beta-repository.git works but opam switch create foo beta=https://github.com/ocaml/ocaml-beta-repository.git --empty doesn't.
opam pin add lib https://github.com/mimoo/lib also takes a URL without the git+
This can be changed in the default CLI for 2.2+