Skip to content

uv falls back to copy instead of symlink #7509

@ypnos

Description

@ypnos

When using a Docker cache mount, as recommended in the documentation, uv falls back to copying instead of hardlinking and complains about it. The message also recommends to suppress the complaint with explicitely setting the link mode to COPY.

See

warn_user_once!("Failed to clone files; falling back to full copy. This may lead to degraded performance.\n If the cache and target directories are on different filesystems, reflinking may not be supported.\n If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.");

As a matter of fact, uv now supports link mode "symlink".

  1. It would probably be great to try symlink before falling back to copy
  2. The error message makes it sound like we have to live with the performance degradation, and does not mention that symlink mode is also available
  3. The Docker documentation should include ENV UV_LINK_MODE=symlink so that people do not run into this issue. See https://docs.astral.sh/uv/guides/integration/docker/#caching

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions