uv/crates/uv-dispatch
Charlie Marsh bc3eac2bc9
Avoid sharing state between universal and non-universal resolves (#11051)
## Summary

This is a really subtle issue. I'm actually having trouble writing a
test for it, though the problem makes sense. In short, we're sharing the
`SharedState` between the `BuildContext` and the universal resolver. The
`SharedState` includes `VersionMap`, which tracks incompatibilities...
The incompatibilities use the platform tags, which are only present when
resolving from the `BuildContext` (i.e., when resolving build
dependencies). The universal resolver then fails because it sees a bunch
of "incompatible" wheels that are incompatible with the current platform
(i.e., the current Python interpreter).

In short, we _cannot_ share a `SharedState` across two operations that
perform a universal and then a platform-specific resolution. So this PR
adds separate types and fixes up any overlapping usages.

A better setup, for the future, would be to somehow share the underlying
simple metadata, and only track separate `VersionMap` -- since there
_is_ a bunch of data we can share. But that's a larger change.

Closes https://github.com/astral-sh/uv/issues/10977.
2025-01-29 03:27:28 +00:00
..
src Avoid sharing state between universal and non-universal resolves (#11051) 2025-01-29 03:27:28 +00:00
Cargo.toml Better build error messages (#9660) 2024-12-17 09:44:32 -06:00