Skip to content

Commit

Permalink
Unrolled build for rust-lang#120083
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#120083 - Zalathar:no-profiler, r=wesleywiser

Warn when not having a profiler runtime means that coverage tests won't be run/blessed

On a few occasions (e.g. rust-lang#118036, rust-lang#119984) people have been tripped up by the fact that half of the coverage test suite is skipped by default, because it `// needs-profiler-support` and the profiler runtime is not actually built in any of the default config profiles.

(This is made worse by the fact that it isn't enabled in any of the PR CI jobs either. So people think that they've successfully blessed the test suite, and then get a rude surprise when their merge only fails in the full CI job suite.)

This PR adds a simple warning to compiletest that should alert the user in some cases. It's not foolproof, but it should increase the chances of catching this problem earlier in the PR process.
  • Loading branch information
rust-timer authored Jan 19, 2024
2 parents 92d7277 + 0373ce6 commit b85df77
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ fn main() {
eprintln!("warning: `tidy` is not installed; diffs will not be generated");
}

if !config.profiler_support && config.mode == Mode::CoverageRun {
let actioned = if config.bless { "blessed" } else { "checked" };
eprintln!(
r#"
WARNING: profiler runtime is not available, so `.coverage` files won't be {actioned}
help: try setting `profiler = true` in the `[build]` section of `config.toml`"#
);
}

log_config(&config);
run_tests(config);
}

0 comments on commit b85df77

Please sign in to comment.