Regenerate mise wrappers that still print mise's output on every run - #11973
Open
jayrascodes wants to merge 1 commit into
Open
jayrascodes wants to merge 1 commit into
jayrascodes wants to merge 1 commit into
Conversation
omarchy-mise-install passes --quiet to `mise use -g`, but wrappers written before it gained that flag still run the loud form on every invocation, and `mise use -g` writes its confirmation to stdout. Any tool read through a pipe is corrupted; with credential.https://github.com.helper set to `!gh auth git-credential` the banner becomes the first line of the credential protocol and every HTTPS push fails with "invalid credential line" and then "could not read Username". 1784909971 rebuilds wrappers in bulk but was written against the older format and can no longer parse the one it produced: the package pattern expects the line to end in a quote, which `|| exit 1` broke, and the bin pattern expects a bare `exec "<path>"`, which `exec mise x` replaced. Both captures come back empty, so its guard skips every wrapper in silence -- reusing that loop here would look like it ran and change nothing. The package is read back out of the wrapper rather than taken from the file name, so npm:@kitlangton/ghui, aqua:modem-dev/hunk and github:can1357/oh-my-pi are not reinstalled as whatever matches their command name. Deliberately narrow about what it touches: wrappers already carrying --quiet are skipped, so it no-ops on current installs and on reruns; anything in ~/.local/bin that is not a mise wrapper is neither rewritten nor executed; and a wrapper whose arguments were %q-escaped instead of double-quoted is left alone, because skipping one leaves a stale wrapper while misparsing one leaves a broken command. The stdout assertion runs the regenerated wrapper against a mock mise that is loud exactly where the real one is, so it checks how the wrapper calls mise rather than reinstalling a tool, and cannot pass by the wrapper simply failing. A negative control runs the same probe against a stale wrapper to prove the assertion can fail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This appears to be covered by merged #8041. Its I ran that current migration against a temporary home containing the stale |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11971.
The problem
omarchy-mise-installpasses--quiettomise use -g, but wrappers written before it gained that flag still run the loud form on every invocation — andmise use -gwrites its confirmation to stdout:Anything reading one of these tools through a pipe gets that line first. The sharpest case is git: with
credential.https://github.com.helper = !gh auth git-credential, the banner becomes the first line of the credential protocol and every HTTPS push fails:Eleven wrappers were stale on the machine this was found on:
claude,copilot,crush,gemini,gh,ghui,hunk,omp,opencode,pi,playwright.Why 1784909971 doesn't already cover it
migrations/1784909971.shis the one place that rebuilds wrappers in bulk, but it was written against the older wrapper format and can no longer parse the format it itself produced:mise use -g "gh" || exit 1^mise use -g "\(.*\)"$"exec mise x "gh" -- "gh" "$@"^exec "\(.*\)" "\$@"$exec "<path>"Both captures come back empty, so the
[[ -n $package && -n $bin ]]guard skips every wrapper, silently. Reusing that loop for this fix would produce a migration that appears to run and changes nothing.This change
A migration that matches the shape
omarchy-mise-installwrites today, and regenerates only wrappers still missing--quiet.The package is read back out of the wrapper rather than derived from the file name, because regenerating from the command name alone would install the wrong thing under the right name for
npm:@kitlangton/ghui,aqua:modem-dev/hunk,github:can1357/oh-my-piand the bracketedhttp:specs.Deliberately narrow about what it will touch:
--quietare skipped, so it is a true no-op on current installs and idempotent on repeat runs.~/.local/binthat isn't a mise wrapper is left alone and never executed.%q-escaped rather than double-quoted is skipped: skipping one leaves a stale wrapper, misparsing one leaves a broken command.mise xgeneration isn't handled, since 1784909971 already converted it and migrations are strictly ordered.Testing
test/shell.d/noisy-mise-wrapper-migration-test.sh, 11 assertions, followinghermes-cli-migration-test.sh. It runs the realomarchy-mise-installagainst a temporaryHOMEso it tests today's wrapper rather than a copy of one.The stdout assertion runs the regenerated wrapper against a mock
misethat is loud exactly where the real one is — onusewithout--quiet— so it verifies how the wrapper calls mise without reinstalling anything, and can't pass just because the wrapper failed. A negative control runs the same probe against a stale wrapper to prove the assertion is capable of failing.Also covered: idempotency, backend-spec preservation, foreign commands left untouched and unexecuted,
%q-escaped wrappers skipped, non-executable files skipped, and empty/missing~/.local/bin../test/allon my machineThe new test passes. The suite as a whole reports 6 of 243 files failing, and all 6 fail identically on a pristine tree with this branch's two files removed — they're pre-existing and environmental here, not introduced by this change:
Three say why directly —
omarchy-pkgs checkout found for PKGBUILD coverage,omarchy-pkgs checkout is available for packaging coverage,omarchy-pkgs checkout found for package ownership check— I don't have that sibling checkout. Happy to rerun against CI or a fuller environment if that set doesn't match what you'd expect.🤖 Generated with Claude Code