-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Move code in rustc_driver
out to a new rustc_driver_impl
crate to allow pipelining
#107549
Conversation
r? @Nilstrieb (rustbot has picked a reviewer for you, use r? to override) |
Do you have some benchmarks from the impact this has on rustc full and incremental compile times? |
The improvement seems to be proportional to the time it takes to compile code in |
This comment has been minimized.
This comment has been minimized.
Let's keep the crate named |
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
rustc_shared
library which contains all the rustc library crates in a single dylibrustc_driver
out to a new rustc_driver_impl
crate to allow pipelining
Yeah, that probably is the simplest option. Skip the first commit when reviewing. |
Hi Folks, just had a question relating to this and not sure where else to ask. How does rustc avoid linking this as a dynamic library? I see rustc doens't link it dynamically:
But when I try linking to rustc_driver from another project: #![feature(rustc_private)]
extern crate rustc_driver;
fn main() {
println!("Hello, world!");
} I get the following binary:
Reason I care is because having a dynamically linked |
You are likely looking at the rustup wrapper, not rustc itself. Try
Rustc is always dynamically linked. While it would technically be possible to make a statically linked version if you modify |
Thank you. That makes sense. |
@bors r+ rollup=never (want to see how this affects bootstrap times) |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (3de7d7f): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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. |
That adds a
rustc_shared
library which contains all the rustc library crates in a single dylib. It takes over this role fromrustc_driver
. This is done so thatrustc_driver
can be compiled in parallel with other crates.rustc_shared
is intentionally left empty so it only does linking.An alternative could be to move the code currently in
rustc_driver
into a new crate to avoid changing the name of the distributed library.