Skip to content

Remove redundant virtual from lockfile - #20614

Draft
konstin wants to merge 1 commit into
mainfrom
konsti/remove-virtual-from-lockfile
Draft

Remove redundant virtual from lockfile#20614
konstin wants to merge 1 commit into
mainfrom
konsti/remove-virtual-from-lockfile

Conversation

@konstin

@konstin konstin commented Jul 22, 2026

Copy link
Copy Markdown
Member

Remove virtual from uv.lock to reduce the lockfile size for large workspaces. In a large workspace, package.metadata begins dominating the lockfile size. Specifically, virtual just repeats the workspace member path that we already know from the workspace member list, so we can omit it and save a good chunk of size.

Notably, this is not backwards compatible: Older uv versions expect the virtual field, so activating the preview feature only work when using uv with that preview feature. (We could add it as a setting, but then older uv versions don't see that setting either.)

@konstin
konstin marked this pull request as draft July 22, 2026 09:52
@astral-sh-bot

astral-sh-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 2
  • Removed tests: 0
  • Changed suites: 1
uv::lock: +2 / -0

Added:

  • uv::lock::lock::lock_compact_virtual_workspace_member
  • uv::lock::lock::lock_compact_without_virtual_workspace_member

Removed: none

Remove `virtual` from `uv.lock` to reduce the lockfile size for large workspaces. In a large workspace, `package.metadata` begins dominating the lockfile size. Specifically, `virtual` just repeats the workspace member path that we already know from the workspace member list, so we can omit it and save a good chunk of size.

Notably, this is not backwards compatible: Older uv versions expect the `virtual` field, so activating the preview feature only work when using uv with that preview feature. (We could add it as a setting, but then older uv versions don't see that setting either.)
@konstin
konstin force-pushed the konsti/remove-virtual-from-lockfile branch from efd3367 to 8f2b28e Compare July 22, 2026 10:51
@zsol
zsol self-requested a review July 22, 2026 10:57
@zanieb

zanieb commented Jul 22, 2026

Copy link
Copy Markdown
Member

Regarding

Older uv versions expect the virtual field, so activating the preview feature only work when using uv with that preview feature.

We should start with forward-compatibility by adding stable support for handling this field being missing.

@zanieb

zanieb commented Jul 22, 2026

Copy link
Copy Markdown
Member

e.g., in the style of #19024

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.

2 participants