From c99f1b7413e8abccc07197838aafda6ce3788e26 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 14 Dec 2022 12:46:47 -0600 Subject: [PATCH 1/2] Run `x test tidy` sooner in mingw-check It takes less time to run than the other tests and is more likely to fail. `expand-yaml-anchors` is still run first to make sure the CI files are internally consistent. --- src/ci/docker/host-x86_64/mingw-check/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile index 40caa7c50135d..720c5c4939482 100644 --- a/src/ci/docker/host-x86_64/mingw-check/Dockerfile +++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile @@ -40,10 +40,10 @@ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/ ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1 ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \ + python3 ../x.py test --stage 0 src/tools/tidy && \ python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu --all-targets && \ python3 ../x.py build --stage 0 src/tools/build-manifest && \ python3 ../x.py test --stage 0 src/tools/compiletest && \ - python3 ../x.py test --stage 2 src/tools/tidy && \ python3 ../x.py test --stage 0 core alloc std test proc_macro && \ # Build both public and internal documentation. RUSTDOCFLAGS="--document-private-items" python3 ../x.py doc --stage 0 library/test && \ From b8a84c2c53328757b407829da3049c6baa049a0e Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 14 Dec 2022 13:48:44 -0600 Subject: [PATCH 2/2] Make `RUN_CHECK_WITH_PARALLEL_QUERIES` the last thing to run This takes a long time and rarely fails. It also interferes with `retry make prepare`, the retry is unhelpful since `make prepare` turns into a no-op --- src/bootstrap/config.rs | 1 + src/ci/run.sh | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 960fbdf753804..2906616ffad14 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -638,6 +638,7 @@ define_config! { dist_stage: Option = "dist-stage", bench_stage: Option = "bench-stage", patch_binaries_for_nix: Option = "patch-binaries-for-nix", + // NOTE: only parsed by bootstrap.py, `--feature build-metrics` enables metrics unconditionally metrics: Option = "metrics", } } diff --git a/src/ci/run.sh b/src/ci/run.sh index 7de06ec35c36b..f05bb81d4a1e3 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -56,6 +56,7 @@ fi if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch try-perf; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.metrics" + HAS_METRICS=1 fi RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache" @@ -157,13 +158,6 @@ trap datecheck EXIT # sccache server at the start of the build, but no need to worry if this fails. SCCACHE_IDLE_TIMEOUT=10800 sccache --start-server || true -if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then - $SRC/configure --set rust.parallel-compiler - CARGO_INCREMENTAL=0 $PYTHON ../x.py check - rm -f config.toml - rm -rf build -fi - $SRC/configure $RUST_CONFIGURE_ARGS retry make prepare @@ -193,4 +187,21 @@ else do_make "$RUST_CHECK_TARGET" fi +if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then + rm -f config.toml + $SRC/configure --set rust.parallel-compiler + + # Save the build metrics before we wipe the directory + if [ $HAS_METRICS = 1 ]; then + mv build/metrics.json . + fi + rm -rf build + if [ $HAS_METRICS = 1 ]; then + mkdir build + mv metrics.json build + fi + + CARGO_INCREMENTAL=0 $PYTHON ../x.py check +fi + sccache --show-stats || true