Check for nightly toolchain when enabling split debug info. - #4186
Conversation
This fixes a problem pointed out by bazelbuild#4092 (comment). `-Zsplit-dwarf-out-dir` is only available on nightly, so we have to gate split debug info on it. Also added some tests that check that we don't add the flag when using other channels.
Also provide an opt-in flag to keep the current behavior, in which `--fission=yes` enables fission for C++ targets but is silently ignored by Rust with a stable toolchain.
|
I chatted with @krasimirgg and @UebelAndre and there were some concerns that silently failing to enable fission on Rust when using a stable toolchain would cause a bad experience for people trying to debug their Rust+fission builds. So I've changed it so that |
| # `-Zsplit-dwarf-out-dir` is only available on nightly. | ||
| if toolchain.channel == "nightly": | ||
| use_split_debuginfo = True | ||
| elif toolchain._skip_fission_for_rust: |
There was a problem hiding this comment.
As a user, I'd expect that if _skip_fission_for_rust is true and toolchain.channel == "nightly", fission-for-rust is disabled... In other words, the setting takes precedence. What do you think?
This fixes a problem pointed out by
#4092 (comment).
-Zsplit-dwarf-out-diris only available on nightly, so we have to gate split debug info on it. Now, if the user requests--fissionwhile using a non-nightly Rust toolchain, the build will fail. To avoid breaking users relying on the previous behavior, askip_fission_for_rustflag has been added. Users can add it to their bazelrc file to explicitly signal that they're okay with Rust compiles not producing split debug info, even if requested in the command line.Assisted-by: Gemini