Repository navigation
fix(shim): use snap payload for unix shims - #12035
Conversation
Resolve Snap-installed mise shims to the refresh-stable payload instead of the argv0-sensitive /snap/bin dispatcher. Keep doctor aligned with reshim and cover the Snap path behavior.\n\nRefs #12027.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds Snap-aware mise executable resolution. Reshim and doctor analysis now use the shared resolver, which maps revision-specific Snap paths to the stable ChangesSnap shim resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change localizes Snap shim target resolution and keeps existing behavior for other installations; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Reshim
participant mise_bin_for_shims
participant SnapMount
participant Doctor
Reshim->>mise_bin_for_shims: resolve mise executable
mise_bin_for_shims->>SnapMount: inspect revision-specific path
SnapMount-->>mise_bin_for_shims: return stable current path
mise_bin_for_shims-->>Reshim: generate stable-targeted shims
Doctor->>mise_bin_for_shims: resolve mise executable
mise_bin_for_shims-->>Doctor: return stable current path
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
Greptile SummaryThe PR makes Unix shims created by Snap-installed mise target the refresh-stable payload beneath Snap’s
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "fix(shim): handle symlinked snap mount p..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1291655. Configure here.
Instruction countsNothing 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: 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.
|

Summary
currentsymlinkmise doctorso validation matchesreshimRoot cause
/snap/bin/miseis a symlink to the snap dispatcher, which identifies the application fromargv[0]. When a mise shim such asnodepoints there, snapd seesnodeinstead ofmiseand runs the snap CLI rather than mise's shim dispatcher.The fix bypasses
/snap/binonly when the running mise executable is beneath$SNAP. Other installations retain the PATH-visible executable so package-manager launchers remain stable across upgrades.Refs #12027
Testing
cargo test --locked --bin mise shims::tests::snap_mise_binmise run test:e2e e2e/cli/test_reshim_with_shims_on_pathhk run check --safe --format jsonfor the three changed filesAI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.
Note
Medium Risk
Changes shim target resolution for Snap users and shared doctor validation logic; scope is narrow but affects how every generated shim is validated and created on Unix when SNAP is set.
Overview
Fixes Snap installs where tool shims pointed at the snapd dispatcher (e.g.
/snap/bin/mise), soargv[0]was the shim name (node, etc.) and snapd ran the wrong app instead of mise.When
$SNAPis set and the running binary lives under that revision,reshimandmise doctornow resolve the shim target viamise_bin_for_shims()to the payload under the refresh-stablecurrentsymlink (e.g./snap/mise/current/bin/mise). Non-Snap installs keep the previous behavior (which_no_shims/MISE_BIN).Adds unit tests for
snap_mise_binand an e2e scenario that simulates Snap’s revision +currentlayout and checksdoctoragrees withreshim.Reviewed by Cursor Bugbot for commit c753f61. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
mise doctorso it correctly recognizes valid shims in Snap environments.Tests