https://github.com/python/cpython/commit/3b45df03a4bd0e21edec43144b8d9bac689d23a0
commit: 3b45df03a4bd0e21edec43144b8d9bac689d23a0
branch: main
author: Peter Bierma <zintensity...@gmail.com>
committer: colesbury <colesb...@gmail.com>
date: 2024-09-16T16:03:16-04:00
summary:

gh-124043: Disallow mixing `--with-trace-refs` and `--disable-gil` (#124078)

Tracing references is not currently thread-safe in the free-threaded build.

files:
A Misc/NEWS.d/next/Build/2024-09-13-17-48-37.gh-issue-124043.Bruxpq.rst
M configure
M 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
index 00000000000000..8111b76f95fad6
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2024-09-13-17-48-37.gh-issue-124043.Bruxpq.rst
@@ -0,0 +1,2 @@
+Building using :option:`--with-trace-refs` is (temporarily) disallowed when the
+GIL is disabled.
diff --git a/configure b/configure
index ba4fc9301c8600..b7055a8f74f5c4 100755
--- a/configure
+++ b/configure
@@ -8234,6 +8234,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
diff --git a/configure.ac b/configure.ac
index 5fc7e0822f89a8..ab6233a1341422 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to