Conversation
|
5e766ba to
062037c
Compare
46a5543 to
3dd4923
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| os_name = rctx.os.name | ||
| if os_name == "mac os x": | ||
| os_suffix = "apple-darwin" | ||
| elif os_name == "linux": | ||
| os_suffix = "unknown-linux-gnu" | ||
| elif os_name.startswith("windows"): |
There was a problem hiding this comment.
_detect_host_platform() always returns *-unknown-linux-gnu for Linux hosts. On musl-based distros (e.g. Alpine) this will point @uv//:uv at the gnu build, which may not run. The repo already has host libc detection logic in py/private/interpreter/resolve.bzl; consider using a similar approach here so the host alias chooses unknown-linux-musl when appropriate.
7e118d0 to
dd5e7dc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd5e7dcec6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif os_name == "linux": | ||
| os_suffix = "unknown-linux-gnu" |
There was a problem hiding this comment.
Detect Linux libc before selecting uv binary
_detect_host_platform currently maps every Linux host to *-unknown-linux-gnu, so on musl-based systems (for example Alpine) the generated @uv//:uv alias points to a glibc build. uv’s Linux policy distinguishes glibc and musl artifacts, and the glibc binary can fail to execute on musl hosts even though musl archives are available in UV_VERSIONS; host platform detection needs to account for libc (or provide an explicit override) to avoid broken toolchain use on musl environments.
Useful? React with 👍 / 👎.
a890964 to
11aabbc
Compare
a01ab18 to
eab2c58
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eab2c58c4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| else: | ||
| os_constraint = "@platforms//os:linux" | ||
|
|
||
| return "[\"{}\", \"{}\"]".format(os_constraint, cpu) |
There was a problem hiding this comment.
Add libc constraints to Linux UV toolchains
_platform_constraints maps every Linux triple to only @platforms//os:linux plus CPU, so x86_64-unknown-linux-gnu and x86_64-unknown-linux-musl (and the aarch64 pair) register with identical exec_compatible_with. With register_toolchains("@uv//:all"), Bazel cannot reliably distinguish libc variants and may resolve the glibc archive on musl exec platforms (e.g. Alpine), which can make tool invocations fail at runtime.
Useful? React with 👍 / 👎.
| uv_hub_repository( | ||
| name = hub_name, | ||
| version = cfg.version, | ||
| platforms = hashes.keys(), | ||
| repo_prefix = repo_prefix, |
There was a problem hiding this comment.
Prevent toolchain repo name collisions with uv hubs
This creates a repository named after uv.toolchain(name = ...) in the same namespace used by uv.declare_hub(hub_name = ...), but there is no cross-check for collisions. If a module declares a dependency hub named "uv" (or any matching toolchain name) and also uses uv.toolchain() defaults, extension evaluation attempts to create two repos with the same name and fails with a duplicate-repository error.
Useful? React with 👍 / 👎.



Add a UV module extension/toolchain for fetching UV via bazel.
Changes are visible to end-users: yes
The
uvmodule extension's newtoolchain()tag downloads a hermetic uv and publishes@uv(host alias) plus@uv//:all(per-platform toolchains).Test plan
bazel run @uv -- --help