-
Notifications
You must be signed in to change notification settings - Fork 365
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
Problems with .opam/download-cache and packages which depend on git information #4751
Comments
would you be able to post the error messages for the error? |
|
Thanks, @Alizter - please could you give the precise instructions you are running to do this. For example, there are additional repositories and possibly pins which you haven't mentioned. |
@dra27 I haven't pinned anything in either switch. You need the coq dev packages for opam:
After which, I create a switch and install coq.8.13.dev for example:
AFAICT opam is cloning the git repo for coq in the background and putting it in download-cache, with the 8.13.dev branch checked out. Now making another switch and installing the latest dev version of coq
will fail at some point during the build. This is because the dune setup in coq uses the commit hash and something isn't being found. The error I posted above gets displayed. The workaround is to delete
works according to plan. I'm not sure how I can be more precise here? |
Thanks - those commands are more detailed than the original report. In terms of being more precise, they could be commands which actually work! 😉 This Dockerfile is working for me (technically it's using the tip of the 2.1 opam branch, so it reports 2.1.0 rather than 2.1.0~rc2, but there're no relevant changes, as we're not using depexts here): FROM ocaml/opam
RUN sudo apt-get install -yy libgmp-dev && \
cd ~/opam-repository && \
git pull origin master && \
sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && \
opam update
RUN opam --version
RUN opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev --all-switches --set-default
RUN opam switch create myswitch ocaml-option-flambda
RUN opam install coq.8.13.dev
RUN opam switch create myotherswitch ocaml-option-flambda
RUN opam install coq.dev That builds.
There shouldn't be a checkout in the download-cache - are you sure that's what you've got? There should be a bare git repository in
and those are used to populate the |
OK here is another way to get my issue:
Perhaps I am misdiagnosing download-cache as being the issue here. The way to fix the above is to delete download-cache however. |
That's working for me in Docker, as well (modulo adding |
Would you be able to try doing it with a fresh opam root - so doing |
So I tried doing a fresh opam root, and my instructions don't seem to work. More rather, everything works as intended. The reason I didn't think this was to do with my particular opam root is because I did a fresh root very recently. I had a .opam from before 2.1 which I update to be compatible, and I got the error above. Thinking I corrupted my root somehow, I created a fresh one but ran into the same issue, hence submitted the bug report. I initially brought this up with the coq developers, but they said that it was probably an opam issue, and suggested that I file a report here. Now going back to my original problem, everything works as intended. So it probably was a Coq bug like I suspected in the beginning. I haven't tracked down where it happened, but I am more confident that it has nothing to do with opam. I am therefore closing this issue. Thanks for all your help! And also for showing me how to do temp .opam dirs. |
No problem, @Alizter! The ocaml/opam docker images are very useful for putting reproduction cases together, as is the temporary opam root trick. If this does spring back up, do of course re-open/create a fresh issue. |
I had a lot of trouble running docker locally, but not enough time to investigate it. Specifically the sudo commands were causing problems. |
I just ran into this:
It's a bit tricky to test, but I suspect that upgrading a dev version of a package (in this case coq) doesn't change which branch is checked out, but something is getting left behind. @dra27 Any idea how I might test this? |
We discussed this again in last Friday's dev meeting and finally figured it out. Thanks for persisting, @Alizter! It turns out that it's a bug in the sandbox which is why we're all struggling to reproduce it in Docker (where the sandbox is disabled, as Docker's already a sandbox...). The issue is that you have your The fix you were seeing by deleting the Do you have There is a workaround at the moment, which it'd be handy if you could try just to confirm that we've definitely nailed the bug: running with |
I believe I just syslinked the default I'll try what you suggested next week when I have aceess to my machine again. |
Fix proposed in #4795. Could you double check if it fixes your issue? |
Closing as "probably fixed"; feel free to reopen if not, and thanks again for the report and help tracking the issue. |
Yep that's fine. I don't have access to the original machine where .opam was being installed to an external drive anymore so I wasn't able to test the fix. |
I have a problem with the download-cache folder of opam. To replicate the behaviour try the following:
opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev
I know that this is not a problem with the coq packaging, because if you delete the download-cache folder between steps 2 and 3 it will work. For some reason, opam is not doing something right with the git stuff here.
The text was updated successfully, but these errors were encountered: