Open Armael opened 6 years ago
Not sure if this is related, but if I try opam upgrade
instead, I get the following:
https://gist.github.com/Armael/7ac4ce561c9b698ab1b4ad5725a33038
The issue apparently blocked the repository update ; this explains the upgrade
results, because it made opam assume an empty repository.
Now the first issue is quite weird, because an exit of 129 normally means the process received the HUP signal... Could this be related to #3206 ?
My bad, apparently git
breaks the convention on exit codes, and 129
may also mean bad arguments. What's your git version (git --version
) ?
Thanks
Thanks for investigating. I'm using git version 2.16.1.
Surprising, that should really support the options... What does /usr/bin/git diff --quiet
return if called manually ? You could also try to run with -vv
to see the actual output of git
.
Ah, git diff
actually also returns 129
if called outside of a git
repository. Maybe your repo in ~/.opam/repo/<repo-name>
got corrupted, or wasn't using git
but is now detected as such ? In that case there are a few things you could do:
opam repo list -a
to check configured repos. Maybe see the opam repo set-url
command to reset the repo URL~/.opam/repo/<repo-name>
and retry opam update
Thanks!
Ah, git diff actually also returns 129 if called outside of a git repository.
That's indeed what seems to be happening (using -vv
). Here's the full output of opam update -vv
:
~ $ opam update -vv
+ /usr/bin/git "diff" "--quiet" (CWD=/home/armael/.opam/4.04.2/.opam-switch/sources/coq-equations)
+ /usr/bin/git "diff" "--quiet" (CWD=/home/armael/.opam/4.04.2/.opam-switch/sources/coq-procrastination)
- Not a git repository
- To compare two paths outside a working tree:
- usage: git diff [--no-index] <path> <path>
'opam update -vv' failed.
[ERROR] Command "/usr/bin/git diff --quiet" failed:
"/usr/bin/git diff --quiet" exited with code 129
coq-equations and coq-procrastination are two git-pinned packages. /home/armael/.opam/4.04.2/.opam-switch/sources/coq-equations
is a valid git repository, but /home/armael/.opam/4.04.2/.opam-switch/sources/coq-procrastination
apparently is not one.
Re-creating the pin would probably solve this precise issue; but maybe there's something to be done in opam to ensure this issue doesn't happen again?
Re-creating the pin would probably solve this precise issue; but maybe there's something to be done in opam to ensure this issue doesn't happen again?
Sure. It's a bit difficult now to trace back what happened to your directory, but we can at least catch this error and print a more informative message. Could you check what is in .opam-switch/sources/coq-procrastination/.git
, if anything ? Also, knowing the precise URL it was pinned to could help me try and reproduce the failure.
One last possibility would be that the migration from 1.2 was interrupted or somehow failed to move some files...
Thanks for your help figuring this out!
Could you check what is in .opam-switch/sources/coq-procrastination/.git, if anything ?
There's no .git. Now that I think of it, could this situation be the result of me pinning this package as a directory by mistake, then git-pinning it instead? I think this happened at some point in the past (with opam 1.2). Maybe something went wrong and some cleanup didn't happen.
Also, knowing the precise URL it was pinned to could help me try and reproduce the failure.
From opam pin list
:
coq-procrastination.~unknown git git+file:///home/armael/these/coq-procrastination
where this local directory is a clone of https://gitlab.inria.fr/agueneau/coq-procrastination
I just switched to opam 2 from opam 1.2.2. I ran the update step for upgrading the layout of .opam successfully. But now, calling
opam update
fails with the following error: