python / python/cpython

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

オープン
#128,072 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

topic-sysconfig type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Lib/sysconfig/main.pyから始め、特にリンク先の206–221行とpython -m sysconfig --generate-posix-varsのフローを確認してください。インポート時およびキャッシュ生成時に構成データがどのように計算されるかを追跡してください。データ生成アルゴリズムの入力が明確に定義され、クロスコンパイルやインストール済みビルドなどの異なる環境をサポートし、インストールスキームのデータと追加で公開される変数が分離されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。