From b88edac2ea88bd70744dea3d790513a643464072 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Thu, 26 Nov 2026 14:08:04 +0100 Subject: [PATCH 1/5] Disable overflow checks for xz-core in dev builds xz-core is liblzma transpiled from C by c2rust and relies on unsigned wraparound: the match finder decrements a zero `depth` (C's `depth-- == 0`) and the .lzma header check increments 0xFFFFFFFF. With dev-profile overflow checks these become panics, so `test_lzma` aborts the interpreter and `test_tarfile` exits with code 101 in any debug build, including the weekly coverage job. Assisted-by: Claude Code:claude-opus-5-5 --- Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 37c88c1ac11..b1c7a829860 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,6 +106,12 @@ opt-level = 3 [profile.dev.package.rustpython-vm] opt-level = 3 +# xz-core is liblzma transpiled from C, where unsigned arithmetic wraps. Its +# match finder and .lzma header check rely on that, so overflow checks turn +# ordinary compression and decompression into panics in dev builds. +[profile.dev.package.xz-core] +overflow-checks = false + [profile.test] opt-level = 3 # https://github.com/rust-lang/rust/issues/92869 From 4ce5421869b1b97bab5134b748763e238fdab02b Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Thu, 26 Nov 2026 14:08:15 +0100 Subject: [PATCH 2/5] Limit CodSpeed benchmark builds to two jobs About one push to main in seven loses its CodSpeed run: six minutes into "Build the benchmark targets", while the `rustpython` binary and the `execution` and `microbenchmarks` benches are compiled and linked, the hosted runner either loses communication or receives a shutdown signal (exit 143), with no compiler error in the log. cargo-codspeed adds -Cdebuginfo=2 on top of the bench profile's thin LTO, and those three targets are the heaviest links in the workspace, all started at once. Cap the build at two jobs. Dependencies come from the cache, so the workspace crates build in a mostly serial chain and the cap only bites at that final stage. The generated code, and so the measurements, are unchanged. Assisted-by: Claude Code:claude-opus-5-5 --- .github/workflows/codspeed.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codspeed.yaml b/.github/workflows/codspeed.yaml index 7459dea3537..5a8a33ad23d 100644 --- a/.github/workflows/codspeed.yaml +++ b/.github/workflows/codspeed.yaml @@ -89,7 +89,13 @@ jobs: - name: Build the benchmark targets if: ${{ steps.environment.outputs.match != 'false' }} - run: cargo codspeed build --locked --measurement-mode simulation -p rustpython -p rustpython-sre_engine + # cargo-codspeed adds -Cdebuginfo=2 to the bench profile's thin LTO, and + # the `rustpython` binary and both of its benches are linked last, all + # at once. With the default job count that final stage regularly takes + # the hosted runner down ("lost communication" / "received a shutdown + # signal"). Two jobs keep it to two such links; the dependencies come + # from the cache, so the build is barely slower. + run: cargo codspeed build --locked --jobs 2 --measurement-mode simulation -p rustpython -p rustpython-sre_engine - name: Save cache if: ${{ github.ref == 'refs/heads/main' }} # only save on main From a3a00c5593f1dad704723dcd7f0d3eca94c377d0 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Thu, 26 Nov 2026 14:08:16 +0100 Subject: [PATCH 3/5] Stop reporting coverage profiles as a changed environment The instrumented interpreter writes default_*.profraw into the current directory whenever it runs without LLVM_PROFILE_FILE, which is the case for every child a test starts with a cleared environment. regrtest then reports test_os, test_subprocess and test_venv as having modified the environment, and --fail-env-changed fails the job for an artifact of the coverage build itself. Also pass -w so failing tests are re-run in verbose mode: the job takes about four hours and its log currently gives no detail on why a module failed. Assisted-by: Claude Code:claude-opus-5-5 --- .github/workflows/cron-ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index b0b74828900..24299741c45 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -51,7 +51,11 @@ jobs: - name: Run cargo-llvm-cov with Python test suite. id: python-suite # One worker at a time, with a fresh process for each test module. - run: cargo llvm-cov --no-report run -- -m test -j 1 -u all --slowest --fail-env-changed + # No --fail-env-changed: a child started with a cleared environment + # loses LLVM_PROFILE_FILE and writes default_*.profraw into the test's + # working directory, which regrtest reports as a changed environment. + # -w re-runs failing tests in verbose mode so the log says why. + run: cargo llvm-cov --no-report run -- -m test -j 1 -u all --slowest -w continue-on-error: true - name: Prepare code coverage data From bd8a31b486bb52c95559512d4669d15ffdd6cb87 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Thu, 26 Nov 2026 14:20:21 +0100 Subject: [PATCH 4/5] Keep re-run passes as coverage suite failures With -w alone, a test that fails and then passes when re-run no longer fails the job, which the command did before. --fail-rerun restores that. Assisted-by: Claude Code:claude-opus-5-5 --- .github/workflows/cron-ci.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index 24299741c45..00fea55488d 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -54,8 +54,9 @@ jobs: # No --fail-env-changed: a child started with a cleared environment # loses LLVM_PROFILE_FILE and writes default_*.profraw into the test's # working directory, which regrtest reports as a changed environment. - # -w re-runs failing tests in verbose mode so the log says why. - run: cargo llvm-cov --no-report run -- -m test -j 1 -u all --slowest -w + # -w re-runs failing tests in verbose mode so the log says why; + # --fail-rerun keeps a test that only passes on the re-run a failure. + run: cargo llvm-cov --no-report run -- -m test -j 1 -u all --slowest -w --fail-rerun continue-on-error: true - name: Prepare code coverage data From 95c125abfad4a209dfd608407bb7b48b31d4ca2a Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Tue, 1 Dec 2026 03:12:28 +0100 Subject: [PATCH 5/5] Print failing coverage test output instead of re-running --fail-rerun also fails the job for tests that were only re-run because they changed the environment (test_os and test_venv, because of the profile files the coverage runtime writes), which is what dropping --fail-env-changed was meant to avoid. Without it, -w would let a test that fails and then passes on the re-run pass the job. -W prints the output of a failing test without re-running anything, so a first-run failure stays fatal and an env-only change stays non-fatal. Assisted-by: Claude Code:claude-sonnet-5-5 --- .github/workflows/cron-ci.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index 00fea55488d..ba267e637ff 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -54,9 +54,11 @@ jobs: # No --fail-env-changed: a child started with a cleared environment # loses LLVM_PROFILE_FILE and writes default_*.profraw into the test's # working directory, which regrtest reports as a changed environment. - # -w re-runs failing tests in verbose mode so the log says why; - # --fail-rerun keeps a test that only passes on the re-run a failure. - run: cargo llvm-cov --no-report run -- -m test -j 1 -u all --slowest -w --fail-rerun + # -W prints the output of a failing test so the log says why. It does + # not re-run anything: regrtest also re-runs env-changed tests, which + # --fail-rerun would turn back into failures, and without that flag a + # test that fails and then passes on the re-run would not fail the job. + run: cargo llvm-cov --no-report run -- -m test -j 1 -u all --slowest -W continue-on-error: true - name: Prepare code coverage data