Skip to content

Resolve official uv self-update versions before axoupdater - #18674

Merged
zsol merged 2 commits into
mainfrom
zsol/jj-molomyntlmzo
Mar 23, 2026
Merged

zsol merged 2 commits into
mainfrom
zsol/jj-molomyntlmzo

Conversation

@zsol

@zsol zsol commented Mar 23, 2026 •

Copy link
Copy Markdown
Member

This PR changes uv self update to use the uv.ndjson hosted at https://raw.githubusercontent.com/astral-sh/versions/main/v1/ to resolve the desired uv version.

This behavior change happens only if:

  • there are no override env vars in effect
  • the currently running uv was installed from the "official" place (i.e. the receipt says the binary is from github.com/astral-sh/uv)

Important

Because of the move to pep440 version specifiers, this means that uv self update 0.10 will now resolve to 0.10.0 instead of failing. This is consistent with uvx uv@0.10 behavior, but it isn't intuitive. We could consider failing such commands like before, but I chose consistency with uvx uv@0.10, because I'm planning to add version bounds (uv self update '<0.11') too, which would make it clearer that these are Python version strings.

Towards #18503.

Test Plan

Happy path:

❯ uv self update --dry-run -vv 0.10
DEBUG uv 0.10.12+12 (4bc25a1c0 2026-03-23 aarch64-apple-darwin)
info: Checking for updates...
DEBUG Using official public self-update path
DEBUG Using request connect timeout of 10s and read timeout of 30s
TRACE Handling request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson with authentication policy auto
TRACE Request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson is unauthenticated, checking cache
TRACE No credentials in cache for URL https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
TRACE Attempting unauthenticated request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
DEBUG Resolved self-update target to `uv==0.10.0`
Would update uv from v0.10.12 to v0.10.0

One of the many sad paths:

❯ uv self update --dry-run -vv 0.11
DEBUG uv 0.10.12+12 (4bc25a1c0 2026-03-23 aarch64-apple-darwin)
info: Checking for updates...
DEBUG Using official public self-update path
DEBUG Using request connect timeout of 10s and read timeout of 30s
TRACE Handling request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson with authentication policy auto
TRACE Request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson is unauthenticated, checking cache
TRACE No credentials in cache for URL https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
TRACE Attempting unauthenticated request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
TRACE Considering retry of error: NoMatchingVersion { binary: Uv, constraints: VersionSpecifiers([VersionSpecifier { operator: Equal, version: "0.11" }]), platform: "aarch64-apple-darwin" }
TRACE Cannot retry error: neither an IO error nor a reqwest error
TRACE Error trace: Failed to resolve uv version `0.11`

Caused by:
    No version of uv found matching `==0.11` for platform `aarch64-apple-darwin`
error: Failed to resolve uv version `0.11`
  Caused by: No version of uv found matching `==0.11` for platform `aarch64-apple-darwin`

@zsol
zsol force-pushed the zsol/jj-molomyntlmzo branch from 4bc25a1 to 3a51035 Compare March 23, 2026 17:51
@zsol
zsol marked this pull request as ready for review March 23, 2026 18:08
Comment thread crates/uv/src/commands/self_update.rs Resolved
@zanieb

zanieb commented Mar 23, 2026

Copy link
Copy Markdown
Member

We might want to continue to ban uv self update 0.10 such that we can have it support wildcard patch version semantics in the future. Adding consistency with uvx will limit our future decisions.

@zanieb

zanieb commented Mar 23, 2026

Copy link
Copy Markdown
Member

Generally, the .0 version expansion only makes sense with >= and ==, etc. it doesn't really make sense with our @<version> user experience.

@zsol

zsol commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

Alright, I'll add a check that ensures the version number roundtrips cleanly (to_string(parse(input)) == input), that should ban the version expansions for now.

@zsol
zsol force-pushed the zsol/jj-molomyntlmzo branch from e514256 to d884aa8 Compare March 23, 2026 19:32
@zsol
zsol enabled auto-merge (squash) March 23, 2026 19:35
@zsol
zsol disabled auto-merge March 23, 2026 19:37
Comment thread crates/uv/src/commands/self_update.rs Resolved
@zsol
zsol force-pushed the zsol/jj-molomyntlmzo branch from d884aa8 to e8f3afe Compare March 23, 2026 19:43
@zsol
zsol enabled auto-merge (squash) March 23, 2026 19:44
@zsol
zsol merged commit e280625 into main Mar 23, 2026
54 checks passed
@zsol
zsol deleted the zsol/jj-molomyntlmzo branch March 23, 2026 19:57
woodruffw added a commit that referenced this pull request Apr 27, 2026
## Summary

This is an attempt at fixing #19137. See
#19139 (comment) for
my understanding of the situation and motivation for this approach
(versus the simpler approach in #19139).

TL;DR: we were unconditionally appending `eabihf` to all libc variants
when constructing `cargo dist`-style triplets. This was incorrect for a
long time, but didn't surface on hot user paths until #18674 reused that
pathway for uv's own self-upgrade logic. The fix is as simple as not
doing that, _except_ that we _do_ want to do it in the bare `Gnu` and
`Musl` cases, since those signal FP detection errors (and we
optimistically assume the user really has a hardfloat environment). So
now we emit the appropriate `Musleabi`/`Musleabihf` variants and
specialize the append to just the FP detection failure cases for both
`Gnu` and `Musl` explicitly.

Closes #19137. Closes #19139.

## Test Plan

Added a unit test demonstrating the new `as_cargo_dist_triple` behavior.

---------

Signed-off-by: William Woodruff <william@astral.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants