Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--print=native-static-libs is not emitted to stdout, but instead to stderr #125304

Open
madsmtm opened this issue May 20, 2024 · 2 comments
Open
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@madsmtm
Copy link
Contributor

madsmtm commented May 20, 2024

Running the following:

$ echo "" > empty.rs
$ rustc empty.rs --crate-type=staticlib --print=native-static-libs
note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.

note: native-static-libs: -lSystem -lc -lm

I.e. it does produce the expected native-static-libs: ... note, but the note is emitted to the stderr stream, instead of stdout, as is done by the other --print=... flags.

I expected to be able to pipe the output to e.g. grep to extract the note, but no such luck:

$ rustc empty.rs --crate-type=staticlib --print=native-static-libs | grep native-static-libs

Meta

rustc --version --verbose:

rustc 1.80.0-nightly (e82c861d7 2024-05-04)
binary: rustc
commit-hash: e82c861d7e5ecd766cb0dab0bf622445dec999dc
commit-date: 2024-05-04
host: aarch64-apple-darwin
release: 1.80.0-nightly
LLVM version: 18.1.4
@madsmtm madsmtm added the C-bug Category: This is a bug. label May 20, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 20, 2024
@madsmtm
Copy link
Contributor Author

madsmtm commented May 20, 2024

I am unsure how to go about fixing this? Perhaps the solution would just be to emit it to both streams, for backwards compatibility?

@Urgau
Copy link
Member

Urgau commented May 20, 2024

@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants