fix(uv): Preserve uv wrapper runfiles in lock targets - #4182
Open
hartikainen wants to merge 2 commits into
Open
hartikainen wants to merge 2 commits into
hartikainen wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The regression fixture does not cover multiple outputs or symlink runfiles, and the news entry needs the issue cross-reference.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
This PR updates uv_toolchain to support multi-output wrappers while preserving their runfiles in lock actions and .run targets.
Changes:
- Supports multi-output executable wrappers.
- Preserves runtime data and symlinks.
- Adds regression fixtures and documentation.
| File | Summary |
|---|---|
tests/uv/lock/uv_with_runfiles.py |
Wrapper executable test helper |
tests/uv/lock/toolchain_runfiles_test.py |
Integration tests for lock targets |
tests/uv/lock/testdata/toolchain_payload.txt |
Runtime payload fixture |
tests/uv/lock/lock_tests.bzl |
Toolchain and regression test setup |
python/uv/private/uv_toolchain.bzl |
Supports multi-output executables |
python/uv/private/uv_repository.bzl |
Makes downloaded binaries public |
python/uv/private/lock.bzl |
Preserves executable runfiles |
news/uv-toolchain-runfiles.fixed.md |
Documents the behavior change |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Allow executable wrappers with multiple output files and include their runfiles in lock actions and runnable targets. This lets a `py_binary` wrapper supply authentication without losing its runtime dependencies. Export downloaded `uv` binaries so wrappers can depend on them directly. Cover build-action and runtime resolution with a custom toolchain that reads a declared data file.
hartikainen
force-pushed
the
uv-lock-toolchain-runfiles
branch
from
September 23, 2026 18:41
02eb1f0 to
d34813a
Compare
hartikainen
force-pushed
the
uv-lock-toolchain-runfiles
branch
from
September 25, 2026 01:57
15b1d4b to
4191059
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


(Done with help from an agent.)
This PR lets
uv_toolchainaccept executable wrappers with multiple outputs and preserves their runfiles in lock actions and.runtargets. This supports wrappers that obtain credentials before invokinguv.Lock actions receive the executable target's
FilesToRunProvider. Runnable targets merge its default runfiles, preserving runtime data, ordinary symlinks, and root symlinks. The downloadeduvbinary has public visibility so wrappers can declare it as a runtime dependency.The regression test covers a wrapper with multiple outputs, runtime data, and both kinds of runfiles symlinks.
Closes #4181.