]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-124043: Disallow mixing `--with-trace-refs` and `--disable-gil` (GH-124078...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 24 Sep 2024 00:24:35 +0000 (02:24 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2024 00:24:35 +0000 (17:24 -0700)
gh-124043: Disallow mixing `--with-trace-refs` and `--disable-gil` (GH-124078)

Tracing references is not currently thread-safe in the free-threaded build.
(cherry picked from commit 3b45df03a4bd0e21edec43144b8d9bac689d23a0)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Misc/NEWS.d/next/Build/2024-09-13-17-48-37.gh-issue-124043.Bruxpq.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2024-09-13-17-48-37.gh-issue-124043.Bruxpq.rst b/Misc/NEWS.d/next/Build/2024-09-13-17-48-37.gh-issue-124043.Bruxpq.rst
new file mode 100644 (file)
index 0000000..8111b76
--- /dev/null
@@ -0,0 +1,2 @@
+Building using :option:`--with-trace-refs` is (temporarily) disallowed when the
+GIL is disabled.
index 7e1e5e594ca7736527ed033cc37700684dcd1ba1..7cdd386c387f588496877bfd63663061b176803d 100755 (executable)
--- a/configure
+++ b/configure
@@ -8232,6 +8232,10 @@ printf "%s\n" "#define Py_TRACE_REFS 1" >>confdefs.h
 
 fi
 
+if test "$disable_gil" = "yes" -a "$with_trace_refs" = "yes";
+then
+  as_fn_error $? "--disable-gil cannot be used with --with-trace-refs" "$LINENO" 5
+fi
 
 # Check for --enable-pystats
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-pystats" >&5
index 58f54076ff2f1a20b643596dd98b5dd5de7381c1..24e28a1e2de1fcaeb4a02cda7089524f52bd0e57 100644 (file)
@@ -1777,6 +1777,10 @@ then
             [Define if you want to enable tracing references for debugging purpose])
 fi
 
+if test "$disable_gil" = "yes" -a "$with_trace_refs" = "yes";
+then
+  AC_MSG_ERROR([--disable-gil cannot be used with --with-trace-refs])
+fi
 
 # Check for --enable-pystats
 AC_MSG_CHECKING([for --enable-pystats])