python / python/cpython

Rewrite `sysconfig.get_config_vars` data generation to receive clearly-defined inputs

未關閉
#128,072 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

topic-sysconfig type-feature
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

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.

https://github.com/python/cpython/blob/f802c8bf872ab882d3056675acc79c950fe5b93c/Lib/sysconfig/__main__.py#L206-L221

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Lib/sysconfig/main.py 開始,特別查看連結的第 206–221 行以及 python -m sysconfig --generate-posix-vars 流程。追蹤設定資料在匯入和快取產生期間如何計算。完成的標準是:資料產生演算法具有明確定義的輸入,支援交叉編譯和已安裝建置等不同環境,並將安裝配置資料與額外公開的變數分離。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
build-system
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。