Skip to content

Conversation

@konstin
Copy link
Member

@konstin konstin commented Sep 30, 2025

Error when a built wheel is for the wrong platform. This can happen especially when using --python-platform or --python-version with uv pip install.

Fixes #16019

@konstin konstin added the bug Something isn't working label Sep 30, 2025
@konstin konstin temporarily deployed to uv-test-registries September 30, 2025 12:46 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/check-built-wheel-tags branch from 5e38b44 to 2e54e1f Compare October 8, 2025 07:12
@konstin konstin temporarily deployed to uv-test-registries October 8, 2025 07:15 — with GitHub Actions Inactive
@konstin konstin marked this pull request as ready for review October 8, 2025 08:14
@konstin
Copy link
Member Author

konstin commented Oct 8, 2025

There are no changes in the ecosystem tests, so this is ready to be reviewed and merged.

@konstin konstin force-pushed the konsti/check-built-wheel-tags branch from 2e54e1f to b089410 Compare October 16, 2025 20:54
@konstin konstin requested a review from zanieb October 16, 2025 20:56
@konstin konstin temporarily deployed to uv-test-registries October 16, 2025 20:56 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/check-built-wheel-tags branch from b089410 to da3d2c9 Compare October 27, 2025 10:51
@konstin konstin temporarily deployed to uv-test-registries October 27, 2025 10:54 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/check-built-wheel-tags branch from da3d2c9 to c660908 Compare December 2, 2025 15:14
@konstin konstin temporarily deployed to uv-test-registries December 2, 2025 15:17 — with GitHub Actions Inactive
@zanieb
Copy link
Member

zanieb commented Dec 3, 2025

Is it possible that this can cause false positives or regressions?

What if we're just building the wheel for a resolve (i.e., uv pip compile) and don't care if it's not valid?

@konstin
Copy link
Member Author

konstin commented Dec 3, 2025

Is it possible that this can cause false positives or regressions?

What if we're just building the wheel for a resolve (i.e., uv pip compile) and don't care if it's not valid?

It's technically possible but for this too happen, we need to have a case where:

  1. There is no static metadata
  2. The build backend doesn't support prepare_metadata_for_build_wheel
  3. The build backend always targets a specific platform
  4. The user is running uv pip compile on a non-target platform. This excludes cases with uv pip compile -p pointing to a target Python that can be emulated on the host.

Of these, (3) is very unlikely, in my experience build backends only have limited cross-compiling support if any, and I've never seen one that defaults to a different platform than the current one. It would also be strange to me if a build backend wouldn't implement prepare_metadata_for_build_wheel, as the functionality is a subset of the build_wheel hook.

--python-platform is a bit fragile by design (PEP 517 has no concept of a target that can be given to build backends, you can only pass them a real Python interpreter as sys.executable), but I'm not aware of other cases where this would cause a regression.

@konstin konstin temporarily deployed to uv-test-registries December 3, 2025 13:44 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-publish December 3, 2025 13:45 — with GitHub Actions Inactive
@zanieb
Copy link
Member

zanieb commented Dec 3, 2025

I'm wary because I think uv pip compile --python-platform is far more common than uv pip install --python-platform and I think this error can only cause regressions in the former / is only helpful for the latter.

What do you mean by (3)? Yes I would only expect most build backends to target the current platform and have no conception of cross-builds. Why would "always targets a specific platform" be needed for this to cause a regression?

@konstin konstin temporarily deployed to uv-test-registries December 3, 2025 15:28 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-publish December 3, 2025 15:28 — with GitHub Actions Inactive
konstin added a commit that referenced this pull request Dec 3, 2025
This was discovered by #16074

I'm not sure what the exact schema of the cache tag is, but since the project is dead, I don't expect any new non-matching versions to follow.
@konstin
Copy link
Member Author

konstin commented Dec 3, 2025

That's a very good point, I added a test specifically for this. The good news is it's already passing as the metadata-only branch in DistributionDatabase doesn't pass around tags nor does it check them.

The stronger checks uncovered a bug in how we generate tags for Pyston: #16972. Merging this PR may uncover more such problems on non-PyPI platform that usually don't have built wheels.

konstin added a commit that referenced this pull request Dec 4, 2025
This was discovered by #16074, where
the wrong tag now fails the Pyston integration test.

I'm not sure what the exact schema of the cache tag is, but since the
project is dead, I don't expect any new non-matching versions to follow.
Error when a built wheel is for the wrong platform. This can happen especially when using `--python-platform` or `--python-version` with `uv pip install`.

Fixes #16019

Ready for review but I want to make some more testing before merging.
@konstin konstin force-pushed the konsti/check-built-wheel-tags branch from 0bb042e to dfbb3ae Compare December 4, 2025 09:19
@konstin konstin temporarily deployed to uv-test-registries December 4, 2025 09:21 — with GitHub Actions Inactive
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably consider this an "enhancement" rather than a "bug"

@konstin konstin added enhancement New feature or improvement to existing functionality and removed bug Something isn't working labels Dec 5, 2025
@konstin konstin merged commit b73281d into main Dec 5, 2025
102 checks passed
@konstin konstin deleted the konsti/check-built-wheel-tags branch December 5, 2025 15:04
@mjamroz
Copy link

mjamroz commented Dec 9, 2025

guys is there any way to ignore that error? With this upgrade we cannot install kinto-11.2.1-cp3-none-any.whl on alpine anymore

@konstin
Copy link
Member Author

konstin commented Dec 9, 2025

@mjamroz Can you please file a new issue with a reproduction? cp3-none-any is a very odd tag, should it by py3-none-any?

@mjamroz
Copy link

mjamroz commented Dec 10, 2025

@konstin here you go #17061

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Dec 12, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.13` -> `0.9.17` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.17`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0917)

[Compare Source](astral-sh/uv@0.9.16...0.9.17)

Released on 2025-12-09.

##### Enhancements

- Add `torch-tensorrt` and `torchao` to the PyTorch list ([#&#8203;17053](astral-sh/uv#17053))
- Add hint for misplaced `--verbose`  in `uv tool run` ([#&#8203;17020](astral-sh/uv#17020))
- Add support for relative durations in `exclude-newer` (a.k.a., dependency cooldowns) ([#&#8203;16814](astral-sh/uv#16814))
- Add support for relocatable nushell activation script ([#&#8203;17036](astral-sh/uv#17036))

##### Bug fixes

- Respect dropped (but explicit) indexes in dependency groups ([#&#8203;17012](astral-sh/uv#17012))

##### Documentation

- Improve `source-exclude` reference docs ([#&#8203;16832](astral-sh/uv#16832))
- Recommend `UV_NO_DEV` in Docker installs ([#&#8203;17030](astral-sh/uv#17030))
- Update `UV_VERSION` in docs for GitLab CI/CD ([#&#8203;17040](astral-sh/uv#17040))

### [`v0.9.16`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0916)

[Compare Source](astral-sh/uv@0.9.15...0.9.16)

Released on 2025-12-06.

##### Python

- Add CPython 3.14.2
- Add CPython 3.13.11

##### Enhancements

- Add a 5m default timeout to acquiring file locks to fail faster on deadlock ([#&#8203;16342](astral-sh/uv#16342))
- Add a stub `debug` subcommand to `uv pip` announcing its intentional absence ([#&#8203;16966](astral-sh/uv#16966))
- Add bounds in `uv add --script` ([#&#8203;16954](astral-sh/uv#16954))
- Add brew specific message for `uv self update` ([#&#8203;16838](astral-sh/uv#16838))
- Error when built wheel is for the wrong platform ([#&#8203;16074](astral-sh/uv#16074))
- Filter wheels from PEP 751 files based on `--no-binary` et al in `uv pip compile` ([#&#8203;16956](astral-sh/uv#16956))
- Support `--target` and `--prefix` in `uv pip list`, `uv pip freeze`, and `uv pip show` ([#&#8203;16955](astral-sh/uv#16955))
- Tweak language for build backend validation errors ([#&#8203;16720](astral-sh/uv#16720))
- Use explicit credentials cache instead of global static ([#&#8203;16768](astral-sh/uv#16768))
- Enable SIMD in HTML parsing ([#&#8203;17010](astral-sh/uv#17010))

##### Preview features

- Fix missing preview warning in `uv workspace metadata` ([#&#8203;16988](astral-sh/uv#16988))
- Add a `uv auth helper --protocol bazel` command ([#&#8203;16886](astral-sh/uv#16886))

##### Bug fixes

- Fix Pyston wheel compatibility tags ([#&#8203;16972](astral-sh/uv#16972))
- Allow redundant entries in `tool.uv.build-backend.module-name` but emit warnings ([#&#8203;16928](astral-sh/uv#16928))
- Fix infinite loop in non-attribute re-treats during HTML parsing ([#&#8203;17010](astral-sh/uv#17010))

##### Documentation

- Clarify `--project` flag help text to indicate project discovery ([#&#8203;16965](astral-sh/uv#16965))
- Regenerate the crates.io READMEs on release ([#&#8203;16992](astral-sh/uv#16992))
- Update Docker integration guide to prefer `COPY` over `ADD` for simple cases ([#&#8203;16883](astral-sh/uv#16883))
- Update PyTorch documentation to include information about supporting CUDA 13.0.x ([#&#8203;16957](astral-sh/uv#16957))
- Update the versioning policy ([#&#8203;16710](astral-sh/uv#16710))
- Upgrade PyTorch documentation to latest versions ([#&#8203;16970](astral-sh/uv#16970))

### [`v0.9.15`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0915)

[Compare Source](astral-sh/uv@0.9.14...0.9.15)

Released on 2025-12-02.

##### Python

- Add CPython 3.14.1
- Add CPython 3.13.10

##### Enhancements

- Add ROCm 6.4 to `--torch-backend=auto` ([#&#8203;16919](astral-sh/uv#16919))
- Add a Windows manifest to uv binaries ([#&#8203;16894](astral-sh/uv#16894))
- Add LFS toggle to Git sources ([#&#8203;16143](astral-sh/uv#16143))
- Cache source reads during resolution ([#&#8203;16888](astral-sh/uv#16888))
- Allow reading requirements from scripts without an extension ([#&#8203;16923](astral-sh/uv#16923))
- Allow reading requirements from scripts with HTTP(S) paths ([#&#8203;16891](astral-sh/uv#16891))

##### Configuration

- Add `UV_HIDE_BUILD_OUTPUT` to omit build logs ([#&#8203;16885](astral-sh/uv#16885))

##### Bug fixes

- Fix `uv-trampoline-builder` builds from crates.io by moving bundled executables ([#&#8203;16922](astral-sh/uv#16922))
- Respect `NO_COLOR` and always show the command as a header when paging `uv help` output ([#&#8203;16908](astral-sh/uv#16908))
- Use `0o666` permissions for flock files instead of `0o777` ([#&#8203;16845](astral-sh/uv#16845))
- Revert "Bump `astral-tl` to v0.7.10 ([#&#8203;16887](astral-sh/uv#16887))" to narrow down a regression causing hangs in metadata retrieval ([#&#8203;16938](astral-sh/uv#16938))

##### Documentation

- Link to the uv version in crates.io member READMEs ([#&#8203;16939](astral-sh/uv#16939))

### [`v0.9.14`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0914)

[Compare Source](astral-sh/uv@0.9.13...0.9.14)

Released on 2025-12-01.

##### Performance

- Bump `astral-tl` to v0.7.10 to enable SIMD for HTML parsing ([#&#8203;16887](astral-sh/uv#16887))

##### Bug fixes

- Allow earlier post releases with exclusive ordering ([#&#8203;16881](astral-sh/uv#16881))
- Prefer updating existing `.zshenv` over creating a new one in `tool update-shell` ([#&#8203;16866](astral-sh/uv#16866))
- Respect `-e` flags in `uv add` ([#&#8203;16882](astral-sh/uv#16882))

##### Enhancements

- Attach subcommand to User-Agent string ([#&#8203;16837](astral-sh/uv#16837))
- Prefer `UV_WORKING_DIR` over `UV_WORKING_DIRECTORY` for consistency ([#&#8203;16884](astral-sh/uv#16884))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4yNy4xIiwidXBkYXRlZEluVmVyIjoiNDIuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
zanieb added a commit that referenced this pull request Jan 9, 2026
Closes #17375

It looks like this was missed in
#8881 and now that we fail if wheel
tags do not match the target environment (see
#16074), we do not allow armv8l
wheels to installed in environments where the interpreter reports
armv7l.

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--python-platform can install source build for host instead of target

4 participants