|  | 
| 6 | 6 |       config_hash: | 
| 7 | 7 |         required: true | 
| 8 | 8 |         type: string | 
|  | 9 | +      bolt-optimizations: | 
|  | 10 | +        description: Whether to enable BOLT optimizations | 
|  | 11 | +        required: false | 
|  | 12 | +        type: boolean | 
|  | 13 | +        default: false | 
| 9 | 14 |       free-threading: | 
| 10 | 15 |         description: Whether to use free-threaded mode | 
| 11 | 16 |         required: false | 
|  | 
| 34 | 39 |       run: echo "::add-matcher::.github/problem-matchers/gcc.json" | 
| 35 | 40 |     - name: Install dependencies | 
| 36 | 41 |       run: sudo ./.github/workflows/posix-deps-apt.sh | 
|  | 42 | +    - name: Install Clang and BOLT | 
|  | 43 | +      if: ${{ fromJSON(inputs.bolt-optimizations) }} | 
|  | 44 | +      run: | | 
|  | 45 | +        sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 19 | 
|  | 46 | +        sudo apt-get install bolt-19 | 
|  | 47 | +        echo PATH="$(llvm-config-19 --bindir):$PATH" >> $GITHUB_ENV | 
| 37 | 48 |     - name: Configure OpenSSL env vars | 
| 38 | 49 |       run: | | 
| 39 | 50 |         echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV" | 
| @@ -73,14 +84,18 @@ jobs: | 
| 73 | 84 |         key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }} | 
| 74 | 85 |     - name: Configure CPython out-of-tree | 
| 75 | 86 |       working-directory: ${{ env.CPYTHON_BUILDDIR }} | 
|  | 87 | +      # `test_unpickle_module_race` writes to the source directory, which is | 
|  | 88 | +      # read-only during builds — so we exclude it from profiling with BOLT. | 
| 76 | 89 |       run: >- | 
|  | 90 | +        PROFILE_TASK='-m test --pgo --ignore test_unpickle_module_race' | 
| 77 | 91 |         ../cpython-ro-srcdir/configure | 
| 78 | 92 |         --config-cache | 
| 79 | 93 |         --with-pydebug | 
| 80 | 94 |         --enable-slower-safety | 
| 81 | 95 |         --enable-safety | 
| 82 | 96 |         --with-openssl="$OPENSSL_DIR" | 
| 83 | 97 |         ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }} | 
|  | 98 | +        ${{ fromJSON(inputs.bolt-optimizations) && '--enable-bolt' || '' }} | 
| 84 | 99 |     - name: Build CPython out-of-tree | 
| 85 | 100 |       if: ${{ inputs.free-threading }} | 
| 86 | 101 |       working-directory: ${{ env.CPYTHON_BUILDDIR }} | 
|  | 
0 commit comments