mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-25 19:49:14 +00:00
![]() - **Do not attempt to reflink directories on linux** - **Refactor clone_recursive** ## Summary On linux, reflink does not work on a directory. Currently, we first attempt to reflink directory, and only if it fails with `AlreadyExists` we attempt to reflink recursively. This has the effect that, on linux, `uv pip install --link-mode=clone` would always fall back to `copy`. We resolve this by only attempting to reflink directories on macos. In the process, we refactored `clone_recursive` in an attempt to make it easier to reason about its logic. ## Test Plan I tested that after this change, `uv pip install --link-mode=clone numpy` would behave as expected in the following cases: * linux, btrfs filesystem, venv on the same filesystem as cache (correctly reflinked) * linux, btrfs filesystem, venv on a different filesystem than cache (fallback to copy) I have not tested it on macos or windows, as I currently don't have access to any macos or windows machines, unfortunately. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |