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

show linker output even if the linker succeeds #119286

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 24, 2023

  • show stderr by default
  • show stdout if --verbose is passed
  • remove both from RUSTC_LOG
  • hide the linker cli args unless --verbose is passed

fixes #83436. fixes #38206. fixes #109979. helps with #46998. cc https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/uplift.20some.20-Zverbose.20calls.20and.20rename.20to.E2.80.A6.20compiler-team.23706/near/408986134

try-job: aarch64-apple

r? @bjorn3

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 24, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 24, 2023

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

@jyn514 jyn514 force-pushed the linker-output branch 2 times, most recently from 060a457 to a34d7ae Compare December 24, 2023 23:47
@jyn514
Copy link
Member Author

jyn514 commented Dec 24, 2023

hmm actually this is a slight expansion of scope but @bjorn3 how would you feel about not printing the giant list of linker arguments unless someone passes --verbose (#109979)

@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-output branch 2 times, most recently from 64cb47a to ab6fb2b Compare December 25, 2023 00:55
@jyn514
Copy link
Member Author

jyn514 commented Dec 25, 2023

also i know we settled on not showing stdout by default but it's useful for debugging search paths - maybe we should show it after all? it seems silly to have to pass both -Wl,--verbose and --verbose. #46998 (comment)

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 6, 2024

☔ The latest upstream changes (presumably #119662) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Jan 20, 2024

hmm. that test has the following comment:

// Between revisions 1 and 2, we are changing the debuginfo-level, which should
// invalidate the cache. Between revisions 2 and 3, we are adding `--verbose`
// which should have no effect on the cache. Between revisions, we are adding
// `--remap-path-prefix` which should invalidate the cache:
//[rpass1] compile-flags: -C debuginfo=0
//[rpass2] compile-flags: -C debuginfo=2
//[rpass3] compile-flags: -C debuginfo=2 --verbose
//[rpass4] compile-flags: -C debuginfo=2 --verbose --remap-path-prefix=/home/bors/rust=src

i suppose those lines are all invalid now, it should be testing that the CGU is not reused? i'm not sure why it's testing --verbose specifically, maybe it's enough to test any untracked CLI arg. i'll change it to --diagnostic-width.

i'm realizing your comments are all about #119129. i feel slightly uncomfortable making unrelated changes in this PR ... how do you feel about splitting them into a separate PR so i can assign michaelwoerister?

@bjorn3
Copy link
Member

bjorn3 commented Jan 20, 2024

how do you feel about splitting them into a separate PR so i can assign michaelwoerister?

Sure

@bjorn3
Copy link
Member

bjorn3 commented Jan 20, 2024

hide the linker cli args unless --verbose is passed

I prefer not doing this. It is helpful whenever a linkage issue is opened to not have to ask to rerun with RUSTFLAGS="--verbose". If you revert this change r=me. If you still want to keep it, let me thing about it for a bit.

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 30, 2024
show linker output even if the linker succeeds

- show stderr by default
- show stdout if `--verbose` is passed
- remove both from RUSTC_LOG
- hide the linker cli args unless `--verbose` is passed

fixes rust-lang#83436. fixes rust-lang#38206. fixes rust-lang#109979. helps with rust-lang#46998. cc https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/uplift.20some.20-Zverbose.20calls.20and.20rename.20to.E2.80.A6.20compiler-team.23706/near/408986134

this is based on rust-lang#119129 for convenience so i didn't have to duplicate the changes around saving `--verbose` in rust-lang@cb6d033#diff-7a49efa20548d6806dbe1c66dd4dc445fda18fcbbf1709520cadecc4841aae12

try-job: aarch64-apple

r? `@bjorn3`
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 30, 2024

💔 Test failed - checks-actions

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Dec 1, 2024

ok, the current problem is that rustc_codegen_gcc ignores RUSTFLAGS=-Alinker-messages, which results in this error:

 error: linker stderr: /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core.mini_core.e55951eb20a0121d-cgu.0.rcgu.o: relocation in read-only section `.rodata.global.c'
       /usr/bin/ld: creating DT_TEXTREL in a shared object

@antoyo how do you prefer i fix this? i can either:

  • change y.sh test to respect RUSTFLAGS, which may have other effects on your test suite
  • change y.sh test to unconditionally pass -Alinker-warnings
  • try and figure out how to fix the linker warning. i would appreciate your help with this.

@jyn514
Copy link
Member Author

jyn514 commented Dec 1, 2024

actually wait what, where is -D warnings coming from

i don't see that in the flags y.sh passes to rustc

@antoyo
Copy link
Contributor

antoyo commented Dec 1, 2024

@jyn514: You can pass the flags through CG_RUSTFLAGS.

@jyn514
Copy link
Member Author

jyn514 commented Dec 1, 2024

@rustbot ready

note that this is based off of #133633 so you may want to review that first.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 1, 2024
@bors
Copy link
Contributor

bors commented Dec 9, 2024

☔ The latest upstream changes (presumably #134052) made this pull request unmergeable. Please resolve the merge conflicts.

Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 13, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? `@bjorn3`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 13, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? ``@bjorn3``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 13, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? ```@bjorn3```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 13, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? ````@bjorn3````
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2024
don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? `@bjorn3`

try-build: dist-x86_64-linux
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 13, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? `@bjorn3`

try-build: dist-x86_64-linux
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 14, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? ``@bjorn3``

try-build: dist-x86_64-linux
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2024
don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? `@bjorn3`

try-build: i686-mingw
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 15, 2024
…jyn514

don't show the full linker args unless `--verbose` is passed

the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them.

split out from rust-lang#119286. fixes rust-lang#109979.

r? `@bjorn3`

try-build: i686-mingw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet