|
6 | 6 | config_hash: |
7 | 7 | required: true |
8 | 8 | type: string |
9 | | - options: |
10 | | - required: true |
11 | | - type: string |
12 | | - suppressions_path: |
13 | | - description: 'A repo relative path to the suppressions file' |
14 | | - required: true |
15 | | - type: string |
16 | | - tsan_logs_artifact_name: |
17 | | - description: 'Name of the TSAN logs artifact. Must be unique for each job.' |
18 | | - required: true |
19 | | - type: string |
| 9 | + free-threading: |
| 10 | + description: Whether to use free-threaded mode |
| 11 | + required: false |
| 12 | + type: boolean |
| 13 | + default: false |
20 | 14 |
|
21 | 15 | env: |
22 | 16 | FORCE_COLOR: 1 |
|
26 | 20 | name: 'Thread sanitizer' |
27 | 21 | runs-on: ubuntu-24.04 |
28 | 22 | timeout-minutes: 60 |
29 | | - env: |
30 | | - OPTIONS: ${{ inputs.options }} |
31 | | - SUPPRESSIONS_PATH: ${{ inputs.suppressions_path }} |
32 | 23 | steps: |
33 | 24 | - uses: actions/checkout@v4 |
34 | 25 | with: |
|
55 | 46 | sudo sysctl -w vm.mmap_rnd_bits=28 |
56 | 47 | - name: TSAN Option Setup |
57 | 48 | run: | |
58 | | - echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${SUPPRESSIONS_PATH} handle_segv=0" >> $GITHUB_ENV |
59 | | - echo "CC=clang" >> $GITHUB_ENV |
60 | | - echo "CXX=clang++" >> $GITHUB_ENV |
| 49 | + echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{ |
| 50 | + fromJSON(inputs.free-threading) |
| 51 | + && '_free_threading' |
| 52 | + || '' |
| 53 | + }}.txt handle_segv=0" >> "$GITHUB_ENV" |
| 54 | + echo "CC=clang" >> "$GITHUB_ENV" |
| 55 | + echo "CXX=clang++" >> "$GITHUB_ENV" |
61 | 56 | - name: Add ccache to PATH |
62 | 57 | run: | |
63 | 58 | echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV |
|
67 | 62 | save: ${{ github.event_name == 'push' }} |
68 | 63 | max-size: "200M" |
69 | 64 | - name: Configure CPython |
70 | | - run: "${OPTIONS}" |
| 65 | + run: >- |
| 66 | + ./configure |
| 67 | + --config-cache |
| 68 | + --with-thread-sanitizer |
| 69 | + --with-pydebug |
| 70 | + ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }} |
71 | 71 | - name: Build CPython |
72 | 72 | run: make -j4 |
73 | 73 | - name: Display build info |
|
81 | 81 | if: always() |
82 | 82 | uses: actions/upload-artifact@v4 |
83 | 83 | with: |
84 | | - name: ${{ inputs.tsan_logs_artifact_name }} |
| 84 | + name: >- |
| 85 | + tsan-logs-${{ |
| 86 | + fromJSON(inputs.free-threading) |
| 87 | + && 'free-threading' |
| 88 | + || 'default' |
| 89 | + }} |
85 | 90 | path: tsan_log.* |
86 | 91 | if-no-files-found: ignore |
0 commit comments