fix(uv): reject malformed python/abi wheel tags via allowlist - #1533
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✨ Aspect Workflows Tasks📅 Tue Sep 8 15:38:27 UTC 2026 🔄 1 in progress task
✅ 5 successful tasks
⏱ Last updated Tue Sep 8 16:16:44 UTC 2026 · 📊 GitHub API quota 116/15,000 (1% used, resets in 33m, throttle 3×) |
a1d7f29 to
f7f8bbf
Compare
Completes the tag-validation symmetry started by #844: platform tags have had a strict allowlist since then, but python tags were only prefix-checked (
cp311_2passed) and abi tags were not filtered at all. A single wheel with a malformed tag in the lockfile — e.g. renamed in a private registry — breaks analysis far beyond that wheel.Problem
Two distinct failure modes, both reproduced by the new e2e case:
cp311_2-...): crashes the whl_install repository fetch before any select is generated —Error in int: invalid base-10 literal: "11_2"inselect_key(whl_install/repository.bzl).cp311-cp311_2-...): the generated config group name collides with a private intermediate alias that bazel_skylib'sselects.bzlcreates for the legitimatecp311group chain (name + "_" + i), leaving the entirepip_configurationsBUILD in error — every package of every hub breaks.Changes
Single source of data for both filtering and generation, mirroring #844:
constraints/defs.bzl:FOREIGN_INTERPRETER_PREFIXES+foreign_interpreter_tag()— foreign interpreters (pp/pypy/graalpy/ip/jy) skip silently; anything else unsupported warns.constraints/python/defs.bzl:PYTHON_TAGSderived from INTERPRETERS×MAJORS×MINORS (exactly whatpython/macro.bzlgenerates);supported_python()is now membership, not a prefix check;filter_python_tags()warns per rejected tag.constraints/abi/defs.bzl(new):ABI_FEATURES/ABI_FEATURE_SUFFIXES/ABI_TAGS(+none,abi3),supported_abi(),filter_abi_tags().constraints/abi/macro.bzl: refactored to generate from that same data — verified by query that the 1438 generated targets are unchanged.extension/lockfile.bzl(hub configurations) andwhl_install/repository.bzl(select arms), so hub and arms stay consistent.A rejected wheel is skipped with an actionable warning, never a hard failure:
If the malformed wheel was the only candidate, the existing "no compatible wheel" diagnostics take over.
Test plan
cases/uv-malformed-abi-tag: crafted uv.lock carrying a realpy3-none-anywheel plus two synthetic malformed entries (never fetched). Red without the fix reproduces both failure modes above; green with the fix resolves via the valid wheel and assertscp311_2never leaks into the graph.constraints/python/test.bzlandconstraints/abi/test.bzl:cp311_2/cp999/cp321/py4/cp3/cp311tdrejected;none/abi3/cp313t/cp312dmtuaccepted; foreign interpreters silent.bazel test //uv/...95/95; e2e regressions: uv-platform-filter-844, uv-abi3-compat-853, freethreaded-805, uv-dep-hashes (×2), uv-no-sdist-754, windows-crossbuild-837, uv-deps-650 (×4) all pass; buildifier clean.