From f3abee0bfbd3911d481dc7b81978a18ae6e1c9b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=BA=F0=9F=87=A6=20Sviatoslav=20Sydorenko=20=28?= =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1?= =?UTF-8?q?=D0=B8=D0=B4=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=29?= Date: Wed, 29 Jan 2025 10:16:51 +0100 Subject: [PATCH] Merge TSAN test matrices in CI (#123278) (cherry picked from commit 03d9cdb7298cdbf67535dfeb3af5c1a619be7580) --- .github/workflows/build.yml | 10 +++++-- .github/workflows/reusable-tsan.yml | 27 ++++++++++++------- .../{supressions.txt => suppressions.txt} | 0 3 files changed, 26 insertions(+), 11 deletions(-) rename Tools/tsan/{supressions.txt => suppressions.txt} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 413600bdd900a0..bfe5c4c63f9432 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -529,13 +529,19 @@ jobs: run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" build_tsan: - name: 'Thread sanitizer' + name: >- + Thread sanitizer + ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} needs: check_source if: needs.check_source.outputs.run_tests == 'true' + strategy: + matrix: + free-threading: + - false uses: ./.github/workflows/reusable-tsan.yml with: config_hash: ${{ needs.check_source.outputs.config_hash }} - options: ./configure --config-cache --with-thread-sanitizer --with-pydebug + free-threading: ${{ matrix.free-threading }} all-required-green: # This job does nothing and is only used for the branch protection name: All required checks pass diff --git a/.github/workflows/reusable-tsan.yml b/.github/workflows/reusable-tsan.yml index 3aed17213218f0..874d842201a4f8 100644 --- a/.github/workflows/reusable-tsan.yml +++ b/.github/workflows/reusable-tsan.yml @@ -6,9 +6,11 @@ on: config_hash: required: true type: string - options: - required: true - type: string + free-threading: + description: Whether to use free-threaded mode + required: false + type: boolean + default: false env: FORCE_COLOR: 1 @@ -18,8 +20,6 @@ jobs: name: 'Thread sanitizer' runs-on: ubuntu-24.04 timeout-minutes: 60 - env: - OPTIONS: ${{ inputs.options }} steps: - uses: actions/checkout@v4 with: @@ -39,9 +39,13 @@ jobs: sudo sysctl -w vm.mmap_rnd_bits=28 - name: TSAN Option Setup run: | - echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV - echo "CC=clang" >> $GITHUB_ENV - echo "CXX=clang++" >> $GITHUB_ENV + echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{ + fromJSON(inputs.free-threading) + && '_free_threading' + || '' + }}.txt" >> "$GITHUB_ENV" + echo "CC=clang" >> "$GITHUB_ENV" + echo "CXX=clang++" >> "$GITHUB_ENV" - name: Add ccache to PATH run: | echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV @@ -51,7 +55,12 @@ jobs: save: ${{ github.event_name == 'push' }} max-size: "200M" - name: Configure CPython - run: "${OPTIONS}" + run: >- + ./configure + --config-cache + --with-thread-sanitizer + --with-pydebug + ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }} - name: Build CPython run: make -j4 - name: Display build info diff --git a/Tools/tsan/supressions.txt b/Tools/tsan/suppressions.txt similarity index 100% rename from Tools/tsan/supressions.txt rename to Tools/tsan/suppressions.txt