Skip to content

Commit 925045b

Browse files
authored
Rollup merge of rust-lang#104104 - kamirr:master, r=lcnr
Add split-debuginfo print option This option prints all supported values for `-Csplit-debuginfo=..`, i.e. only stable ones on stable/beta and all of them on nightly/dev. Motivated by 1.65.0 regression causing builds with the following entry in `Cargo.toml` to fail on Windows: ```toml [profile.dev] split-debuginfo = "unpacked" ``` See rust-lang/cargo#11347 for details. This will lead to closing rust-lang#103976.
2 parents 62dd898 + 4c3cad0 commit 925045b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

compiler/rustc_driver/src/lib.rs

+11
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,17 @@ fn print_crate_info(
736736
// Any output here interferes with Cargo's parsing of other printed output
737737
NativeStaticLibs => {}
738738
LinkArgs => {}
739+
SplitDebuginfo => {
740+
use rustc_target::spec::SplitDebuginfo::{Off, Packed, Unpacked};
741+
742+
for split in &[Off, Packed, Unpacked] {
743+
let stable = sess.target.options.supported_split_debuginfo.contains(split);
744+
let unstable_ok = sess.unstable_options();
745+
if stable || unstable_ok {
746+
println!("{}", split);
747+
}
748+
}
749+
}
739750
}
740751
}
741752
Compilation::Stop

compiler/rustc_session/src/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ pub enum PrintRequest {
548548
NativeStaticLibs,
549549
StackProtectorStrategies,
550550
LinkArgs,
551+
SplitDebuginfo,
551552
}
552553

553554
pub enum Input {
@@ -1806,6 +1807,7 @@ fn collect_print_requests(
18061807
("stack-protector-strategies", PrintRequest::StackProtectorStrategies),
18071808
("target-spec-json", PrintRequest::TargetSpec),
18081809
("link-args", PrintRequest::LinkArgs),
1810+
("split-debuginfo", PrintRequest::SplitDebuginfo),
18091811
];
18101812

18111813
prints.extend(matches.opt_strs("print").into_iter().map(|req| {
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `link-args`
1+
error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `link-args`, `split-debuginfo`
22

0 commit comments

Comments
 (0)