8000 Merge TSAN test matrices in CI (#123278) · python/cpython@f3abee0 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3abee0

Browse files
committed
Merge TSAN test matrices in CI (#123278)
(cherry picked from commit 03d9cdb)
1 parent 1a0fbc7 commit f3abee0

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,19 @@ jobs:
529529
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
530530

531531
build_tsan:
532-
name: 'Thread sanitizer'
532+
name: >-
533+
Thread sanitizer
534+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
533535
needs: check_source
534536
if: needs.check_source.outputs.run_tests == 'true'
537+
strategy:
538+
matrix:
539+
free-threading:
540+
- false
535541
uses: ./.github/workflows/reusable-tsan.yml
536542
with:
537543
config_hash: ${{ needs.check_source.outputs.config_hash }}
538-
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
544+
free-threading: ${{ matrix.free-threading }}
539545

540546
all-required-green: # This job does nothing and is only used for the branch protection
541547
name: All required checks pass

.github/workflows/reusable-tsan.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ on:
66
config_hash:
77
required: true
88
type: string
9-
options:
10-
required: true
11-
type: string
9+
free-threading:
10+
description: Whether to use free-threaded mode
11+
required: false
12+
type: boolean
13+
default: false
1214

1315
env:
1416
FORCE_COLOR: 1
@@ -18,8 +20,6 @@ jobs:
1820
name: 'Thread sanitizer'
1921
runs-on: ubuntu-24.04
2022
timeout-minutes: 60
21-
env:
22-
OPTIONS: ${{ inputs.options }}
2323
steps:
2424
- uses: actions/checkout@v4
2525
with:
@@ -39,9 +39,13 @@ jobs:
3939
sudo sysctl -w vm.mmap_rnd_bits=28
4040
- name: TSAN Option Setup
4141
run: |
42-
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV
43-
echo "CC=clang" >> $GITHUB_ENV
44-
echo "CXX=clang++" >> $GITHUB_ENV
42+
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{
43+
fromJSON(inputs.free-threading)
44+
&& '_free_threading'
45+
|| ''
46+
}}.txt" >> "$GITHUB_ENV"
47+
echo "CC=clang" >> "$GITHUB_ENV"
48+
echo "CXX=clang++" >> "$GITHUB_ENV"
4549
- name: Add ccache to PATH
4650
run: |
4751
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
@@ -51,7 +55,12 @@ jobs:
5155
save: ${{ github.event_name == 'push' }}
5256
max-size: "200M"
5357
- name: Configure CPython
54-
run: "${OPTIONS}"
58+
run: >-
59+
./configure
60+
--config-cache
61+
--with-thread-sanitizer
62+
--with-pydebug
63+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
5564
- name: Build CPython
5665
run: make -j4
5766
- name: Display build info
File renamed without changes.

0 commit comments

Comments
 (0)
0