diff options
| author | Augie Fackler <augie@google.com> | 2025-03-06 22:10:42 -0500 |
|---|---|---|
| committer | Augie Fackler <augie@google.com> | 2025-09-26 13:34:40 -0400 |
| commit | 77c6acc74ecd44ba7eb5a73c934dffdff7340133 (patch) | |
| tree | bb24b487c619ebd5696956e72d8876f6f4acedcf /compiler/rustc_interface | |
| parent | a8858111044a9391ac7558f969d3bf62ef43222d (diff) | |
| download | rust-77c6acc74ecd44ba7eb5a73c934dffdff7340133.tar.gz rust-77c6acc74ecd44ba7eb5a73c934dffdff7340133.zip | |
debuginfo: add an unstable flag to write split DWARF to an explicit directory
Bazel requires knowledge of outputs from actions at analysis time, including file or directory name. In order to work around the lack of predictable output name for dwo files, we group the dwo files in a subdirectory of --out-dir as a post-processing step before returning control to bazel. Unfortunately some debugging workflows rely on directly opening the dwo file rather than loading the merged dwp file, and our trick of moving the files breaks those users. We can't just hardlink the file or copy it, because with remote build execution we wouldn't end up with the un-moved file copied back to the developer's workstation. As a fix, we add this unstable flag that causes dwo files to be written to a build-system-controllable location, which then lets bazel hoover up the dwo files, but the objects also have the correct path for the dwo files.
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index 76ccd12797e..58ec72b5b45 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -542,6 +542,7 @@ pub fn build_output_filenames(attrs: &[ast::Attribute], sess: &Session) -> Outpu stem, None, sess.io.temps_dir.clone(), + sess.opts.unstable_opts.split_dwarf_out_dir.clone(), sess.opts.cg.extra_filename.clone(), sess.opts.output_types.clone(), ) @@ -571,6 +572,7 @@ pub fn build_output_filenames(attrs: &[ast::Attribute], sess: &Session) -> Outpu out_filestem, ofile, sess.io.temps_dir.clone(), + sess.opts.unstable_opts.split_dwarf_out_dir.clone(), sess.opts.cg.extra_filename.clone(), sess.opts.output_types.clone(), ) |
