]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-133171: Prevent combinations of --disable-gil and --enable-experimental-jit.....
authorBrandt Bucher <brandtbucher@microsoft.com>
Fri, 2 May 2025 16:26:03 +0000 (09:26 -0700)
committerGitHub <noreply@github.com>
Fri, 2 May 2025 16:26:03 +0000 (09:26 -0700)
.github/workflows/jit.yml
Misc/NEWS.d/next/Build/2025-04-29-15-29-11.gh-issue-133171.YbwbwP.rst [new file with mode: 0644]
PCbuild/build.bat
configure
configure.ac

index af460f4264932c28f956ba89ee9965e80abfb303..6ea238d294ca89ddaad9f0b6daebc6a5e555be78 100644 (file)
@@ -126,29 +126,30 @@ jobs:
           make all --jobs 4
           ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
 
-  jit-with-disabled-gil:
-    name: Free-Threaded (Debug)
-    needs: interpreter
-    runs-on: ubuntu-24.04
-    timeout-minutes: 90
-    strategy:
-      fail-fast: false
-      matrix:
-        llvm:
-          - 19
-    steps:
-      - uses: actions/checkout@v4
-        with:
-          persist-credentials: false
-      - uses: actions/setup-python@v5
-        with:
-          python-version: '3.11'
-      - name: Build with JIT enabled and GIL disabled
-        run: |
-          sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
-          export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
-          ./configure --enable-experimental-jit --with-pydebug --disable-gil
-          make all --jobs 4
-      - name: Run tests
-        run: |
-          ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
+  # XXX: GH-133171
+  # jit-with-disabled-gil:
+  #   name: Free-Threaded (Debug)
+  #   needs: interpreter
+  #   runs-on: ubuntu-24.04
+  #   timeout-minutes: 90
+  #   strategy:
+  #     fail-fast: false
+  #     matrix:
+  #       llvm:
+  #         - 19
+  #   steps:
+  #     - uses: actions/checkout@v4
+  #       with:
+  #         persist-credentials: false
+  #     - uses: actions/setup-python@v5
+  #       with:
+  #         python-version: '3.11'
+  #     - name: Build with JIT enabled and GIL disabled
+  #       run: |
+  #         sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
+  #         export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
+  #         ./configure --enable-experimental-jit --with-pydebug --disable-gil
+  #         make all --jobs 4
+  #     - name: Run tests
+  #       run: |
+  #         ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
diff --git a/Misc/NEWS.d/next/Build/2025-04-29-15-29-11.gh-issue-133171.YbwbwP.rst b/Misc/NEWS.d/next/Build/2025-04-29-15-29-11.gh-issue-133171.YbwbwP.rst
new file mode 100644 (file)
index 0000000..6207ffa
--- /dev/null
@@ -0,0 +1,2 @@
+Since free-threaded builds do not support the experimental JIT compiler,
+prevent these configurations from being combined.
index db67ae729813450c987fcec32fb14eeacb8f1d80..88d6b99d651cf37c6372f758a5c66bc0b953333b 100644 (file)
@@ -123,6 +123,13 @@ if "%do_pgo%" EQU "true" if "%platf%" EQU "x64" (
     )
 )
 
+if "%UseDisableGil%" EQU "true" if "%UseTIER2%" NEQ "" (
+    rem GH-133171: This configuration builds the JIT but never actually uses it,
+    rem which is surprising (and strictly worse than not building it at all):
+    echo.ERROR: --experimental-jit cannot be used with --disable-gil.
+    exit /b 1
+)
+
 if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP%\git.loc" & del "%TEMP%\git.loc"
 if exist "%GIT%" set GITProperty=/p:GIT="%GIT%"
 if not exist "%GIT%" echo Cannot find Git on PATH & set GITProperty=
index 1ec91021a38b66ce8bdf9ebeb1e4113ee26e42b7..7dbb35f9f45f4bc185b0e7932b4732511182d6ca 100755 (executable)
--- a/configure
+++ b/configure
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tier2_flags $jit_flags" >&5
 printf "%s\n" "$tier2_flags $jit_flags" >&6; }
 
+if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
+  # GH-133171: This configuration builds the JIT but never actually uses it,
+  # which is surprising (and strictly worse than not building it at all):
+  as_fn_error $? "--enable-experimental-jit cannot be used with --disable-gil." "$LINENO" 5
+fi
+
 case "$ac_cv_cc_name" in
 mpicc)
     CFLAGS_NODIST="$CFLAGS_NODIST"
index 16367b3ea53c27b81f9aa638660d56932d6a29a0..65f265045ba318bfe06cb822a9ea5f8ae472c1a8 100644 (file)
@@ -2786,6 +2786,12 @@ AC_SUBST([REGEN_JIT_COMMAND])
 AC_SUBST([JIT_STENCILS_H])
 AC_MSG_RESULT([$tier2_flags $jit_flags])
 
+if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
+  # GH-133171: This configuration builds the JIT but never actually uses it,
+  # which is surprising (and strictly worse than not building it at all):
+  AC_MSG_ERROR([--enable-experimental-jit cannot be used with --disable-gil.])
+fi
+
 case "$ac_cv_cc_name" in
 mpicc)
     CFLAGS_NODIST="$CFLAGS_NODIST"