Skip to content

bootstrap: add build.tidy-extra-checks option #143251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/config/toml/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "`llvm.lld` is no longer enabled by default for the dist profile.",
},
ChangeInfo {
change_id: 143251,
severity: ChangeSeverity::Info,
summary: "Added new option `build.tidy-extra-checks` to specify a default value for the --extra-checks cli flag.",
},
];
Loading