Skip to content

feat: Add UV_LINK_MODE=copy - #1452

Open
carlcsaposs-canonical wants to merge 5 commits into
canonical:mainfrom
carlcsaposs-canonical:uv-cache
Open

feat: Add UV_LINK_MODE=copy#1452
carlcsaposs-canonical wants to merge 5 commits into
canonical:mainfrom
carlcsaposs-canonical:uv-cache

Conversation

@carlcsaposs-canonical

Copy link
Copy Markdown
Contributor

Companion to canonical/craft-providers#900

When the cache dir is mounted from the LXD host, hardlinking from the global cache (uv's default behavior) is not possible

e.g.

:: 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.

@bepri bepri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Could you make a changelog entry for this and update the reference docs for the plugin with a sentence or two explaining why it's set by us?

@bepri
bepri requested a review from a team February 17, 2026 20:22
@carlcsaposs-canonical
carlcsaposs-canonical requested a review from a team as a code owner February 18, 2026 14:44
Comment thread docs/reference/changelog.rst Outdated
@carlcsaposs-canonical

carlcsaposs-canonical commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! Could you make a changelog entry for this and update the reference docs for the plugin with a sentence or two explaining why it's set by us?

Added in 4f5e86c—feel free to commit directly to this branch if you'd like to make any changes

Companion to canonical/craft-providers#900

When the cache dir is mounted from the LXD host, hardlinking from the global cache (uv's default behavior) is not possible

e.g.
```
:: 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.
```
@carlcsaposs-canonical

Copy link
Copy Markdown
Contributor Author

(rebased on main)

@bepri bepri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks - just minor nitpicks on the docs entries now.

Comment thread docs/common/craft-parts/reference/plugins/uv_plugin.rst Outdated
Comment thread docs/reference/changelog.rst Outdated
@bepri
bepri requested a review from a team February 18, 2026 15:44
Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
Signed-off-by: Carl Csaposs <carl.csaposs@canonical.com>
Comment thread docs/common/craft-parts/reference/plugins/uv_plugin.rst Outdated
Signed-off-by: Michael DuBelko <michael.dubelko@gmail.com>
Comment thread docs/reference/changelog.rst Outdated
Signed-off-by: Imani Pelton <imani.pelton@canonical.com>
@bepri
bepri requested a review from a team February 18, 2026 18:14

@mr-cal mr-cal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM but would like to get @lengau's review, since this is a charmcraft-motivated feature.


**Type:** ``clone``, ``copy``, ``hardlink``, or ``symlink``

**Default:** "copy"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Setting this to copy by default will slow down the default case where the cache isn't mounted from the outer machine. While I think it's a good idea to document this here and provide a motivation for using copy, I don't think we should change the default value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Once canonical/craft-providers#900 is merged, would that not become the default (similar to how pip's cache is mounted from the host by default)?

@lengau lengau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's leave the default value unset still.

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.

5 participants