Skip to content

fix(task): replace println!/eprintln! with calm_io in task output macros#8485

Merged
jdx merged 1 commit intojdx:mainfrom
vmaleze:fix/task-output-broken-pipe
Mar 6, 2026
Merged

fix(task): replace println!/eprintln! with calm_io in task output macros#8485
jdx merged 1 commit intojdx:mainfrom
vmaleze:fix/task-output-broken-pipe

Conversation

@vmaleze
Copy link
Copy Markdown
Contributor

@vmaleze vmaleze commented Mar 6, 2026

Fixes broken pipe panics in task output path triggered when stdout/stderr is closed early (e.g. pipe or shell substitution finishing before mise).

Fixes broken pipe panics in task output path triggered when stdout/stderr
is closed early (e.g. pipe or shell substitution finishing before mise).
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the stability of task output by migrating from standard I/O macros to the calm_io library. This change prevents application crashes that previously occurred when output streams were unexpectedly closed, ensuring a more resilient user experience, especially in environments involving shell piping or redirection.

Highlights

  • Output Handling: Replaced standard println! and eprintln! macros with calm_io equivalents (stdoutln! and stderrln!) to manage output streams more robustly.
  • Panic Prevention: Addressed potential 'broken pipe' panics that could occur when stdout or stderr streams are closed prematurely, such as when piping output to another command that finishes early.
Changelog
  • src/output.rs
    • Modified prefix_println! macro to use calm_io::stdoutln! instead of println!.
    • Modified prefix_eprintln! macro to use calm_io::stderrln! instead of eprintln!.
  • src/task/task_results_display.rs
    • Replaced eprintln! with calm_io::stderrln! in the display_timing_summary function.
    • Replaced eprintln! with calm_io::stderrln! when reporting failed tasks.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses panics from broken pipes by replacing println! and eprintln! with calm_io::stdoutln! and calm_io::stderrln! in task-related output macros and functions. The Result returned by the calm_io macros is ignored using let _ = ..., which prevents the application from panicking when writing to a closed pipe. The changes are applied consistently to prefix_println!, prefix_eprintln!, and functions within TaskResultsDisplay.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 6, 2026

Greptile Summary

This PR replaces bare println!/eprintln! calls in the task output path with calm_io::stdoutln!/calm_io::stderrln! to prevent broken pipe panics when stdout/stderr is closed early (e.g., mise run some-task | head). The let _ = ... idiom is used throughout to silently discard I/O errors, which is the correct approach for a task runner that should not crash on early pipe closure.

Key changes:

  • src/output.rs: prefix_println! and prefix_eprintln! macros now use calm_io and properly discard I/O errors
  • src/task/task_results_display.rs: Timing summary and failure header eprintln! calls are updated to use calm_io

The changes are minimal, focused, and correctly implement the fix for broken pipe handling in task output.

Confidence Score: 5/5

  • This PR is safe to merge. It correctly implements broken pipe handling in task output paths using the established calm_io pattern.
  • All changes have been verified. The core macros and task results display are correctly updated. The calm_io crate is already a declared dependency and the API usage matches existing patterns in the codebase. The let _ = ... idiom correctly handles and discards I/O errors without crashing.
  • No files require special attention.

Last reviewed commit: b83bae0

@jdx jdx merged commit c6aaa90 into jdx:main Mar 6, 2026
33 checks passed
mise-en-dev added a commit that referenced this pull request Mar 7, 2026
### 🚀 Features

- **(github)** keep exe extensions on Windows by @iki in
[#8424](#8424)
- **(task)** add `interactive` field for exclusive terminal access by
@jdx in [#8491](#8491)
- add header comment to generated lockfiles by @ivy in
[#8481](#8481)
- runtime musl/glibc detection for correct libc variant selection by
@jdx in [#8490](#8490)

### 🐛 Bug Fixes

- **(github)** use registry platform options during install by @jdx in
[#8492](#8492)
- **(http)** store tool opts as native TOML to fix platform switching by
@jdx in [#8448](#8448)
- **(installer)** error if MISE_INSTALL_PATH is a directory by @jdx in
[#8468](#8468)
- **(prepare)** resolve sources/outputs relative to `dir` when set by
@jdx in [#8472](#8472)
- **(ruby)** fetch precompiled binary by release tag instead of listing
all releases by @jdx in [#8488](#8488)
- **(schema)** support structured objects in task depends by @risu729 in
[#8463](#8463)
- **(task)** replace println!/eprintln! with calm_io in task output
macros by @vmaleze in [#8485](#8485)
- handle scoped npm package names without backend prefix by @jdx in
[#8477](#8477)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:copr docker digest to c485c4c by
@renovate[bot] in [#8484](#8484)
- update ghcr.io/jdx/mise:alpine docker digest to 8118bc7 by
@renovate[bot] in [#8483](#8483)

### 📦 Registry

- disable sd version test by @jdx in
[#8489](#8489)

### New Contributors

- @ivy made their first contribution in
[#8481](#8481)
- @iki made their first contribution in
[#8424](#8424)

## 📦 Aqua Registry Updates

#### New Packages (5)

- [`datadog-labs/pup`](https://github.com/datadog-labs/pup)
- [`k1LoW/mo`](https://github.com/k1LoW/mo)
- [`rtk-ai/rtk`](https://github.com/rtk-ai/rtk)
-
[`suzuki-shunsuke/docfresh`](https://github.com/suzuki-shunsuke/docfresh)
- [`yashikota/exiftool-go`](https://github.com/yashikota/exiftool-go)

#### Updated Packages (6)

- [`cloudflare/cloudflared`](https://github.com/cloudflare/cloudflared)
- [`mozilla/sccache`](https://github.com/mozilla/sccache)
- [`owenlamont/ryl`](https://github.com/owenlamont/ryl)
- [`spinel-coop/rv`](https://github.com/spinel-coop/rv)
-
[`technicalpickles/envsense`](https://github.com/technicalpickles/envsense)
- [`weaviate/weaviate`](https://github.com/weaviate/weaviate)
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