opam icon indicating copy to clipboard operation
opam copied to clipboard

doesn't work: custom repo when creating switch

Open mimoo opened this issue 4 years ago • 4 comments

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)

mimoo avatar May 19 '21 20:05 mimoo

That's embarrassing, the manual is wrong! It should be beta=git+https://.

@AltGr - is repo type inference supposed to work here?

dra27 avatar May 20 '21 15:05 dra27

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.

dra27 avatar May 21 '21 08:05 dra27

opam pin add lib https://github.com/mimoo/lib also takes a URL without the git+

mimoo avatar May 21 '21 16:05 mimoo

This can be changed in the default CLI for 2.2+

dra27 avatar Jul 02 '21 10:07 dra27