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

"opam pin folder/project.opam" fails where "opam install folder/project.opam" succeeds #4380

Open
RalfJung opened this issue Oct 6, 2020 · 2 comments
Labels

Comments

@RalfJung
Copy link

RalfJung commented Oct 6, 2020

I noticed what seems like a strange inconsistency between opam pin and opam install:
With opam install, I can pass as argument the name of an opam file called PROJECT.opam, and it will pin and install that file. But I cannot just pin that file via opam pin folder/PROJECT.opam, that leads to strange errors:

[coq-stdpp-builddep] downloaded from file:///home/r/Dokumente/Unisachen/iris/stdpp/builddep/coq-stdpp-builddep.opam
[ERROR] Could not retrieve Unknown archive type: /tmp/opam-1533009-dd682e/coq-stdpp-builddep.opam

What I can do is opam pin folder/, and that will pin all the opam files in that folder -- which happens to suffice for my current use-case, but what if I want to pin just some of them? There does not seem to be a way.

# opam config report
# opam-version      2.0.7 
# self-upgrade      no
# system            arch=x86_64 os=linux os-distribution=debian os-version=testing
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              8
# repositories      4 (http), 3 (local), 2 (version-controlled) (default repo at 6bbebb34)
# pinned            5 (rsync)
# current-switch    /home/r/Dokumente/Unisachen/iris/coq
@rjbou
Copy link
Collaborator

rjbou commented Oct 7, 2020

opam install include some behaviour of opam pin, and opam pin calls opam install, to make opam use easier, but they are not completely interchangeable.
If you want to pin one of them, you can use opam pin PROJECT folder/, opam will find the corresponding PROJECT opam file in folder/. To pin more than one, it is not possible in 2.0, but in 2.1 the normalised form introduced by opam pin scan #4285 permits it.
@AltGr is there a reason for opam pin to not take an opam filename as argument (except not implemented :)) ?

@AltGr
Copy link
Member

AltGr commented Oct 7, 2020

Yeah, the discrepency between the two, with huge overlapping parts, is quite annoying... but it's not obvious how to rehaul this part of thce CLI.
I don't think there is a reason for not allowing opam pin <opamfile>.
Among the other discrepancies that I find annoying is the fact that you can do opam pin REMOTE_URL but not opam install

@dra27 dra27 added the AREA: UI label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants