|  | 
| 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 | 
|  | 
| 16 | 21 |          required: true | 
| 17 | 22 |          type: string | 
| 18 | 23 | 
 | 
|  | 24 | +env: | 
|  | 25 | +  FORCE_COLOR: 1 | 
|  | 26 | + | 
| 19 | 27 | jobs: | 
| 20 | 28 |   build_ubuntu_reusable: | 
| 21 | 29 |     name: build and test (${{ inputs.os }}) | 
| 22 | 30 |     timeout-minutes: 60 | 
| 23 | 31 |     runs-on: ${{ inputs.os }} | 
| 24 | 32 |     env: | 
| 25 |  | -      FORCE_COLOR: 1 | 
| 26 | 33 |       OPENSSL_VER: 3.0.15 | 
| 27 | 34 |       PYTHONSTRICTEXTENSIONBUILD: 1 | 
| 28 | 35 |       TERM: linux | 
|  | 
| 34 | 41 |       run: echo "::add-matcher::.github/problem-matchers/gcc.json" | 
| 35 | 42 |     - name: Install dependencies | 
| 36 | 43 |       run: sudo ./.github/workflows/posix-deps-apt.sh | 
|  | 44 | +    - name: Install Clang and BOLT | 
|  | 45 | +      if: ${{ fromJSON(inputs.bolt-optimizations) }} | 
|  | 46 | +      run: | | 
|  | 47 | +        sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 19 | 
|  | 48 | +        sudo apt-get install bolt-19 | 
|  | 49 | +        echo PATH="$(llvm-config-19 --bindir):$PATH" >> $GITHUB_ENV | 
| 37 | 50 |     - name: Configure OpenSSL env vars | 
| 38 | 51 |       run: | | 
| 39 | 52 |         echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV" | 
| @@ -73,14 +86,18 @@ jobs: | 
| 73 | 86 |         key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }} | 
| 74 | 87 |     - name: Configure CPython out-of-tree | 
| 75 | 88 |       working-directory: ${{ env.CPYTHON_BUILDDIR }} | 
|  | 89 | +      # `test_unpickle_module_race` writes to the source directory, which is | 
|  | 90 | +      # read-only during builds — so we exclude it from profiling with BOLT. | 
| 76 | 91 |       run: >- | 
|  | 92 | +        PROFILE_TASK='-m test --pgo --ignore test_unpickle_module_race' | 
| 77 | 93 |         ../cpython-ro-srcdir/configure | 
| 78 | 94 |         --config-cache | 
| 79 | 95 |         --with-pydebug | 
| 80 | 96 |         --enable-slower-safety | 
| 81 | 97 |         --enable-safety | 
| 82 | 98 |         --with-openssl="$OPENSSL_DIR" | 
| 83 | 99 |         ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }} | 
|  | 100 | +        ${{ fromJSON(inputs.bolt-optimizations) && '--enable-bolt' || '' }} | 
| 84 | 101 |     - name: Build CPython out-of-tree | 
| 85 | 102 |       if: ${{ inputs.free-threading }} | 
| 86 | 103 |       working-directory: ${{ env.CPYTHON_BUILDDIR }} | 
|  | 
0 commit comments