From a2d8fa978ce179247ad96618645e8892ed5be8a4 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Tue, 17 Nov 2026 13:21:15 +0000 Subject: [PATCH] workaround Rust compiler non-determinism Since [1] Rust compiler does have deterministic order of diagnostics. This causes spurious failures of pin-init CI when checking diagnostic messages match expectation. Thus, use `-Zthreads=1` to workaround the issue. Newer version of trybuild contains a workaround internally. However, we cannot bump to that version due to our lower MSRV requirement. Link: https://github.com/rust-lang/rust/pull/162848 [1] Signed-off-by: Gary Guo --- .github/workflows/ci.yml | 2 ++ justfile | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c34b3db6..6966bdb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,9 @@ jobs: - run: git config user.name "github-runner" && git config user.email "<>" - run: git rebase --exec 'cargo test ui_ --locked --all-targets' --root env: + # -Zthreads=1 is needed to workaround Rust compiler non-determinism. RUSTFLAGS: > + -Zthreads=1 -Dwarnings --cfg UI_TESTS nightly: diff --git a/justfile b/justfile index 5493469c..aa417b37 100644 --- a/justfile +++ b/justfile @@ -3,8 +3,9 @@ check: cargo check --all-targets +# -Zthreads=1 is needed to workaround Rust compiler non-determinism. ui-tests: - RUSTFLAGS="--cfg UI_TESTS" cargo test + RUSTFLAGS="-Zthreads=1 --cfg UI_TESTS" cargo test bless-ui-tests: - TRYBUILD=overwrite MACROTEST=overwrite RUSTFLAGS="--cfg UI_TESTS" cargo test + TRYBUILD=overwrite MACROTEST=overwrite RUSTFLAGS="-Zthreads=1 --cfg UI_TESTS" cargo test