Skip to content

gh-157695: Parse also _Py_HAVE_xxx variables in sysconfig - #158926

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:sysconfig
Oct 6, 2026
Merged

vstinner merged 3 commits into
python:mainfrom
vstinner:sysconfig

Conversation

@vstinner

@vstinner vstinner commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Add parse_config_h() tests in test_sysconfig.

Add parse_config_h() tests in test_sysconfig.
@vstinner vstinner changed the title gh-157695: Parse also _Py_XXX variables in sysconfig Oct 6, 2026
@vstinner
vstinner enabled auto-merge (squash) October 6, 2026 18:42
@vstinner

vstinner commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Example of build/lib.linux-x86_64-3.16/_sysconfigdata_td_linux_x86_64-linux-gnu.py changes on my Linux box:

--- main.py	2026-10-06 20:47:16.919435265 +0200
+++ change.py	2026-10-06 20:47:36.828550161 +0200
@@ -1150,6 +1150,25 @@
     'X87_DOUBLE_ROUNDING': 0,
     'XMLLIBSUBDIRS': 'xml xml/dom xml/etree xml/parsers xml/sax',
     'ZIP_STDLIB': 'python3.16t.zip',
+    '_Py_FFI_SUPPORT_C_COMPLEX': 1,
+    '_Py_HACL_CAN_COMPILE_VEC128': 1,
+    '_Py_HACL_CAN_COMPILE_VEC256': 1,
+    '_Py_HAVE_ACOSPI': 1,
+    '_Py_HAVE_ASINPI': 1,
+    '_Py_HAVE_ATAN2PI': 1,
+    '_Py_HAVE_ATANPI': 1,
+    '_Py_HAVE_COSPI': 1,
+    '_Py_HAVE_EFFICIENT_BUILTIN_SHUFFLEVECTOR': 1,
+    '_Py_HAVE_FLOAT16': 1,
+    '_Py_HAVE_ICONV': 1,
+    '_Py_HAVE_LIBGCC_EH_FRAME_REGISTRATION': 1,
+    '_Py_HAVE_PR_SET_VMA_ANON_NAME': 1,
+    '_Py_HAVE_SINPI': 1,
+    '_Py_HAVE_TANPI': 1,
+    '_Py_LINKER_THREAD_STACK_SIZE': 0,
+    '_Py_STACK_GROWS_DOWN': 1,
+    '_Py_TAIL_CALL_INTERP': 0,
+    '_Py_WITH_FRAME_POINTERS': 1,
     'abs_builddir': '/home/vstinner/python/main',
     'abs_srcdir': '/home/vstinner/python/main',
     'datarootdir': '/usr/local/share',
@vstinner
vstinner merged commit 978a8be into python:main Oct 6, 2026
49 checks passed
@vstinner
vstinner deleted the sysconfig branch October 6, 2026 19:15
vstinner added a commit that referenced this pull request Oct 10, 2026
* gh-157695: Parse also _Py_HAVE_xxx variables in sysconfig (#158926)

Add parse_config_h() tests to test_sysconfig.

(cherry picked from commit 978a8be)

* gh-158893: Make os.strerror() thread-safe (#158927)

Make os.strerror() thread-safe: use the reentrant strerror_r()
function if available.

* The configure script now checks if strerror_r() is supported.
* Add a stress test to test_free_threading.test_os (new module).
* Add a comment on decode_current_locale() assertion which fails if
  the input string is mutated.
* Add an assertion to _Py_DecodeLocale() to detect if the input
  string was mutated during the function call.

* gh-158893: Add internal _Py_strerror() function (#158982)

Add a new internal _Py_strerror() function to Python/fileutils.c. It
uses strerror_r() if available, or use strerror() otherwise.

Replace all strerror(code) calls with _Py_strerror(code).

(cherry picked from commit 15dd735)
vstinner added a commit to vstinner/cpython that referenced this pull request Oct 10, 2026
* pythongh-157695: Parse also _Py_HAVE_xxx variables in sysconfig (python#158926)

Add parse_config_h() tests to test_sysconfig.

(cherry picked from commit 978a8be)

* pythongh-158893: Make os.strerror() thread-safe (python#158927)

Make os.strerror() thread-safe: use the reentrant strerror_r()
function if available.

* The configure script now checks if strerror_r() is supported.
* Add a stress test to test_free_threading.test_os (new module).
* Add a comment on decode_current_locale() assertion which fails if
  the input string is mutated.
* Add an assertion to _Py_DecodeLocale() to detect if the input
  string was mutated during the function call.

* pythongh-158893: Add internal _Py_strerror() function (python#158982)

Add a new internal _Py_strerror() function to Python/fileutils.c. It
uses strerror_r() if available, or use strerror() otherwise.

Replace all strerror(code) calls with _Py_strerror(code).

(cherry picked from commit 15dd735)
(cherry picked from commit c774d15)
vstinner added a commit that referenced this pull request Oct 10, 2026
[3.15] gh-158893: Make os.strerror() thread-safe (#159120)

* gh-157695: Parse also _Py_HAVE_xxx variables in sysconfig (#158926)

Add parse_config_h() tests to test_sysconfig.

(cherry picked from commit 978a8be)

* gh-158893: Make os.strerror() thread-safe (#158927)

Make os.strerror() thread-safe: use the reentrant strerror_r()
function if available.

* The configure script now checks if strerror_r() is supported.
* Add a stress test to test_free_threading.test_os (new module).
* Add a comment on decode_current_locale() assertion which fails if
  the input string is mutated.
* Add an assertion to _Py_DecodeLocale() to detect if the input
  string was mutated during the function call.

* gh-158893: Add internal _Py_strerror() function (#158982)

Add a new internal _Py_strerror() function to Python/fileutils.c. It
uses strerror_r() if available, or use strerror() otherwise.

Replace all strerror(code) calls with _Py_strerror(code).

(cherry picked from commit 15dd735)
(cherry picked from commit c774d15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant