Skip to content

Commit 9133b48

Browse files
committed
Remove ability to check/build/test compiletest as stage 0 bootstrap tool
Instead, consider this as an `ToolStd` tool until `compiletest`'s dependency in the unstable `#![feature(internal_output_capture)]` is replaced by a stable implementation.
1 parent 733dab5 commit 9133b48

File tree

7 files changed

+25
-37
lines changed

7 files changed

+25
-37
lines changed

bootstrap.example.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,6 @@
465465
# What custom diff tool to use for displaying compiletest tests.
466466
#build.compiletest-diff-tool = <none>
467467

468-
# Whether to use the precompiled stage0 libtest with compiletest.
469-
#build.compiletest-use-stage0-libtest = true
470-
471468
# Default value for the `--extra-checks` flag of tidy.
472469
#
473470
# See `./x test tidy --help` for details.

src/bootstrap/defaults/bootstrap.dist.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ test-stage = 2
77
doc-stage = 2
88
# When compiling from source, you usually want all tools.
99
extended = true
10-
# Use libtest built from the source tree instead of the precompiled one from stage 0.
11-
compiletest-use-stage0-libtest = false
1210

1311
# Most users installing from source want to build all parts of the project from source.
1412
[llvm]

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ macro_rules! tool_check_step {
376376
// The part of this path after the final '/' is also used as a display name.
377377
path: $path:literal
378378
$(, alt_path: $alt_path:literal )*
379-
// Closure that returns `Mode` based on the passed `&Builder<'_>`
379+
// Under which tool mode should the tool be checked with?
380380
, mode: $mode:expr
381381
// Subset of nightly features that are allowed to be used when checking
382382
$(, allow_features: $allow_features:expr )?
@@ -404,8 +404,7 @@ macro_rules! tool_check_step {
404404

405405
fn make_run(run: RunConfig<'_>) {
406406
let target = run.target;
407-
let builder = run.builder;
408-
let mode = $mode(builder);
407+
let mode = $mode;
409408

410409
let build_compiler = prepare_compiler_for_check(run.builder, target, mode);
411410

@@ -426,7 +425,7 @@ macro_rules! tool_check_step {
426425
_value
427426
};
428427
let extra_features: &[&str] = &[$($($enable_features),*)?];
429-
let mode = $mode(builder);
428+
let mode = $mode;
430429
run_tool_check_step(builder, build_compiler, target, $path, mode, allow_features, extra_features);
431430
}
432431

@@ -493,66 +492,61 @@ fn run_tool_check_step(
493492
tool_check_step!(Rustdoc {
494493
path: "src/tools/rustdoc",
495494
alt_path: "src/librustdoc",
496-
mode: |_builder| Mode::ToolRustc
495+
mode: Mode::ToolRustc
497496
});
498497
// Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead
499498
// of a submodule. Since the SourceType only drives the deny-warnings
500499
// behavior, treat it as in-tree so that any new warnings in clippy will be
501500
// rejected.
502-
tool_check_step!(Clippy { path: "src/tools/clippy", mode: |_builder| Mode::ToolRustc });
503-
tool_check_step!(Miri { path: "src/tools/miri", mode: |_builder| Mode::ToolRustc });
504-
tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri", mode: |_builder| Mode::ToolRustc });
505-
tool_check_step!(Rustfmt { path: "src/tools/rustfmt", mode: |_builder| Mode::ToolRustc });
501+
tool_check_step!(Clippy { path: "src/tools/clippy", mode: Mode::ToolRustc });
502+
tool_check_step!(Miri { path: "src/tools/miri", mode: Mode::ToolRustc });
503+
tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri", mode: Mode::ToolRustc });
504+
tool_check_step!(Rustfmt { path: "src/tools/rustfmt", mode: Mode::ToolRustc });
506505
tool_check_step!(RustAnalyzer {
507506
path: "src/tools/rust-analyzer",
508-
mode: |_builder| Mode::ToolRustc,
507+
mode: Mode::ToolRustc,
509508
allow_features: tool::RustAnalyzer::ALLOW_FEATURES,
510509
enable_features: ["in-rust-tree"],
511510
});
512511
tool_check_step!(MiroptTestTools {
513512
path: "src/tools/miropt-test-tools",
514-
mode: |_builder| Mode::ToolBootstrap
513+
mode: Mode::ToolBootstrap
515514
});
516515
// We want to test the local std
517516
tool_check_step!(TestFloatParse {
518517
path: "src/tools/test-float-parse",
519-
mode: |_builder| Mode::ToolStd,
518+
mode: Mode::ToolStd,
520519
allow_features: tool::TestFloatParse::ALLOW_FEATURES
521520
});
522521
tool_check_step!(FeaturesStatusDump {
523522
path: "src/tools/features-status-dump",
524-
mode: |_builder| Mode::ToolBootstrap
523+
mode: Mode::ToolBootstrap
525524
});
526525

527-
tool_check_step!(Bootstrap {
528-
path: "src/bootstrap",
529-
mode: |_builder| Mode::ToolBootstrap,
530-
default: false
531-
});
526+
tool_check_step!(Bootstrap { path: "src/bootstrap", mode: Mode::ToolBootstrap, default: false });
532527

533528
// `run-make-support` will be built as part of suitable run-make compiletest test steps, but support
534529
// check to make it easier to work on.
535530
tool_check_step!(RunMakeSupport {
536531
path: "src/tools/run-make-support",
537-
mode: |_builder| Mode::ToolBootstrap,
532+
mode: Mode::ToolBootstrap,
538533
default: false
539534
});
540535

541536
tool_check_step!(CoverageDump {
542537
path: "src/tools/coverage-dump",
543-
mode: |_builder| Mode::ToolBootstrap,
538+
mode: Mode::ToolBootstrap,
544539
default: false
545540
});
546541

547542
// Compiletest is implicitly "checked" when it gets built in order to run tests,
548543
// so this is mainly for people working on compiletest to run locally.
549544
tool_check_step!(Compiletest {
550545
path: "src/tools/compiletest",
551-
mode: |builder: &Builder<'_>| if builder.config.compiletest_use_stage0_libtest {
552-
Mode::ToolBootstrap
553-
} else {
554-
Mode::ToolStd
555-
},
546+
// Note: compiletest currently still depends on `#![feature(internal_output_capture)]`, so
547+
// should be considered a `ToolStd` tool for robustness, as it is *possible* for that internal
548+
// library feature to be changed.
549+
mode: Mode::ToolStd,
556550
allow_features: COMPILETEST_ALLOW_FEATURES,
557551
default: false,
558552
});

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,12 @@ macro_rules! bootstrap_tool {
491491
)*
492492

493493
let is_unstable = false $(|| $unstable)*;
494-
let compiletest_wants_stage0 = $tool_name == "compiletest" && builder.config.compiletest_use_stage0_libtest;
495494

496495
builder.ensure(ToolBuild {
497496
build_compiler: self.compiler,
498497
target: self.target,
499498
tool: $tool_name,
500-
mode: if is_unstable && !compiletest_wants_stage0 {
499+
mode: if is_unstable {
501500
// use in-tree libraries for unstable features
502501
Mode::ToolStd
503502
} else {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ pub struct Config {
296296
/// Command for visual diff display, e.g. `diff-tool --color=always`.
297297
pub compiletest_diff_tool: Option<String>,
298298

299-
/// Whether to use the precompiled stage0 libtest with compiletest.
300-
pub compiletest_use_stage0_libtest: bool,
301299
/// Default value for `--extra-checks`
302300
pub tidy_extra_checks: Option<String>,
303301
pub is_running_on_ci: bool,
@@ -747,7 +745,6 @@ impl Config {
747745
optimized_compiler_builtins,
748746
jobs,
749747
compiletest_diff_tool,
750-
compiletest_use_stage0_libtest,
751748
tidy_extra_checks,
752749
ccache,
753750
exclude,
@@ -1013,7 +1010,6 @@ impl Config {
10131010
config.optimized_compiler_builtins =
10141011
optimized_compiler_builtins.unwrap_or(config.channel != "dev");
10151012
config.compiletest_diff_tool = compiletest_diff_tool;
1016-
config.compiletest_use_stage0_libtest = compiletest_use_stage0_libtest.unwrap_or(true);
10171013
config.tidy_extra_checks = tidy_extra_checks;
10181014

10191015
let download_rustc = config.download_rustc_commit.is_some();

src/bootstrap/src/core/config/toml/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ define_config! {
6868
optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
6969
jobs: Option<u32> = "jobs",
7070
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
71-
compiletest_use_stage0_libtest: Option<bool> = "compiletest-use-stage0-libtest",
7271
tidy_extra_checks: Option<String> = "tidy-extra-checks",
7372
ccache: Option<StringOrBool> = "ccache",
7473
exclude: Option<Vec<PathBuf>> = "exclude",

src/bootstrap/src/utils/change_tracker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,4 +486,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
486486
severity: ChangeSeverity::Warning,
487487
summary: "Removed `rust.description` and `llvm.ccache` as it was deprecated in #137723 and #136941 long time ago.",
488488
},
489+
ChangeInfo {
490+
change_id: 999999,
491+
severity: ChangeSeverity::Warning,
492+
summary: "Removed `build.compiletest-use-stage0-libtest` as `compiletest` no longer uses libtest executor",
493+
},
489494
];

0 commit comments

Comments
 (0)