-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Only include metadata for non-dynamic libraries in rustc-dev #105609
Conversation
r? @jyn514 (rustbot has picked a reviewer for you, use r? to override) |
@bors try |
⌛ Trying commit 1103d021d3c253ab0885497995fb4d9c06d3eb96 with merge 143447c08dc7c029d9b9f4c5905aabb7aa218e68... |
💔 Test failed - checks-actions |
@bors try |
⌛ Trying commit 6662d1eb4992f351ab434dc52eb9be245d366bbf with merge 68167fc36cc9c280dd8942dc97107334abaee4aa... |
💔 Test failed - checks-actions |
@bors try |
⌛ Trying commit 61bc7a640cc5b2f0bbe55274910419c3cdb37ab0 with merge 6d5b237d87d74959bd7608dfc370ef9feda36b2c... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Works as intended. It cuts both download and disk size in half. Before
After
|
This comment has been minimized.
This comment has been minimized.
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
@rustbot ready |
The Miri subtree was changed cc @rust-lang/miri |
The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage.
c098a8b
to
8c000a6
Compare
Done. There is a CI failure that doesn't make any sense though. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3b1c8a9): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
For anyone landing here with an error like this: error: crate `rustc_ast_pretty` required to be available in rlib format, but was not found in this form
|
= help: try adding `extern crate rustc_driver;` at the top level of this crate If you add error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustcJ6ZtcA/symbols.o" "target/debug/deps/foo-71b8be8abb28cf36.y793e40jtmbzz9q.rcgu.o" "-Wl,--as-needed" "-L" "target/debug/deps" "-L" ".rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-L" ".rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-lrustc_driver-eaaa85fc498d717c" "-L" ".rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-62c4894b82797b30" "-Wl,-Bstatic" ".rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-66b9c3ae5ff29c13.rlib" "-Wl,-Bdynamic" "-lLLVM-15-rust-1.68.0-nightly" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" ".rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
= note: /usr/bin/ld: cannot find -lLLVM-15-rust-1.68.0-nightly: No such file or directory
collect2: error: ld returned 1 exit status then you need to do |
Only include metadata for non-dynamic libraries in rustc-dev The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage. Fixes rust-lang#103538
Reading this [rust-issue] it seems that we have to link against rustc_driver. The [clippy.nix] expression already does something similar Of the 4 executables found in the result of building rustfmt only rustfmt and git-rustfmt needed to be linked. The other worked without linking to rustc_driver. [rust-issue]: rust-lang/rust#105609 [clippy.nix]: https://github.com/NixOS/nixpkgs/blob/c8cf570dae9b41f30395b71f9b432418b4ff0ebc/pkgs/development/compilers/rust/clippy.nix#L27-L36
Reading this [rust-issue] it seems that we have to link against rustc_driver. The [clippy.nix] expression already does something similar Of the 4 executables found in the result of building rustfmt only rustfmt and git-rustfmt needed to be linked. The other worked without linking to rustc_driver. [rust-issue]: rust-lang/rust#105609 [clippy.nix]: https://github.com/NixOS/nixpkgs/blob/c8cf570dae9b41f30395b71f9b432418b4ff0ebc/pkgs/development/compilers/rust/clippy.nix#L27-L36
The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage.
Fixes #103538