Repository navigation
Fix uv scans wiring wheels under no-binary (#1603) - #1649
Mikola Lysenko (mikolalysenko) wants to merge 4 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
uv installs a package listed in no-binary / no-binary-package only from an sdist, and every Socket patch is a wheel, so a hosted or vendored scan that wired one left a project where every uv sync failed. Both modes now refuse before writing anything: vendored with pypi_uv_no_binary, hosted with the uv project/script unsupported warnings. Settings are read with uv's precedence, shared with the existing no-sources check. Refs #1603 Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
The no-binary = true refusal said "remove the package from the setting", which a bool can't do and which never named the package. The message now names the package and how to let uv install it from a wheel. Also cover vendored mode in the no-build-package control, note in the docs that install-machine uv settings are invisible to the scan, and update the hosted engine comment on why uv.toml is read. Refs #1603 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3b0c27e. Configure here.
|
Labeled Ready for review at
Generated by Claude Code |
Final review brief (final reviewer agent)What it does. uv's Risk: low. It only adds refusals in cases that were already broken after wiring; the Look here
Verified
Changes I made: none. Open questions: none blocking. Machine-level Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Refs #1603
Summary
uv's
no-binary = true/no-binary-package = [...]make uv install apackage only from an sdist. Every socket-patch PyPI artifact is a wheel, so
when a scan wired a patch for such a package (hosted: the patch-server
.whlURL; vendored:.socket/vendor/pypi/<uuid>/*.whl), it exited 0 andevery later
uv sync/uv sync --locked/uv run --lockedfailed with"marked as
--no-binarybut is itself a binary distribution".Both modes now refuse before writing anything:
pypi_uv_no_binary(uv projects and PEP 723 scripts)redirect_uv_project_unsupported/redirect_uv_script_unsupported, the same warningsno-sourcesuses,so the package is skipped and the scan still exits 0 for the rest.
Root cause
The wire-time guards (
vendor/pypi_uv.rscheck_target_guards,vendor/pypi_lock.rsscript lane, and the uv metadata step inpatch/redirect/mod.rs) checkedno-sourcesand ancestor shadowing,never
no-binary. Only hosted restore looked atno-binary*.Fix
utils/python_script.rs: theno-sourcessettings reader is now ageneric
refuse_package_settingover a (bool key, package-list key) pair,so
no-binarygets exactly uv's precedence for free: a projectuv.tomlreplaces
[tool.uv]; a script's own bool wins over the project's; listsadd up;
no-binary = falsedisables the list; a script whose root setsnothing takes the nearest parent
uv.toml/[tool.uv]. Newrefuse_uv_no_binary/refuse_uv_script_no_binaryare called at allthree wire sites. The
no-sourcesmessage text is unchanged.no-build*allows wheels and is not refused. Docs:docs/testing/uv-compatibility.md.No wrapper changes needed (
npm/,pypi/,gem/only dispatch to thebinary).
Why
Refsand notFixesThe issue's follow-up comment adds a hosted
uv pip compile --no-binarypylock.toml lane. That lock records nothing of the filter in its data;
the only signal is the uv header command line and the uv config files
uv pipreads. #1614 adds exactly that parser for the restore side (#1613).Reusing it for the wire side belongs after #1614 lands, so #1603 stays open
for that lane. The project /
uv.toml/ script matrix from the issue bodyis fully covered here.
Tests (red → green)
Each new test fails with the guard disabled (
refuse_uv_*no_binaryshort-circuited to
Ok(())) and passes with the fix:[tool.uv],uv.toml, parentuv.toml, controlspatch::redirect::python_metadata_pairing_tests::no_binary_refuses_a_wheel_uv_would_not_install[tool.uv]+uv.toml, controlsvendor::pypi_uv::tests::guards_refuse_workspace_lock_version_fork_sources_and_dynamicvendor::pypi_lock::tests::script_no_binary_refuses_before_writingno-build-packagecontrol still pinnedmode_migration_pypi::uv_no_binary_is_refused_in_both_modesControls (wired, not refused):
no-binary-packagenaming another package,no-build-package,no-build = true,no-binary = false+ list,a script's
no-binary = falseover the project's list.Local (all at 3b0c27e):
cargo fmt --all -- --check: okcargo clippy --workspace --all-features -- -D warnings: oke2e_redirect_uv_build -- --include-ignored: 23/23 ok (uv 0.11.32)e2e_vendor_pypi_build -- --include-ignored: 55/55 okmode_migration_pypi: 65/65 okcargo test --workspace --all-features --no-fail-fast: 233 targets ok;10 tests failed for sandbox reasons unrelated to this diff (CI will
confirm): 9 write-failure tests that rely on read-only permissions,
which don't bind as root (uid 0) here (e.g.
pypi_poetry::tests:: wire_write_failure_maps_error_and_leaves_lock_untouched,repairunremovable-lock tests,
in_process_redirectwrite-failure tests), ande2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed,which needs
patches-api.socket.dev(blocked by this sandbox's proxy)./code-review high
Fixed: refusal text for
no-binary = true(now names the package and aremedy a bool allows); vendored half of the
no-build-packagecontrol;stale engine comment; install-machine settings caveat in the docs.
Not fixed:
uv.lock+uv.toml, nopyproject.toml)skips the metadata guards. Pre-existing for
no-sourcestoo, and uvitself can't
uv synca project without itspyproject.toml, so noreal install reaches the wired wheel.
its own stable error code (
pypi_uv_no_sources/pypi_uv_no_binary)at every site; the extra TOML parse is a one-off per wired package.
Generated by Claude Code