Skip to content

fix(self-update): update mise-shim.exe beside the real mise.exe, not a link to it - #14737

Merged
jdx merged 1 commit into
mainfrom
claude/mise-discussion-14736-b1e909
Oct 19, 2026
Merged

jdx merged 1 commit into
mainfrom
claude/mise-discussion-14736-b1e909

Conversation

@jdx

@jdx jdx commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

https://entire.io/gh/jdx/mise/trails/918

mise self-update on Windows now keeps the mise-shim.exe link that winget creates and updates the real mise-shim.exe instead.

When mise is started through a link such as %LocalAppData%\Microsoft\WinGet\Links\mise.exe, self-update wrote the new mise-shim.exe next to that link. That replaced the mise-shim.exe link in Links with a plain copy and left the shim in the winget package directory on the old version. mise reshim then kept warning that the shim was older than mise, because it looks for the shim beside the real mise.exe.

Self-update now resolves mise.exe to its real path before choosing where to write mise-shim.exe. This matches how mise reshim already finds the shim.

Not tested on Windows: the changed function is cfg(windows), so I only checked that the workspace still builds on Linux.

Fixes discussion #14736.

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: claude-code_2-1-299_agent.

🤖 Generated with Claude Code


Note

Low Risk
Windows-only path resolution in post-update shim refresh; canonicalize failure keeps the old behavior via fallback.

Overview
Fixes Windows self-update when mise is launched via a WinGet link (e.g. %LocalAppData%\Microsoft\WinGet\Links\mise.exe). Previously, refreshing mise-shim.exe used the parent of MISE_BIN, so the new shim landed beside the link, replaced the link’s mise-shim.exe with a plain file, and left the real shim in the package directory outdated—triggering stale-shim warnings on mise reshim.

Self-update now dunce::canonicalizes MISE_BIN (falling back to the original path if that fails) and writes mise-shim.exe next to the resolved mise.exe, aligned with where reshimming expects the shim to live.

Reviewed by Cursor Bugbot for commit 7de2ad9. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows shim updates when the installation path includes non-canonical components, with a fallback to the original path if it cannot be resolved.

…a link to it

Co-authored-by: iki <149730+iki@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M5A71TPY1HCQQQMKYA0D9QNF
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c4205915-14a5-477d-adab-ede809a7b8c1
📥 Commits

Reviewing files that changed from the base of the PR and between 6569da9 and 7de2ad9.

📒 Files selected for processing: 1
  • src/cli/self_update.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

📝 Walkthrough

On Windows, update_mise_shim now canonicalizes MISE_BIN before deriving the mise-shim.exe destination. If canonicalization fails, it uses the original path.

Changes: Windows shim update

Layer / File(s) Summary
Shim destination path
src/cli/self_update.rs
update_mise_shim derives the shim destination from the canonicalized MISE_BIN path when available. It falls back to the original path if canonicalization fails.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: jambalaya56562

Merge Risk: ⚪ Minimal · up to 7de2a

For resolvable Windows links, self-update now updates the shim beside the real executable, matching reshim’s lookup. No concrete merge-blocking risk was established.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: placing mise-shim.exe beside the real mise.exe instead of beside a link.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This change appears safe to merge.

Summary

Windows self-update now resolves MISE_BIN before choosing where to write mise-shim.exe.

  • Self-update puts the Windows shim beside the real mise executable.

Reviews (1) · Last reviewed commit: "fix(self-update): update mise-shim.exe b..." · Reviewed by Greptile

@jdx
jdx merged commit 677d300 into main Oct 19, 2026
55 checks passed
@jdx
jdx deleted the claude/mise-discussion-14736-b1e909 branch October 19, 2026 15:18
@github-actions

Copy link
Copy Markdown
Contributor

Instruction counts

Nothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does.

New, nothing to compare against: env on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, hook-env on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, ls on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, registry on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, startup on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

7de2ad9ce08f vs 21b213b3c1be · measured on the runner, not pushed to the history.

mise-en-dev added a commit that referenced this pull request Oct 20, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/905
<!-- entire-trail-link-end -->

### 🚀 Features

- **(config)** resolve relative and templated write_targets paths by
@jdx in [#14742](#14742)
- **(plugins)** accept vfox-backend: for packslip plugin sources by @jdx
in [#14727](#14727)
- **(pypi)** read private index passwords from a keyring for lock and
version listing by @jdx in
[#14733](#14733)
- **(vfox)** let backend plugins report version aliases by @jdx in
[#14732](#14732)

### 🐛 Bug Fixes

- **(bootstrap)** add list alias for packages status by @himkt in
[#14709](#14709)
- **(bootstrap)** pin compose service references before hashing by @jdx
in [#14729](#14729)
- **(ci)** stop render:help failing when markdown-magic scans target/ by
@jdx in [#14723](#14723)
- **(daemons)** resolve file tasks without their script extension by
@jdx in [#14741](#14741)
- **(docs)** render mise.toml editor hover card code as inline pills by
@jdx in [#14722](#14722)
- **(dotfiles)** don't warn on an entry with only enabled = false by
@jdx in [#14726](#14726)
- **(env)** start _.file find_up at the config root by @jdx in
[#14734](#14734)
- **(npm)** make allow_builds approve only the listed packages by @jdx
in [#14731](#14731)
- **(self-update)** update mise-shim.exe beside the real mise.exe, not a
link to it by @jdx in [#14737](#14737)
- **(vfox)** keep symlinks when extracting zip archives by @jdx in
[#14730](#14730)

### 📦️ Dependency Updates

- lock file maintenance by @renovate[bot] in
[#14712](#14712)
- update rust crate usage-cli to v7.1.0 by @renovate[bot] in
[#14717](#14717)

### Ci

- **(release)** sign Windows release binaries with SignPath by @jdx in
[#14738](#14738)
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.

1 participant