Skip to content

Commit 08f8c07

Browse files
committed
fix: redirect cargo build output to stderr to avoid polluting tool stdout
Redirect cargo build output (messages, warnings) to stderr instead of stdout. This ensures that when redirecting or piping the output of cargo-binutils tools, only the tool's output appears on stdout, not cargo/rustc messages.
1 parent 966d644 commit 08f8c07

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Redirected cargo build output to stderr instead of stdout. This prevents cargo/rustc messages and warnings from appearing in the stdout of cargo-binutils tools, making it easier to pipe or redirect tool output cleanly.
13+
1014
## [v0.4.0] - 2025-08-26
1115

1216
### Added

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
449449
Message::CompilerMessage(msg) => {
450450
if !quiet || verbose > 1 {
451451
if let Some(rendered) = msg.message.rendered {
452-
print!("{rendered}");
452+
eprint!("{rendered}");
453453
}
454454
}
455455
}

0 commit comments

Comments
 (0)