Skip to content

Commit 79c02e2

Browse files
Rollup merge of #150524 - test-build-std, r=jieyouxu,kobzol
Test that -Zbuild-std=core works on a variety of profiles See [#t-infra > Non-blocking testing for -Zbuild-std?](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Non-blocking.20testing.20for.20-Zbuild-std.3F/with/565837190) for some background. This is an incredibly CPU-hungry run-make-cargo test, but at least on my desktop the entire suite only takes a minute.
2 parents 91ac254 + df386c5 commit 79c02e2

File tree

21 files changed

+192
-11
lines changed

21 files changed

+192
-11
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3337,6 +3337,7 @@ dependencies = [
33373337
"rustdoc-json-types",
33383338
"serde_json",
33393339
"similar",
3340+
"tempfile",
33403341
"wasmparser 0.236.1",
33413342
]
33423343

compiler/rustc_target/src/spec/targets/i586_unknown_redox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
1111

1212
Target {
1313
llvm_target: "i586-unknown-redox".into(),
14-
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
14+
metadata: TargetMetadata { description: None, tier: Some(3), host_tools: None, std: None },
1515
pointer_width: 32,
1616
data_layout:
1717
"e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128"

compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
llvm_target: "x86_64-unknown-linux-none".into(),
1616
metadata: TargetMetadata {
1717
description: None,
18-
tier: None,
18+
tier: Some(3),
1919
host_tools: None,
2020
std: Some(false),
2121
},

compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99
pointer_width: 32,
1010
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
1111
arch: Arch::Xtensa,
12-
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
12+
metadata: TargetMetadata { description: None, tier: Some(3), host_tools: None, std: None },
1313

1414
options: TargetOptions {
1515
endian: Endian::Little,

compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99
pointer_width: 32,
1010
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
1111
arch: Arch::Xtensa,
12-
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
12+
metadata: TargetMetadata { description: None, tier: Some(3), host_tools: None, std: None },
1313

1414
options: TargetOptions {
1515
endian: Endian::Little,

compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99
pointer_width: 32,
1010
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
1111
arch: Arch::Xtensa,
12-
metadata: TargetMetadata { description: None, tier: None, host_tools: None, std: None },
12+
metadata: TargetMetadata { description: None, tier: Some(3), host_tools: None, std: None },
1313

1414
options: TargetOptions {
1515
endian: Endian::Little,

src/bootstrap/mk/Makefile.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ check-aux:
5353
src/tools/cargotest \
5454
src/tools/test-float-parse \
5555
$(BOOTSTRAP_ARGS)
56+
# The build-std suite is off by default because it is uncommonly slow
57+
# and memory-hungry.
58+
$(Q)$(BOOTSTRAP) test --stage 2 \
59+
build-std \
60+
$(BOOTSTRAP_ARGS)
5661
# Run standard library tests in Miri.
5762
$(Q)MIRIFLAGS="-Zmiri-strict-provenance" \
5863
$(BOOTSTRAP) miri --stage 2 \

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,12 @@ test!(RunMakeCargo {
16251625
suite: "run-make-cargo",
16261626
default: true
16271627
});
1628+
test!(BuildStd {
1629+
path: "tests/build-std",
1630+
mode: CompiletestMode::RunMake,
1631+
suite: "build-std",
1632+
default: false
1633+
});
16281634

16291635
test!(AssemblyLlvm {
16301636
path: "tests/assembly-llvm",
@@ -1948,7 +1954,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
19481954
let stage0_rustc_path = builder.compiler(0, test_compiler.host);
19491955
cmd.arg("--stage0-rustc-path").arg(builder.rustc(stage0_rustc_path));
19501956

1951-
if suite == "run-make-cargo" {
1957+
if matches!(suite, "run-make-cargo" | "build-std") {
19521958
let cargo_path = if test_compiler.stage == 0 {
19531959
// If we're using `--stage 0`, we should provide the bootstrap cargo.
19541960
builder.initial_cargo.clone()

src/bootstrap/src/core/builder/cli_paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub(crate) const PATH_REMAP: &[(&str, &[&str])] = &[
2020
&[
2121
// tidy-alphabetical-start
2222
"tests/assembly-llvm",
23+
"tests/build-std",
2324
"tests/codegen-llvm",
2425
"tests/codegen-units",
2526
"tests/coverage",

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ expression: test tests
55
[Test] test::AssemblyLlvm
66
targets: [aarch64-unknown-linux-gnu]
77
- Suite(test::tests/assembly-llvm)
8+
[Test] test::BuildStd
9+
targets: [aarch64-unknown-linux-gnu]
10+
- Suite(test::tests/build-std)
811
[Test] test::CodegenLlvm
912
targets: [aarch64-unknown-linux-gnu]
1013
- Suite(test::tests/codegen-llvm)

0 commit comments

Comments
 (0)