-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
incr: cache dwarf objects in work products #98901
Conversation
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
7563854
to
2d4f865
Compare
Looks good, @davidtwco! Now we just need a regression test. Compiling twice with |
// Check that compiling with packed Split DWARF twice succeeds. This should confirm that DWARF
// objects are cached as work products and available to the incremental compilation for `thorin` to
// pack into a DWARF package.
// ignore-tidy-linelength
// only-x86_64-unknown-linux-gnu
// revisions:rpass1 rpass2
// [rpass1]compile-flags: -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split
// [rpass2]compile-flags: -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split
#![feature(rustc_attrs)]
// For `rpass2`, nothing has changed so everything should re-used.
#![rustc_partition_reused(module = "split_debuginfo_cached", cfg = "rpass2")]
#![rustc_partition_reused(module = "split_debuginfo_cached-another_module", cfg = "rpass2")]
mod another_module {
pub fn foo() -> &'static str {
"hello world"
}
}
pub fn main() {
println!("{}", another_module::foo());
}
Nevermind, figured it out, just being stupid - will have a commit up shortly. |
Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios. Signed-off-by: David Wood <david.wood@huawei.com>
Compiling with `-Csplit-debuginfo=packed` was leaving behind `.dwo` files because either the metadata or allocator module contained a DWARF object which was not being removed by the `maybe_remove_temps_from_module` closure.
This should have been here from the start... oops. When `thorin` fails to package a DWARF package, that should fail compilation.
2d4f865
to
e106523
Compare
Okay, added a test now. I lost some time to a missing I also noticed that we weren't deleting all the DWARF object temporaries in some cases, so I fixed that - we weren't deleting |
Great, thanks a lot, @davidtwco! @bors r+ |
📌 Commit e106523 has been approved by |
…uct, r=michaelwoerister incr: cache dwarf objects in work products Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios. r? `@michaelwoerister`
…uct, r=michaelwoerister incr: cache dwarf objects in work products Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios. r? ``@michaelwoerister``
Rollup of 8 pull requests Successful merges: - rust-lang#96856 (Fix ProjectionElem validation) - rust-lang#97711 (Improve soundness of rustc_arena) - rust-lang#98507 (Finishing touches for `#[expect]` (RFC 2383)) - rust-lang#98692 (rustdoc: Cleanup more FIXMEs) - rust-lang#98901 (incr: cache dwarf objects in work products) - rust-lang#98930 (Make MIR basic blocks field public) - rust-lang#98973 (Remove (unused) inherent impl anchors) - rust-lang#98981 ( Edit `rustc_mir_dataflow::framework` documentation ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios.
r? @michaelwoerister