-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fix short linker error output #143482
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
base: master
Are you sure you want to change the base?
Fix short linker error output #143482
Conversation
This PR does 2 things: - It removes the braces when there's a single element. This is required since brace expansion (at least in bash and zsh) only triggers if there's at least 2 elements. - It removes the extra `.rlib` suffixes of the elements. See rust-lang#135707 (comment) for context. Running `cargo +stage1 build` on the following program: ```rust unsafe extern "C" { fn foo() -> libc::c_int; } fn main() { let x = unsafe { foo() } as u32; // println!("{}", data_encoding::BASE64.encode(&x.to_le_bytes())); } ``` Gives the following diff before and after the PR: ```diff -/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib}.rlib +/tmp/foo/target/debug/deps/liblibc-faf416f178830595.rlib ``` Running on the same program with the additional dependency, we get the following diff: ```diff -/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib,libdata_encoding-84bb5aadfa9e8839.rlib}.rlib +/tmp/foo/target/debug/deps/{liblibc-faf416f178830595,libdata_encoding-84bb5aadfa9e8839}.rlib ``` Do we want to add a UI test?
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Some changes occurred in compiler/rustc_codegen_ssa |
We should definitely test this, but with a run-make test, probably something like the one in #135707 |
This PR modifies cc @jieyouxu |
Thanks for the link! I don't know how I missed that. I've updated the test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after nit
@bors delegate+ |
✌️ @ia0, you can now approve this pull request! If @fee1-dead told you to " |
Co-authored-by: beef <[email protected]>
@bors rollup |
Fix short linker error output This PR does 2 things: - It removes the braces when there's a single element. This is required since brace expansion (at least in bash and zsh) only triggers if there's at least 2 elements. - It removes the extra `.rlib` suffixes of the elements. See rust-lang#135707 (comment) for context. Running `cargo +stage1 build` on the following program: ```rust unsafe extern "C" { fn foo() -> libc::c_int; } fn main() { let x = unsafe { foo() } as u32; // println!("{}", data_encoding::BASE64.encode(&x.to_le_bytes())); } ``` Gives the following diff before and after the PR: ```diff -/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib}.rlib +/tmp/foo/target/debug/deps/liblibc-faf416f178830595.rlib ``` Running on the same program with the additional dependency, we get the following diff: ```diff -/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib,libdata_encoding-84bb5aadfa9e8839.rlib}.rlib +/tmp/foo/target/debug/deps/{liblibc-faf416f178830595,libdata_encoding-84bb5aadfa9e8839}.rlib ```
Rollup of 11 pull requests Successful merges: - #143130 (doc(std): clarify `NonZero<T>` usage limitation in doc comment) - #143415 (Get rid of build-powerpc64le-toolchain.sh) - #143464 (Make tests/ui/abi/debug.rs cross-compile) - #143482 (Fix short linker error output) - #143524 (Move `stable_mir` back to its own crate) - #143528 (interpret: rename StackPopCleanup) - #143551 (Dont resolve instance of root in `mir_callgraph_cyclic`) - #143558 (mbe: Refactors and function extractions in `compile_declarative_macro`) - #143563 (std: fix typo in `std::path`) - #143564 (compiler: Deduplicate `must_emit_unwind_tables()` comments) - #143577 (Disable download-rustc for library profile) r? `@ghost` `@rustbot` modify labels: rollup
This PR does 2 things:
It removes the braces when there's a single element. This is required since brace expansion (at least in bash and zsh) only triggers if there's at least 2 elements.
It removes the extra
.rlib
suffixes of the elements. See Shorten linker output even more when--verbose
is not present #135707 (comment) for context.Running
cargo +stage1 build
on the following program:Gives the following diff before and after the PR:
Running on the same program with the additional dependency, we get the following diff: