Skip to content

Commit a60ff62

Browse files
committed
Auto merge of rust-lang#122289 - matthiaskrgr:rollup-uik3gaz, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang#121573 (unix_sigpipe: Add test for SIGPIPE disposition in child processes) - rust-lang#121754 ([bootstrap] Move the `split-debuginfo` setting to the per-target section) - rust-lang#122205 (ensure that sysroot is properly set for cross-targets) - rust-lang#122257 (mir-opt tests: don't run a different set on --bless; enable --keep-stage-std) - rust-lang#122272 (Subtree update of `rust-analyzer`) Failed merges: - rust-lang#122108 (Add `target.*.runner` configuration for targets) r? `@ghost` `@rustbot` modify labels: rollup
2 parents cdb775c + 3aa6594 commit a60ff62

File tree

196 files changed

+4878
-2374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+4878
-2374
lines changed

config.example.toml

+26-14
Original file line numberDiff line numberDiff line change
@@ -543,23 +543,15 @@
543543
# FIXME(#61117): Some tests fail when this option is enabled.
544544
#debuginfo-level-tests = 0
545545

546-
# Should rustc be build with split debuginfo? Default is platform dependent.
547-
# Valid values are the same as those accepted by `-C split-debuginfo`
548-
# (`off`/`unpacked`/`packed`).
546+
# Should rustc and the standard library be built with split debuginfo? Default
547+
# is platform dependent.
549548
#
550-
# On Linux, split debuginfo is disabled by default.
549+
# This field is deprecated, use `target.<triple>.split-debuginfo` instead.
551550
#
552-
# On Apple platforms, unpacked split debuginfo is used by default. Unpacked
553-
# debuginfo does not run `dsymutil`, which packages debuginfo from disparate
554-
# object files into a single `.dSYM` file. `dsymutil` adds time to builds for
555-
# no clear benefit, and also makes it more difficult for debuggers to find
556-
# debug info. The compiler currently defaults to running `dsymutil` to preserve
557-
# its historical default, but when compiling the compiler itself, we skip it by
558-
# default since we know it's safe to do so in that case.
551+
# The value specified here is only used when targeting the `build.build` triple,
552+
# and is overridden by `target.<triple>.split-debuginfo` if specified.
559553
#
560-
# On Windows platforms, packed debuginfo is the only supported option,
561-
# producing a `.pdb` file.
562-
#split-debuginfo = if linux { off } else if windows { packed } else if apple { unpacked }
554+
#split-debuginfo = see target.<triple>.split-debuginfo
563555

564556
# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
565557
#backtrace = true
@@ -769,6 +761,26 @@
769761
# Setting this will override the `use-lld` option for Rust code when targeting MSVC.
770762
#linker = "cc" (path)
771763

764+
# Should rustc and the standard library be built with split debuginfo? Default
765+
# is platform dependent.
766+
#
767+
# Valid values are the same as those accepted by `-C split-debuginfo`
768+
# (`off`/`unpacked`/`packed`).
769+
#
770+
# On Linux, split debuginfo is disabled by default.
771+
#
772+
# On Apple platforms, unpacked split debuginfo is used by default. Unpacked
773+
# debuginfo does not run `dsymutil`, which packages debuginfo from disparate
774+
# object files into a single `.dSYM` file. `dsymutil` adds time to builds for
775+
# no clear benefit, and also makes it more difficult for debuggers to find
776+
# debug info. The compiler currently defaults to running `dsymutil` to preserve
777+
# its historical default, but when compiling the compiler itself, we skip it by
778+
# default since we know it's safe to do so in that case.
779+
#
780+
# On Windows platforms, packed debuginfo is the only supported option,
781+
# producing a `.pdb` file.
782+
#split-debuginfo = if linux { off } else if windows { packed } else if apple { unpacked }
783+
772784
# Path to the `llvm-config` binary of the installation of a custom LLVM to link
773785
# against. Note that if this is specified we don't compile LLVM at all for this
774786
# target.

src/bootstrap/src/core/build_steps/test.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ impl Step for MirOpt {
15481548
})
15491549
};
15501550

1551-
if builder.config.cmd.bless() {
1551+
if builder.config.keep_stage_std.is_empty() {
15521552
// All that we really need to do is cover all combinations of 32/64-bit and unwind/abort,
15531553
// but while we're at it we might as well flex our cross-compilation support. This
15541554
// selection covers all our tier 1 operating systems and architectures using only tier
@@ -1567,6 +1567,7 @@ impl Step for MirOpt {
15671567
run(panic_abort_target);
15681568
}
15691569
} else {
1570+
// If we're keeping a std stage, only run tests for this target.
15701571
run(self.target);
15711572
}
15721573
}
@@ -2580,6 +2581,12 @@ impl Step for Crate {
25802581
// we're working with automatically.
25812582
let compiler = builder.compiler_for(compiler.stage, compiler.host, target);
25822583

2584+
// During cross compilations, sysroot for the target may not be available.
2585+
// Ensure that it is prepared.
2586+
if builder.config.build != target {
2587+
builder.ensure(compile::Rustc::new(compiler, target));
2588+
}
2589+
25832590
let mut cargo = builder::Cargo::new(
25842591
builder,
25852592
compiler,

src/bootstrap/src/core/builder.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1730,15 +1730,16 @@ impl<'a> Builder<'a> {
17301730
},
17311731
);
17321732

1733+
let split_debuginfo = self.config.split_debuginfo(target);
17331734
let split_debuginfo_is_stable = target.contains("linux")
17341735
|| target.contains("apple")
1735-
|| (target.is_msvc() && self.config.rust_split_debuginfo == SplitDebuginfo::Packed)
1736-
|| (target.is_windows() && self.config.rust_split_debuginfo == SplitDebuginfo::Off);
1736+
|| (target.is_msvc() && split_debuginfo == SplitDebuginfo::Packed)
1737+
|| (target.is_windows() && split_debuginfo == SplitDebuginfo::Off);
17371738

17381739
if !split_debuginfo_is_stable {
17391740
rustflags.arg("-Zunstable-options");
17401741
}
1741-
match self.config.rust_split_debuginfo {
1742+
match split_debuginfo {
17421743
SplitDebuginfo::Packed => rustflags.arg("-Csplit-debuginfo=packed"),
17431744
SplitDebuginfo::Unpacked => rustflags.arg("-Csplit-debuginfo=unpacked"),
17441745
SplitDebuginfo::Off => rustflags.arg("-Csplit-debuginfo=off"),

src/bootstrap/src/core/config/config.rs

+34-8
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ pub struct Config {
255255
pub rust_debuginfo_level_std: DebuginfoLevel,
256256
pub rust_debuginfo_level_tools: DebuginfoLevel,
257257
pub rust_debuginfo_level_tests: DebuginfoLevel,
258-
pub rust_split_debuginfo: SplitDebuginfo,
258+
pub rust_split_debuginfo_for_build_triple: Option<SplitDebuginfo>, // FIXME: Deprecated field. Remove in Q3'24.
259259
pub rust_rpath: bool,
260260
pub rust_strip: bool,
261261
pub rust_frame_pointers: bool,
@@ -573,6 +573,7 @@ pub struct Target {
573573
pub ranlib: Option<PathBuf>,
574574
pub default_linker: Option<PathBuf>,
575575
pub linker: Option<PathBuf>,
576+
pub split_debuginfo: Option<SplitDebuginfo>,
576577
pub sanitizers: Option<bool>,
577578
pub profiler: Option<StringOrBool>,
578579
pub rpath: Option<bool>,
@@ -1130,6 +1131,7 @@ define_config! {
11301131
ranlib: Option<String> = "ranlib",
11311132
default_linker: Option<PathBuf> = "default-linker",
11321133
linker: Option<String> = "linker",
1134+
split_debuginfo: Option<String> = "split-debuginfo",
11331135
llvm_config: Option<String> = "llvm-config",
11341136
llvm_has_rust_patches: Option<bool> = "llvm-has-rust-patches",
11351137
llvm_filecheck: Option<String> = "llvm-filecheck",
@@ -1622,11 +1624,18 @@ impl Config {
16221624
debuginfo_level_tools = debuginfo_level_tools_toml;
16231625
debuginfo_level_tests = debuginfo_level_tests_toml;
16241626

1625-
config.rust_split_debuginfo = split_debuginfo
1627+
config.rust_split_debuginfo_for_build_triple = split_debuginfo
16261628
.as_deref()
16271629
.map(SplitDebuginfo::from_str)
1628-
.map(|v| v.expect("invalid value for rust.split_debuginfo"))
1629-
.unwrap_or(SplitDebuginfo::default_for_platform(config.build));
1630+
.map(|v| v.expect("invalid value for rust.split-debuginfo"));
1631+
1632+
if config.rust_split_debuginfo_for_build_triple.is_some() {
1633+
println!(
1634+
"WARNING: specifying `rust.split-debuginfo` is deprecated, use `target.{}.split-debuginfo` instead",
1635+
config.build
1636+
);
1637+
}
1638+
16301639
optimize = optimize_toml;
16311640
omit_git_hash = omit_git_hash_toml;
16321641
config.rust_new_symbol_mangling = new_symbol_mangling;
@@ -1847,10 +1856,11 @@ impl Config {
18471856
if let Some(ref s) = cfg.llvm_filecheck {
18481857
target.llvm_filecheck = Some(config.src.join(s));
18491858
}
1850-
target.llvm_libunwind = cfg
1851-
.llvm_libunwind
1852-
.as_ref()
1853-
.map(|v| v.parse().expect("failed to parse rust.llvm-libunwind"));
1859+
target.llvm_libunwind = cfg.llvm_libunwind.as_ref().map(|v| {
1860+
v.parse().unwrap_or_else(|_| {
1861+
panic!("failed to parse target.{triple}.llvm-libunwind")
1862+
})
1863+
});
18541864
if let Some(s) = cfg.no_std {
18551865
target.no_std = s;
18561866
}
@@ -1886,6 +1896,12 @@ impl Config {
18861896
}).collect());
18871897
}
18881898

1899+
target.split_debuginfo = cfg.split_debuginfo.as_ref().map(|v| {
1900+
v.parse().unwrap_or_else(|_| {
1901+
panic!("invalid value for target.{triple}.split-debuginfo")
1902+
})
1903+
});
1904+
18891905
config.target_config.insert(TargetSelection::from_user(&triple), target);
18901906
}
18911907
}
@@ -2284,6 +2300,16 @@ impl Config {
22842300
})
22852301
}
22862302

2303+
pub fn split_debuginfo(&self, target: TargetSelection) -> SplitDebuginfo {
2304+
self.target_config
2305+
.get(&target)
2306+
.and_then(|t| t.split_debuginfo)
2307+
.or_else(|| {
2308+
if self.build == target { self.rust_split_debuginfo_for_build_triple } else { None }
2309+
})
2310+
.unwrap_or_else(|| SplitDebuginfo::default_for_platform(target))
2311+
}
2312+
22872313
pub fn submodules(&self, rust_info: &GitInfo) -> bool {
22882314
self.submodules.unwrap_or(rust_info.is_managed_git_subrepository())
22892315
}

src/bootstrap/src/utils/change_tracker.rs

+5
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
141141
severity: ChangeSeverity::Info,
142142
summary: "A new `boostrap-cache-path` option has been introduced which can be utilized to modify the cache path for bootstrap.",
143143
},
144+
ChangeInfo {
145+
change_id: 121754,
146+
severity: ChangeSeverity::Warning,
147+
summary: "`rust.split-debuginfo` has been moved to `target.<triple>.split-debuginfo` and its default value is determined for each target individually.",
148+
},
144149
];

src/tools/rust-analyzer/.cargo/config.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ xtask = "run --package xtask --bin xtask --"
33
tq = "test -- -q"
44
qt = "tq"
55
lint = "clippy --all-targets -- --cap-lints warn"
6+
codegen = "run --package xtask --bin xtask -- codegen"
67

78
[target.x86_64-pc-windows-msvc]
89
linker = "rust-lld"

src/tools/rust-analyzer/.github/workflows/ci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ jobs:
7979
if: matrix.os == 'ubuntu-latest'
8080
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
8181

82+
- name: Codegen checks (rust-analyzer)
83+
run: cargo codegen --check
84+
8285
- name: Compile (tests)
8386
run: cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
8487

src/tools/rust-analyzer/.typos.toml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ extend-exclude = [
55
"crates/parser/test_data/lexer/err/",
66
"crates/project-model/test_data/",
77
]
8-
ignore-hidden = false
98

109
[default]
1110
extend-ignore-re = [

0 commit comments

Comments
 (0)