From 0238f3ec981a6cdbd579cda053214a9d2288aaaf Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 18 Apr 2025 13:55:38 +1000 Subject: [PATCH 1/2] compiletest: Use the new non-libtest executor by default (2) (Re-landing #139998, with a compiler change to inhibit download-rustc.) Currently the new executor can be explicitly disabled by passing the `-N` flag to compiletest (e.g. `./x test ui -- -N`), but eventually that flag will be removed, alongside the removal of the libtest dependency. --- src/tools/compiletest/src/common.rs | 11 +++++++---- src/tools/compiletest/src/lib.rs | 7 ++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index b5bbe70c48ce4..e0132056d6c4a 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -414,10 +414,13 @@ pub struct Config { /// ABI tests. pub minicore_path: Utf8PathBuf, - /// If true, run tests with the "new" executor that was written to replace - /// compiletest's dependency on libtest. Eventually this will become the - /// default, and the libtest dependency will be removed. - pub new_executor: bool, + /// If true, disable the "new" executor, and use the older libtest-based + /// executor to run tests instead. This is a temporary fallback, to make + /// manual comparative testing easier if bugs are found in the new executor. + /// + /// FIXME(Zalathar): Eventually remove this flag and remove the libtest + /// dependency. + pub no_new_executor: bool, } impl Config { diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 3cf13671ef03b..0a3888a7d50ae 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -202,7 +202,7 @@ pub fn parse_config(args: Vec) -> Config { "COMMAND", ) .reqopt("", "minicore-path", "path to minicore aux library", "PATH") - .optflag("n", "new-executor", "enables the new test executor instead of using libtest") + .optflag("N", "no-new-executor", "disables the new test executor, and uses libtest instead") .optopt( "", "debugger", @@ -448,7 +448,7 @@ pub fn parse_config(args: Vec) -> Config { minicore_path: opt_path(matches, "minicore-path"), - new_executor: matches.opt_present("new-executor"), + no_new_executor: matches.opt_present("no-new-executor"), } } @@ -575,9 +575,10 @@ pub fn run_tests(config: Arc) { // Delegate to the executor to filter and run the big list of test structures // created during test discovery. When the executor decides to run a test, // it will return control to the rest of compiletest by calling `runtest::run`. - let res = if config.new_executor { + let res = if !config.no_new_executor { Ok(executor::run_tests(&config, tests)) } else { + // FIXME(Zalathar): Eventually remove the libtest executor entirely. crate::executor::libtest::execute_tests(&config, tests) }; From 1670de40e070e66e8074e1d534fd4acfa72acc39 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 25 Apr 2025 20:41:50 +1000 Subject: [PATCH 2/2] Trivial compiler change to inhibit download-rustc in CI --- compiler/rustc_mir_transform/src/coverage/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_mir_transform/src/coverage/mod.rs b/compiler/rustc_mir_transform/src/coverage/mod.rs index aa4c0ef1e1f93..5e228a56f2e0d 100644 --- a/compiler/rustc_mir_transform/src/coverage/mod.rs +++ b/compiler/rustc_mir_transform/src/coverage/mod.rs @@ -90,7 +90,7 @@ fn instrument_function_for_coverage<'tcx>(tcx: TyCtxt<'tcx>, mir_body: &mut mir: // Use the coverage graph to prepare intermediate data that will eventually // be used to assign physical counters and counter expressions to points in - // the control-flow graph + // the control-flow graph. let BcbCountersData { node_flow_data, priority_list } = counters::prepare_bcb_counters_data(&graph);