Add configure.py, a configure.ac replacement#146034
Add configure.py, a configure.ac replacement#146034nascheme wants to merge 40 commits intopython:mainfrom
Conversation
Assisted-by: claude-opus-4-6
Keep srcdir as an absolute path if it was originally. Match host_prefix setting done by configure.ac. Fix AWK implementations of pyconf_env_var(), pyconf_check_header() and pyconf_check_decl().
Match the autoconf macro behavior: set per-package variables (ZLIB_CFLAGS, ZLIB_LIBS, etc.) only when the system is Emscripten and the user hasn't already provided values.
|
🤖 New build scheduled with the buildbot fleet by @nascheme for commit 6088c5e 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146034%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
🤖 New build scheduled with the buildbot fleet by @nascheme for commit c643245 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146034%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
🤖 New build scheduled with the buildbot fleet by @nascheme for commit ea140e1 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146034%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Pass srcdir to the AWK script. Look in srcdir when generating config files.
It seems some awk implementations have memory corruption bug, avoid creating large strings with concat.
CPython's build configuration is driven by
configure.ac(8,344 lines, ~271KB), which uses autoconf/M4 macros to generate a 946 KB shell script
(
configure). This system is:This replaces it with a Python-based build configuration system where
Tools/configure/configure.pyis a real Python script that imports apyconfmodule. The
pyconffunctions generally match the autoconf behaviour, so thattranslation from the configure.ac file is mostly direct and mechanical.
There is also a transpiler that converts configure.py into POSIX AWK (wrapped
in a small shell stub). The transpiler lives in
Tools/configure/transpiler/and the pipeline is: Python AST → pysh_ast → awk_ast → AWK text. The sh and
AWK code needs to be compatible with those tools on various Unix-like operating
systems.