Skip to content

Conversation

@nhpupu
Copy link
Contributor

@nhpupu nhpupu commented Sep 18, 2025

This PR changes the cargo build invocation so that all cargo/rustc messages and warnings are sent to stderr, not stdout. This solves the problem where output from cargo nm, cargo objdump, etc. would include cargo/rustc messages when piping or redirecting stdout, as described in #111.

Why?

  • When redirecting or piping stdout, users expect only the tool's output, not build messages or warnings.
  • Now, cargo objdump -- -s > dump and similar commands will only save the tool output to file.
  • Users can easily silence build output with 2>/dev/null if desired.

Fixes: #111

…dout

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.
@nhpupu nhpupu requested a review from a team as a code owner September 18, 2025 13:37
Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

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

awesome, thank you!

@Emilgardis Emilgardis added this pull request to the merge queue Sep 18, 2025
Merged via the queue into rust-embedded:master with commit fa6d682 Sep 18, 2025
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.

cargo nm output includes compiler messages

2 participants