Skip to content

fix: suppress uv hardlink warning with UV_LINK_MODE=copy#453

Open
zkoppert wants to merge 1 commit intomainfrom
fix/uv-link-mode-warning
Open

fix: suppress uv hardlink warning with UV_LINK_MODE=copy#453
zkoppert wants to merge 1 commit intomainfrom
fix/uv-link-mode-warning

Conversation

@zkoppert
Copy link
Copy Markdown
Collaborator

@zkoppert zkoppert commented Apr 9, 2026

Proposed Changes

When running as a GitHub Action, the uv cache and target .venv directory end up on different filesystems (container overlay vs host mount), causing uv to emit a noisy warning on every run:

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.

Adding ENV UV_LINK_MODE=copy to the Dockerfile tells uv to use copy mode directly, suppressing the warning.

This is the same fix applied in github-community-projects/pr-conflict-detector#65.

Before After
Hardlink warning Printed on every run Suppressed

Testing

  • docker build - image builds successfully with the new env var

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing

When running as a GitHub Action, the uv cache and target .venv directory
end up on different filesystems (container overlay vs host mount), causing
uv to emit a noisy warning on every run. Setting UV_LINK_MODE=copy tells
uv to use copy mode directly, suppressing the warning.

Signed-off-by: Zack Koppert <zkoppert@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zkoppert zkoppert self-assigned this Apr 9, 2026
@github-actions github-actions bot added the fix label Apr 9, 2026
@zkoppert zkoppert marked this pull request as ready for review April 9, 2026 18:29
@zkoppert zkoppert requested a review from jmeridth as a code owner April 9, 2026 18:29
Copilot AI review requested due to automatic review settings April 9, 2026 18:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR suppresses uv’s recurring hardlink fallback warning in the GitHub Action container by configuring uv to use copy mode.

Changes:

  • Set UV_LINK_MODE=copy in the Dockerfile to avoid hardlink attempts (and the associated warning) when cache and target directories are on different filesystems.
Show a summary per file
File Description
Dockerfile Adds ENV UV_LINK_MODE=copy so uv run uses copy mode and stops emitting the hardlink fallback warning.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment on lines 30 to +31
ENV PYTHONUNBUFFERED=1
ENV UV_LINK_MODE=copy
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new environment variable (UV_LINK_MODE) in the action image. Per the repo guideline to document environment variable changes in README.md, please add a short note explaining why this is set (suppress hardlink warning when cache/venv are on different filesystems) and its impact (forces copy mode).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants