Skip to content

Fix Homebrew "Broken pipe" failures during package install on WSL/Debian#569

Open
DevSecNinja with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-wsl-debian-log-output
Open

Fix Homebrew "Broken pipe" failures during package install on WSL/Debian#569
DevSecNinja with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-wsl-debian-log-output

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

On WSL/Debian, installs failed with Error: Broken pipe. Homebrew's concurrent/threaded output can receive SIGPIPE when its stdout is a command-substitution pipe ($(...)) rather than a TTY or regular file, aborting installs (e.g. microsoft/apm/apm).

Changes

  • run_onchange_10-install-packages.sh.tmplbrew_install_quiet, brew_install_cask_quiet, and mas_install_quiet now redirect install output to a mktemp file instead of capturing it through a pipe; on failure the file is streamed into log_data. The "only surface output on failure" behavior is unchanged.
  • test-chezmoi-scripts.bats — added an assertion that output is captured via file redirection and no longer via output=$(brew install ...).
brew_log=$(mktemp)
if brew install "$pkg" >"$brew_log" 2>&1; then
    log_result "Installed $pkg"
else
    log_warn "Failed to install $pkg"
    log_data WARN "brew output" <"$brew_log"
fi
rm -f "$brew_log"

Writing to a regular file removes the pipe reader that could close early, eliminating the SIGPIPE.

Copilot AI linked an issue Jul 10, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix WSL Debian log output issue Fix Homebrew "Broken pipe" failures during package install on WSL/Debian Jul 10, 2026
Copilot AI requested a review from DevSecNinja July 10, 2026 13:11
@DevSecNinja
DevSecNinja marked this pull request as ready for review July 10, 2026 13:52
@DevSecNinja
DevSecNinja enabled auto-merge (squash) July 10, 2026 13:52
auto-merge was automatically disabled July 10, 2026 15:06

Head branch was pushed to by a user without write access

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.

fix: wsl debian log output

2 participants