Skip to content

Add configure.py, an configure.ac replacement#146034

Draft
nascheme wants to merge 2 commits intopython:mainfrom
nascheme:configure_py
Draft

Add configure.py, an configure.ac replacement#146034
nascheme wants to merge 2 commits intopython:mainfrom
nascheme:configure_py

Conversation

@nascheme
Copy link
Member

CPython's build configuration is driven by configure.ac (8,344 lines, ~271
KB), which uses autoconf/M4 macros to generate a 946 KB shell script
(configure). This system is:

  • Opaque and hard to read/maintain (M4 macro language)
  • Inefficient (generates a giant shell script, then runs it)
  • Difficult to extend or debug

This replaces it with a Python-based build configuration system where
Tools/configure/configure.py is a real Python script that imports a pyconf
module. The pyconf functions generally match the autoconf behaviour, so that
translation 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant