Closed pawamoy closed 5 months ago
Yes, we recursively hardlink by default on Linux. On macOS, we recursively reflink.
Is your cache on the same filesystem as your environment?
Thanks for the astral-fast answer. Ah, that might be the issue :thinking: (facepalm) No, uv's cache is on a different disk and partition than my projects. Closing! :slightly_smiling_face: Is there a recommendation here? Should I just move the cache? Or can I have two (or more) cache locations (one per partition or something)?
No prob! Thanks for asking, it made me double-check that we're doing it right. I tested on macOS with --link-mode=hardlink
and it does seem like the inodes line up:
❯ ls -i venv1/lib/python3.12/site-packages/flask/app.py venv2/lib/python3.12/site-packages/flask/app.py
268196813 venv1/lib/python3.12/site-packages/flask/app.py 268196813 venv2/lib/python3.12/site-packages/flask/app.py
(They don't line up on macOS by default since we default to reflinks.)
Hmm, I'd probably recommend setting UV_CACHE_DIR
to something in the same disk / partition as your projects.
I'll do just that. Thanks a lot!
Thank you! Always appreciate your questions.
(Just free'd 81GB :flushed:)
The README says:
I always interpreted this as uv using hard links (or other more efficient platform-specific techniques) to avoid wasting space when installing the same dependencies in many different virtualenvs.
But in practice, it looks like the same module,
yaml_env_tag.py
, installed in many venvs, for the same Python version (3.11), has a different inode number in each venv:Same for any file really:
So I wonder: is caching enabled by default, and supported on my platform? I'm on ArchLinux.
Coming from PDM, which supports different methods for this (recursive symlinking, hardlinks, etc.), I was happy to see that uv supported it too. Byt maybe I misunderstood?