Skip to content

Windows builds cannot hardlink from uv's cache, falling back to full copies - #1243

Open
vadikmironov wants to merge 1 commit into
astral-sh:mainfrom
vadikmironov:uv-cache-on-workspace-volume
Open

Windows builds cannot hardlink from uv's cache, falling back to full copies#1243
vadikmironov wants to merge 1 commit into
astral-sh:mainfrom
vadikmironov:uv-cache-on-workspace-volume

Conversation

@vadikmironov

Copy link
Copy Markdown
Contributor

On GitHub's Windows runners with standard checkout actions, the checkout lands on D: while uv's default cache is on drive C:. During the build, this layout results in the following message from uv:

warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
         If the cache and target directories are on different filesystems, hardlinking may not be supported.
         If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.

Again, it's a minor Windows build noise issue and maybe a performance hit (cannot quantify, when hitting in my workflow I fixed it at the same time when introduced caching). Reproducible on every Windows run.

Pointing the cache at the workspace puts both on one volume and restores hardlinking:

env:
  FORCE_COLOR: 1
+ # Keep uv's cache on the same volume as the workspace so uv can hardlink
+ UV_CACHE_DIR: ${{ github.workspace }}/.uv-cache

I guess the existing behaviour might have come from the times when there was a single drive for the runner, but just not to depend on a particular layout I set the cache location relative to the workspace.

On GitHub's Windows runners the checkout lands on D: while uv's default
cache is on C:. Because of that uv cannot hardlink into the build tree
and warns that it falls back to full copies. Re-pointing the cache under
the workspace fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant