Skip to content

fix(self-update): self-update fails across year boundary due to semver mismatch#7611

Merged
jdx merged 1 commit intomainfrom
fix/self-update-version-mismatch
Jan 8, 2026
Merged

fix(self-update): self-update fails across year boundary due to semver mismatch#7611
jdx merged 1 commit intomainfrom
fix/self-update-version-mismatch

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Jan 8, 2026

Summary

  • Fixes self-update failing with "No asset found" when updating from 2025.x to 2026.x
  • The self_update crate uses semver compatibility checks, causing it to find v2025.12.13 as "compatible" while mise had already baked v2026.1.1 into the target filename
  • Fix: Always set target_version_tag to match the version in the target filename

Root Cause

When updating from v2025.12.12:

  1. Mise calls get_latest_release() which returns v2026.1.1
  2. Constructs target filename: mise-v2026.1.1-macos-arm64.tar.gz
  3. Without --force, doesn't set target_version_tag
  4. The self_update library uses semver to find "compatible" release (v2025.12.13)
  5. Tries to find mise-v2026.1.1-*.tar.gz in v2025.12.13's assets
  6. Fails because v2025.12.13 only has mise-v2025.12.13-*.tar.gz assets

Test plan

  • Reproduced the issue by downgrading to v2025.12.12 and running mise self-update
  • Verified the fix logic ensures version consistency between target filename and release lookup

Fixes: #7589

🤖 Generated with Claude Code


Note

Ensures the self-update process downloads assets for the exact intended release by always pinning the target version tag.

  • Unconditionally sets update.target_version_tag(&v) in src/cli/self_update.rs so the release lookup matches the version embedded in the constructed asset filename
  • Prevents mismatches when self_update selects a semver-compatible release different from v while the asset name is built with v

Written by Cursor Bugbot for commit 68444d3. This will update automatically on new commits. Configure here.

When updating from 2025.x to 2026.x, self-update would fail with
"No asset found" because:

1. Mise constructs target filename with latest version (v2026.1.1)
2. But without --force, it doesn't set target_version_tag
3. The self_update library then uses semver compatibility to find
   v2025.12.13 as the "compatible" release
4. It tries to find mise-v2026.1.1-*.tar.gz in v2025.12.13's assets
5. Fails because those assets don't exist in that release

Fix: Always set target_version_tag to match the version baked into
the target filename, ensuring the library fetches the correct release.

Fixes: #7589

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 8, 2026 17:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a critical bug where mise self-update fails across calendar year boundaries (e.g., 2025.x to 2026.x) due to a semver compatibility mismatch in the self_update crate. The root cause was that the target version tag wasn't being set consistently, allowing the library to select a "compatible" but incorrect version for asset lookup.

  • Removes conditional logic that prevented setting target_version_tag in non-force updates
  • Ensures version consistency between the constructed target filename and the release lookup
  • Prevents the self_update crate from using semver compatibility to select wrong release versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.1 x -- echo 21.1 ± 0.3 20.5 23.9 1.00
mise x -- echo 21.7 ± 0.7 20.5 27.9 1.03 ± 0.03

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.1 env 20.2 ± 0.4 19.3 23.7 1.00
mise env 20.3 ± 0.4 19.4 21.4 1.01 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.1 hook-env 20.1 ± 0.3 19.4 21.6 1.00
mise hook-env 20.8 ± 0.4 19.9 22.2 1.04 ± 0.03

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.1 ls 18.0 ± 0.3 17.4 19.4 1.00
mise ls 18.7 ± 0.5 17.7 22.3 1.04 ± 0.03

xtasks/test/perf

Command mise-2026.1.1 mise Variance
install (cached) 112ms 113ms +0%
ls (cached) 68ms 69ms -1%
bin-paths (cached) 73ms 73ms +0%
task-ls (cached) 285ms 293ms -2%

@jdx jdx changed the title fix(cli): self-update fails across year boundary due to semver mismatch fix(self-update): self-update fails across year boundary due to semver mismatch Jan 8, 2026
@jdx jdx merged commit 0cc327a into main Jan 8, 2026
37 checks passed
@jdx jdx deleted the fix/self-update-version-mismatch branch January 8, 2026 17:48
jdx pushed a commit that referenced this pull request Jan 13, 2026
### 🐛 Bug Fixes

- **(backend)** filter pre-release versions with latest + install_before
by @koh-sh in [#7631](#7631)
- **(docs)** formatting in configuration hierarchy section by
@jonathanagustin in [#7638](#7638)
- **(npm)** migrate npm publish to OIDC trusted publishing by @jdx in
[#7607](#7607)
- **(registry)** correct checkmake version test pattern by @jdx in
[#7632](#7632)
- **(release)** handle empty grep result in aqua-registry changelog by
@jdx in
[f45b4c6](f45b4c6)
- **(self-update)** self-update fails across year boundary due to semver
mismatch by @jdx in [#7611](#7611)
- **(tasks)** fix tool inheritance from intermediate parents by @chadxz
in [#7637](#7637)
- add `-test` to VERSION_REGEX prerelease filter by @belgio99 in
[#7647](#7647)

### 📚 Documentation

- **(tasks)** remove documentation for unimplemented features by
@turbocrime in [#7599](#7599)
- update `mise aliases` references to `mise tool-alias` by @muzimuzhi in
[#7615](#7615)
- use call operator in PowerShell profile example by @shina1024 in
[#7639](#7639)
- replace ASCII .pub key with binary .gpg for signed-by on Ubuntu/Debian
by @gmalinowski in [#7649](#7649)

### 🛡️ Security

- **(security)** prevent code execution from untrusted fork in
registry-comment workflow by @jdx in
[4a2441e](4a2441e)

### ◀️ Revert

- Revert "fix(release): handle empty grep result in aqua-registry
changelog" by @jdx in
[522ffdc](522ffdc)
- Revert "chore(release): include manually updated aqua-registry entries
in the changelog " by @jdx in
[1ebb943](1ebb943)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:alpine docker digest to fbfffcf by
@renovate[bot] in [#7619](#7619)
- lock file maintenance by @renovate[bot] in
[#7646](#7646)

### 📦 Registry

- add hatoo/oha tool by @jylenhof in
[#7633](#7633)

### Chore

- **(registry)** fix registry comment workflow by @risu729 in
[#7554](#7554)
- **(release)** include manually updated aqua-registry entries in the
changelog by @risu729 in [#7603](#7603)

### New Contributors

- @belgio99 made their first contribution in
[#7647](#7647)
- @gmalinowski made their first contribution in
[#7649](#7649)
- @chadxz made their first contribution in
[#7637](#7637)
- @shina1024 made their first contribution in
[#7639](#7639)
- @jonathanagustin made their first contribution in
[#7638](#7638)
- @turbocrime made their first contribution in
[#7599](#7599)

## 📦 Aqua Registry Updates

#### New Packages (3)

- [`ampcode/zvelte-check`](https://github.com/ampcode/zvelte-check)
- [`nickel-lang/nickel`](https://github.com/nickel-lang/nickel)
- [`openshift/rosa`](https://github.com/openshift/rosa)
jdx added a commit that referenced this pull request Jan 14, 2026
PR #7611 fixed the year boundary semver issue by always setting
target_version_tag, but this broke the "already up to date" detection
since the self_update library no longer performs its own version check.

This adds an explicit version comparison before calling update(),
returning Status::UpToDate when versions match (unless --force is set).

Also wraps the blocking HTTP calls in tokio::task::block_in_place()
to fix a panic in debug builds where reqwest::blocking tries to create
a nested tokio runtime.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jdx added a commit that referenced this pull request Jan 14, 2026
## Summary

- Fixes regression from #7611 where `mise self-update` would download
and update even when already at the latest version
- Adds explicit version comparison before calling `update()`, returning
`Status::UpToDate` when versions match (unless `--force` is set)
- Wraps blocking HTTP calls in `tokio::task::block_in_place()` to fix
panic in debug builds

## Root Cause

PR #7611 fixed the year boundary semver issue by always setting
`target_version_tag`, but this bypassed the self_update library's own
"already up to date" detection. The library no longer checks if an
update is needed when a specific target version is set.

## Test plan

- [x] `mise self-update` reports "mise is already up to date" when
current version matches latest
- [x] `mise self-update --force` still downloads and updates
- [x] Debug builds no longer panic due to nested tokio runtime

Fixes: #7589

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Prevents unnecessary self-updates and fixes async runtime issues.
> 
> - Adds version comparison before update; returns `Status::UpToDate`
when current `v{cargo_crate_version!()}` matches latest (unless
`--force`)
> - Wraps blocking HTTP in `tokio::task::block_in_place()` via
`do_update` -> `do_update_blocking` split
> - Always sets `update.target_version_tag(&v)` to ensure correct
release selection across semver/year boundaries
> - Keeps plugin auto-update behavior; no-confirm still respects
settings and `--yes`
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8ca7d9c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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