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

Shorten linker output even more when --verbose is not present #135707

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jan 18, 2025

  • Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long.
  • For .rlibs in the sysroot, replace crate hashes with a "-*" string. This will expand to the full crate name when pasted into the shell.
  • Move .rlib to outside the glob.
  • Abbreviate the sysroot path to <sysroot> wherever it appears in the arguments.

This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests.

r? @bjorn3

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc 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. labels Jan 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2025

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

Some changes occurred in src/tools/compiletest

cc @jieyouxu

The run-make-support library was changed

cc @jieyouxu

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@jyn514
Copy link
Member Author

jyn514 commented Jan 18, 2025

For comparison, this is what the error looked like before
image

and after
image

@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-messages-2 branch from f5a75ee to 89ffd82 Compare January 18, 2025 22:14
@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-messages-2 branch from 89ffd82 to 9c01e98 Compare January 18, 2025 22:33
@rustbot rustbot added the A-tidy Area: The tidy tool label Jan 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2025

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

@jyn514
Copy link
Member Author

jyn514 commented Jan 18, 2025

You must ensure that any new dependencies have compatible licenses before merging.

dual-licensed as mit and apache: /~https://github.com/BurntSushi/bstr/blob/master/Cargo.toml#L11

@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-messages-2 branch from 9c01e98 to e4dc304 Compare January 18, 2025 23:58
@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-messages-2 branch from e4dc304 to 67991b4 Compare January 19, 2025 00:12
@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-messages-2 branch from 67991b4 to ab440b5 Compare January 19, 2025 01:07
@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the linker-messages-2 branch from ab440b5 to 503b146 Compare January 19, 2025 12:54
@rust-log-analyzer

This comment has been minimized.

- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long.
- For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell.
- Move `.rlib` to outside the glob.
- Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments.

This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests.
@jyn514 jyn514 force-pushed the linker-messages-2 branch from 503b146 to 557b1f8 Compare January 19, 2025 15:27
@jyn514
Copy link
Member Author

jyn514 commented Jan 19, 2025

This is ready for review.

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-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants