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

installing git repository ignores UV_LINK_MODE, breaks on some filesystems #11420

Closed
PhilipVinc opened this issue Feb 11, 2025 · 3 comments · Fixed by #11421
Closed

installing git repository ignores UV_LINK_MODE, breaks on some filesystems #11420

PhilipVinc opened this issue Feb 11, 2025 · 3 comments · Fixed by #11421
Assignees
Labels
bug Something isn't working help wanted Contribution especially encouraged

Comments

@PhilipVinc
Copy link
Contributor

Summary

I am on a cluster with a distributed filesystem (beefgs) which does not support hard links.
I am trying to install a repository directly, but it fails when symlinking the repository between two locations in the uv cache directory.

I would assume that setting UV_LINK_MODE=symlink or UV_LINK_MODE=copy would fix the error, but it seems that the setting is not applied to the git command in this case

(base) [filippo.vicentini@cholesky-login02 prova2]$ uv init --no-package
Initialized project `prova2`
(base) [filippo.vicentini@cholesky-login02 prova2]$ uv add git+https://github.com/netket/netket
error: Git operation failed
  Caused by: process didn't exit successfully: `/usr/bin/git clone --local /mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/db/292f78b3ecf26bf6 /mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/checkouts/292f78b3ecf26bf6/f1db6bb` (exit status: 128)
--- stdout
Cloning into '/mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/checkouts/292f78b3ecf26bf6/f1db6bb'...

--- stderr
fatal: failed to create link '/mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/checkouts/292f78b3ecf26bf6/f1db6bb/.git/objects/pack/pack-384b576a7a115ef20196172649a6bf2ab2b2ab8e.idx': Operation not permitted
fatal: The remote end hung up unexpectedly
(base) [filippo.vicentini@cholesky-login02 prova2]$ ^C
(base) [filippo.vicentini@cholesky-login02 prova2]$ export UV_LINK_MODE=copy
(base) [filippo.vicentini@cholesky-login02 prova2]$ uv add git+https://github.com/netket/netket
error: Git operation failed
  Caused by: process didn't exit successfully: `/usr/bin/git clone --local /mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/db/292f78b3ecf26bf6 /mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/checkouts/292f78b3ecf26bf6/f1db6bb` (exit status: 128)
--- stdout
Cloning into '/mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/checkouts/292f78b3ecf26bf6/f1db6bb'...

--- stderr
fatal: failed to create link '/mnt/beegfs/home/CPHT/filippo.vicentini/.cache/uv/git-v0/checkouts/292f78b3ecf26bf6/f1db6bb/.git/objects/pack/pack-384b576a7a115ef20196172649a6bf2ab2b2ab8e.idx': Operation not permitted
fatal: The remote end hung up unexpectedly

Platform

Linux 3.10.0-1062.el7.x86_64 x86_64 GNU/Linux

Version

uv 0.5.30

Python version

Python 3.12.7

@PhilipVinc PhilipVinc added the bug Something isn't working label Feb 11, 2025
@charliermarsh
Copy link
Member

Hmm, we'll need to decide whether we want to support this. This is a link within the cache, which is not what UV_LINK_MODE is intended to affect.

@charliermarsh charliermarsh added the needs-decision Undecided if this should be done label Feb 11, 2025
@PhilipVinc
Copy link
Contributor Author

PhilipVinc commented Feb 11, 2025

I just will point out that this kind of filesystem/restriction is relatively common in academic clusters.
If you do not support this, it becomes impossible to install a git repository, which are very common to keep private research code, and we don't necessarily tag/build wheels (it's very hard to setup a private wheel depot).

I hope you'd consider supporting this in some way, as otherwise we'd be forced to use other tools in academic environments.
I find that uv helps students/researchers have a much more reproducible environment, and save them time, so I would hope I can keep pushing for it (but due to #7642 / #1495 it is hard...).

So please, do support this kind of setups!

@charliermarsh
Copy link
Member

I think it makes sense to re-try the operation with --no-hardlinks if it fails.

@charliermarsh charliermarsh added help wanted Contribution especially encouraged bug Something isn't working and removed bug Something isn't working needs-decision Undecided if this should be done labels Feb 11, 2025
loic-lescoat pushed a commit to loic-lescoat/uv that referenced this issue Mar 2, 2025
Fixes astral-sh#11420

---------

Co-authored-by: Charlie Marsh <[email protected]>
Co-authored-by: Filippo Vicentini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contribution especially encouraged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants