Skip to content

Commit f00e4c9

Browse files
committed
bootstrap: add build.tidy-extra-checks option
1 parent 7ba34c7 commit f00e4c9

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

bootstrap.example.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,15 @@
467467
# Whether to use the precompiled stage0 libtest with compiletest.
468468
#build.compiletest-use-stage0-libtest = true
469469

470+
# Default value for the `--extra-checks` flag of tidy.
471+
#
472+
# See `./x test tidy --help` for details.
473+
#
474+
# Note that if any value is manually given to bootstrap such as
475+
# `./x test tidy --extra-checks=js`, this value is ignored.
476+
# Use `--extra-checks=''` to temporarily disable all extra checks.
477+
#build.tidy-extra-checks = ""
478+
470479
# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).
471480
# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use
472481
# a specific version.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,9 @@ impl Step for Tidy {
11081108
if builder.config.cmd.bless() {
11091109
cmd.arg("--bless");
11101110
}
1111-
if let Some(s) = builder.config.cmd.extra_checks() {
1111+
if let Some(s) =
1112+
builder.config.cmd.extra_checks().or(builder.config.tidy_extra_checks.as_deref())
1113+
{
11121114
cmd.arg(format!("--extra-checks={s}"));
11131115
}
11141116
let mut args = std::env::args_os();

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ pub struct Config {
297297

298298
/// Whether to use the precompiled stage0 libtest with compiletest.
299299
pub compiletest_use_stage0_libtest: bool,
300-
300+
/// Default value for `--extra-checks`
301+
pub tidy_extra_checks: Option<String>,
301302
pub is_running_on_ci: bool,
302303

303304
/// Cache for determining path modifications
@@ -744,6 +745,7 @@ impl Config {
744745
jobs,
745746
compiletest_diff_tool,
746747
compiletest_use_stage0_libtest,
748+
tidy_extra_checks,
747749
mut ccache,
748750
exclude,
749751
} = toml.build.unwrap_or_default();
@@ -1012,6 +1014,7 @@ impl Config {
10121014
optimized_compiler_builtins.unwrap_or(config.channel != "dev");
10131015
config.compiletest_diff_tool = compiletest_diff_tool;
10141016
config.compiletest_use_stage0_libtest = compiletest_use_stage0_libtest.unwrap_or(true);
1017+
config.tidy_extra_checks = tidy_extra_checks;
10151018

10161019
let download_rustc = config.download_rustc_commit.is_some();
10171020
config.explicit_stage_from_cli = flags_stage.is_some();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ define_config! {
6969
jobs: Option<u32> = "jobs",
7070
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
7171
compiletest_use_stage0_libtest: Option<bool> = "compiletest-use-stage0-libtest",
72+
tidy_extra_checks: Option<String> = "tidy-extra-checks",
7273
ccache: Option<StringOrBool> = "ccache",
7374
exclude: Option<Vec<PathBuf>> = "exclude",
7475
}

0 commit comments

Comments
 (0)