Skip to content

Resolve mise wrapper binaries to absolute paths - #13677

Closed
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-mise-wrapper-abspath-ef3e
Closed

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-mise-wrapper-abspath-ef3e

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

When ~/.local/bin precedes mise’s shims, mise x -- <bin> resolves back into the Omarchy wrapper and loops forever in the same PID.

Wrappers now run mise which --tool <pkg> <bin> and exec that absolute path. A migration regenerates wrappers still on the bare-name template.

Fixes #13090

Test plan

  • test/shell.d/mise-install-test.sh
  • test/shell.d/mise-wrapper-abspath-migration-test.sh
  • test/shell.d/mise-wrapper-quiet-migration-test.sh
  • test/shell.d/default-agent-test.sh (lazy stubs)

cursoragent and others added 2 commits September 29, 2026 21:17
When ~/.local/bin precedes mise shims, mise x -- <bin> re-enters the
wrapper forever. Resolve with mise which --tool and exec that path
(omacom#13090).

Co-authored-by: AnPod <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Closing this as a duplicate of #13090, which makes the same change to the same base branch and was opened four days earlier.

What makes them the same. Both change the wrapper that bin/omarchy-mise-install writes in the same way, byte for byte: resolve the binary with bin_path=$(mise which --tool <pkg> <bin>) || exit 1 and then exec mise x <pkg> -- "$bin_path" "$@". Both add a migration that regenerates wrappers still on the previous form. The logic is the same (the same stale_template, the same 1024-byte size guard, the same two sed patterns, the same exact-match check before calling omarchy-mise-install), and #13090's copy also explains each guard in comments. Both make the same edits to test/shell.d/default-agent-test.sh, mise-install-test.sh and mise-wrapper-quiet-migration-test.sh. #13090 also tests more in its migration test: it runs the real generator, and it checks idempotence, a customised wrapper, a symlink, a large binary and a missing ~/.local/bin. This one checks a single stale wrapper against a stubbed generator. So this pull request does not do anything #13090 doesn't already do.

Which fix the maintainer is choosing between. Several open pull requests fix the self-exec loop in #13040: #8692, #13090, #13614 and #13769. As the review on #13090 explains, mise which --tool <pkg> without a version does not limit the lookup to <pkg>, so it can return another tool's binary with the same name. #8692 avoids that with mise bin-paths <pkg>. That review recommended #8692, and choosing between the fixes is up to the maintainer.

Reviewed by Claude Opus 5.5 by reading both diffs side by side. Codex Medium checked the duplicate call separately. No tests were run, because closing a duplicate doesn't depend on them. If you think this is wrong — for example, if this branch does something #13090 doesn't — say so and it can be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants