Add configure.py, an configure.ac replacement#146034
Draft
nascheme wants to merge 2 commits intopython:mainfrom
Draft
Add configure.py, an configure.ac replacement#146034nascheme wants to merge 2 commits intopython:mainfrom
nascheme wants to merge 2 commits intopython:mainfrom
Conversation
Assisted-by: claude-opus-4-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.