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

pin-depends system tries to remove part of the content #5939

Open
kit-ty-kate opened this issue Apr 25, 2024 · 2 comments · May be fixed by #5018
Open

pin-depends system tries to remove part of the content #5939

kit-ty-kate opened this issue Apr 25, 2024 · 2 comments · May be fixed by #5018

Comments

@kit-ty-kate
Copy link
Member

kit-ty-kate commented Apr 25, 2024

Issue encounted by @leostera during the mirageOS retreat

Reproducible minimal test case:

cd /tmp
mkdir srv
mkdir blah
mkdir blah/blah
echo 'opam-version: "2.0"' > blah/blah.opam
tar cvzf srv/blah blah/
cd srv
python3 -m http.server
$ cat test.opam
opam-version: "2.0"
pin-depends: [
  ["blah.dev" "http://localhost:8000/blah"]
]
$ opam pin .
Package test does not exist, create as a NEW package? [y/n] y
The following additional pinnings are required by test.dev:
  - blah.dev at http://localhost:8000/blah
Pin and install them? [y/n] y
Package blah does not exist, create as a NEW package? [y/n] y
[blah.dev] fetching sources failed: Download failed
[ERROR] Error getting source from http://localhost:8000/blah:
          - http://localhost:8000/blah (download failed)

using debug-level=3 you can see what actually fail:

error: Cannot remove ~/.opam/trunk/.opam-switch/sources/blah/blah (opam: "unlink" failed on ~/.opam/trunk/.opam-switch/sources/blah/blah: Is a directory).

It turns-out the pin-depends system seems to be downloading and extracting the pin-depends twice or something and failing because it's trying to remove a file that is currently a directory

Tested with both opam 2.1.5 and 2.2.0~beta2

@kit-ty-kate
Copy link
Member Author

Actually i believe #5018 fixes it. I'll try to rebase it on top of master

@kit-ty-kate
Copy link
Member Author

I can confirm #5018 fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant