Repository navigation
Stop mise wrappers recursing when mise's activation variables are missing - #13769
andrew-boyd wants to merge 1 commit into
Conversation
…sing A wrapper ends in `exec mise x <package> -- <bin>`, and `mise x` looks <bin> up by name. It puts the directories it added ahead of the rest of PATH, and it knows which those are from the variables `mise activate` exports. A wrapper started with an activated PATH but without those variables, as a service, a sandbox, or any launcher that passes PATH through a reduced environment does, sees the package's directory as an ordinary entry behind ~/.local/bin. `mise x` then finds the wrapper again, and the wrapper runs itself until something kills it, holding a CPU core the whole time. Resolve the bin inside the package's install with `mise which --tool` and hand `mise x` that path. A migration regenerates the wrappers on disk.
90474af to
1cb0f23
Compare
Tested commit Verification Summary
Verification outputThe solution cleanly resolves the recursion hazard, and the migration safety checks (exact template matching and size guard) ensure existing customized wrappers are left untouched.
|
|
Reviewed by Claude Opus 5.5, with Codex Medium as a second opinion. The bug is real: the same loop has been reproduced on a disposable Omarchy worker for #8692 and #9583. Several open pull requests fix it, and #8692 fixes it more tightly than this one. So I recommended #8692 to the maintainer, read this branch rather than running it, and did not run it on a worker. Why #8692. This branch resolves the binary with Second opinion. Codex Medium was given this pull request and its competitors without my conclusion, and also picked #8692. It traced the behaviour to mise's toolset builder, which adds the Nothing is needed from you for now. This waits on the maintainer, who has the competing fixes to choose between. |
|
@omarchybot #9596 should be the correct fix here |
|
Rechecked by Claude Opus 5.5, with Codex Medium as a second opinion, after @jdx pointed at #9596 and #8692's author marked it a draft in favour of #9596. The head of this branch has not moved, and the earlier finding still stands: on mise 2026.10.0, #9596. It replaces Omarchy's default wrappers with mise's native lazy shims, and its migration removes the known default wrappers. It does not change The narrow fixes. Codex Medium was given this pull request and its competitors without my conclusion. It again picked #8692 as the tightest fix, with the caveat that its author has now withdrawn it in favour of #9596. It also judged #13614 a sound alternative, because it checks that the resolved path is inside the requested package's install. It agreed about the Nothing is needed from you for now. This waits on the maintainer, who has #9596 and the narrow fixes to choose between. |
A wrapper from
omarchy-mise-installends inexec mise x <package> -- <bin>, andmise xlooks<bin>up by name. It puts the directories it added ahead of the rest of PATH, and it knows which those are from the variablesmise activateexports (__MISE_DIFF). A process that starts a wrapper with an activated PATH but a reduced environment (a service, a sandbox, or a launcher that passes only a safe set of variables) leaves those out.mise xthen treats the package's directory as an ordinary entry behind~/.local/bin, finds the wrapper again, and the wrapper runs itself until something kills it, holding a CPU core the whole time.This is the same loop #3685's fix addressed for
exec "$bin";mise xstill reaches it through this path.Reproduction (on a machine with the
ghwrapper installed):With this change the same command prints the gh version at once.
Change
mise which --tool <package> <bin>and handsmise xthat path. It exits with mise's error if the bin cannot be resolved.--quietmigration, so edited wrappers are left alone.Testing
mise-install,mise-wrapper-quiet-migration,mise-wrapper-which-migration,hermes-mise-migration, anddefault-agenttests pass on an Omarchy machine.test/shellrun before and after the change shows the same set of failures, with no new ones.gh.