Rewrite `sysconfig.get_config_vars` data generation to receive clearly-defined inputs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
Right now, some of the data is calculated during import, then we use that to calculate more data when building the sysconfig.get_config_vars cache. It would be good to transform all of this into a clearly defined algorithm, where we the data is generated based on a set of inputs, making it easier to generate data when cross-compiling, and allowing us to generate data for a specific environment (eg. source builds, vs installed build). This would have helped mitigate issues such as GH-127429, GH-128055, and GH-126789.
Additionally, this also gives us the opportunity to split the data into two sets: the minimum needed to evaluate the install scheme paths, and the non-critical additional data we expose in sysconfig.get_config_vars. This would help with the bootstrapping issue in python -m sysconfig --generate-posix-vars.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Lib/sysconfig/main.py, especially the linked lines 206–221 and the python -m sysconfig --generate-posix-vars flow. Trace how configuration data is calculated during import and cache generation. Done means the data-generation algorithm has clearly defined inputs, supports distinct environments such as cross-compiling and installed builds, and separates install-scheme data from additional exposed variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100