bootstrap: add build.tidy-extra-checks option

This commit is contained in:
binarycat
2025-06-30 12:12:58 -05:00
parent b94bd12401
commit 90b2d24692
4 changed files with 17 additions and 2 deletions

View File

@@ -467,6 +467,15 @@
# Whether to use the precompiled stage0 libtest with compiletest.
#build.compiletest-use-stage0-libtest = true
# Default value for the `--extra-checks` flag of tidy.
#
# See `./x test tidy --help` for details.
#
# Note that if any value is manually given to bootstrap such as
# `./x test tidy --extra-checks=js`, this value is ignored.
# Use `--extra-checks=''` to temporarily disable all extra checks.
#build.tidy-extra-checks = ""
# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).
# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use
# a specific version.

View File

@@ -1108,7 +1108,9 @@ impl Step for Tidy {
if builder.config.cmd.bless() {
cmd.arg("--bless");
}
if let Some(s) = builder.config.cmd.extra_checks() {
if let Some(s) =
builder.config.cmd.extra_checks().or(builder.config.tidy_extra_checks.as_deref())
{
cmd.arg(format!("--extra-checks={s}"));
}
let mut args = std::env::args_os();

View File

@@ -297,7 +297,8 @@ pub struct Config {
/// Whether to use the precompiled stage0 libtest with compiletest.
pub compiletest_use_stage0_libtest: bool,
/// Default value for `--extra-checks`
pub tidy_extra_checks: Option<String>,
pub is_running_on_ci: bool,
/// Cache for determining path modifications
@@ -744,6 +745,7 @@ impl Config {
jobs,
compiletest_diff_tool,
compiletest_use_stage0_libtest,
tidy_extra_checks,
mut ccache,
exclude,
} = toml.build.unwrap_or_default();
@@ -1010,6 +1012,7 @@ impl Config {
optimized_compiler_builtins.unwrap_or(config.channel != "dev");
config.compiletest_diff_tool = compiletest_diff_tool;
config.compiletest_use_stage0_libtest = compiletest_use_stage0_libtest.unwrap_or(true);
config.tidy_extra_checks = tidy_extra_checks;
let download_rustc = config.download_rustc_commit.is_some();
config.explicit_stage_from_cli = flags_stage.is_some();

View File

@@ -69,6 +69,7 @@ define_config! {
jobs: Option<u32> = "jobs",
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
compiletest_use_stage0_libtest: Option<bool> = "compiletest-use-stage0-libtest",
tidy_extra_checks: Option<String> = "tidy-extra-checks",
ccache: Option<StringOrBool> = "ccache",
exclude: Option<Vec<PathBuf>> = "exclude",
}