Skip to content

Fix shell redirect to suppress stdout with --print - #619

Merged
alecthomas merged 4 commits into
cashapp:masterfrom
fudge01010:jfuge/fix-shim-redirect
Sep 15, 2026
Merged

alecthomas merged 4 commits into
cashapp:masterfrom
fudge01010:jfuge/fix-shim-redirect

Conversation

@fudge01010

Copy link
Copy Markdown
Contributor

Problem

The root shim's self-bootstrap fallback pipes install.sh into bash without redirecting stdout. Since the shim is meant to run inside eval "$(hermit shell-hooks --print --zsh)", install.sh's progress messages get eval'd as shell commands on any machine where HERMIT_EXE isn't bootstrapped yet - polluting the shell with failed eval's. Subsequent opens are fine as the binary is installed correctly

Fix

Redirect that output to stderr (bash 1>&2) in both files/install.sh.tmpl and cmd/geninstaller/install.sh.tmpl, with a regression test covering the self-bootstrap path.

Test

./bin/go test ./app/ -run TestGenInstallerSystemShimDoesNotLeakBootstrapOutputToStdout -v
diff files/install.sh.tmpl cmd/geninstaller/install.sh.tmpl
=== RUN   TestGenInstallerSystemShimDoesNotLeakBootstrapOutputToStdout
--- PASS: TestGenInstallerSystemShimDoesNotLeakBootstrapOutputToStdout (0.53s)
PASS
ok      github.com/cashapp/hermit/app   0.957s

@fudge01010 fudge01010 changed the title Jfuge/fix shim redirect Fix shell redirect to suppress stdout with --print Sep 9, 2026
@alecthomas
alecthomas enabled auto-merge (squash) September 9, 2026 03:21
auto-merge was automatically disabled September 9, 2026 05:35

Head branch was pushed to by a user without write access

@alecthomas
alecthomas enabled auto-merge (squash) September 15, 2026 21:26
@alecthomas
alecthomas merged commit 4af8bd0 into cashapp:master Sep 15, 2026
8 checks passed
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.

2 participants