Skip to content

Commit

Permalink
Rollup merge of rust-lang#119298 - onur-ozkan:silence-change-tracker-…
Browse files Browse the repository at this point in the history
…warning-for-ci, r=Mark-Simulacrum

suppress change-tracker warnings in CI containers

Fixes rust-lang#119296
  • Loading branch information
fmease authored Jan 3, 2024
2 parents 49f42db + 8dd6fac commit e1f8d68
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
32 changes: 17 additions & 15 deletions src/bootstrap/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,25 +149,27 @@ fn check_version(config: &Config) -> Option<String> {

let changes = find_recent_config_change_ids(id);

if !changes.is_empty() {
msg.push_str("There have been changes to x.py since you last updated:\n");

for change in changes {
msg.push_str(&format!(" [{}] {}\n", change.severity.to_string(), change.summary));
msg.push_str(&format!(
" - PR Link https://github.com/rust-lang/rust/pull/{}\n",
change.change_id
));
}
if changes.is_empty() {
return None;
}

msg.push_str("There have been changes to x.py since you last updated:\n");

msg.push_str("NOTE: to silence this warning, ");
for change in changes {
msg.push_str(&format!(" [{}] {}\n", change.severity.to_string(), change.summary));
msg.push_str(&format!(
"update `config.toml` to use `change-id = {latest_change_id}` instead"
" - PR Link https://github.com/rust-lang/rust/pull/{}\n",
change.change_id
));
}

if io::stdout().is_terminal() && !config.dry_run() {
t!(fs::write(warned_id_path, latest_change_id.to_string()));
}
msg.push_str("NOTE: to silence this warning, ");
msg.push_str(&format!(
"update `config.toml` to use `change-id = {latest_change_id}` instead"
));

if io::stdout().is_terminal() && !config.dry_run() {
t!(fs::write(warned_id_path, latest_change_id.to_string()));
}
} else {
msg.push_str("WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.\n");
Expand Down
7 changes: 6 additions & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ source "$ci_dir/shared.sh"

export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse

# suppress change-tracker warnings on CI
if [ "$CI" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set change-id=99999999"
fi

if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch try-perf || \
isCiBranch automation/bors/try; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
Expand Down Expand Up @@ -237,7 +242,7 @@ fi

if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then
rm -f config.toml
$SRC/configure --set rust.parallel-compiler
$SRC/configure --set change-id=99999999 --set rust.parallel-compiler

# Save the build metrics before we wipe the directory
if [ "$HAS_METRICS" = 1 ]; then
Expand Down

0 comments on commit e1f8d68

Please sign in to comment.