bazel-contrib / bazel-contrib/rules_python

Expose `sysconfig` variables in `PyRuntimeInfo` provider

オープン
#2,631 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Starlark
スター
688
フォーク
721
平均マージ
15時間 7分
マージ済み PR(30日)
76

説明

# 🚀 feature request

Downstream rules are potentially interested in the selected toolchains configuration.
Specifically, building C extension modules depends on things like `EXT_SUFFIX` to create proper extensions supporting the chosen interpreter.
Because that suffix ends up in file names, downstream rules may need that value at configure time, when they can't query the interpreter.
But the `@rules_python` `repository_rule` can easily determine these variables before configure time, for each registered toolchain.

This is related to:
- https://github.com/bazelbuild/rules_python/issues/824
- https://github.com/nicholasjng/nanobind-bazel/issues/61
- I'm sure other downstream bazel tooling related to C extensions would like this as-well

### Relevant Rules

This feature would ultimately need changes to:
- `PyRuntimeInfo` (basic schema)
- `py_runtime` (so that third party toolchains/interpreters can provide that information too)
- the internal pluming providing the `@rules_python` provided internal toolchains

### Description

`PyRuntimeInfo` needs a field `ext_suffix`, or alternatively `sysconfig_variables` (for future extension).
At extension instantiation time, when setting up the toolchain repos, the respective interpreters should be queried for their `ext_suffix`; alternatively, that information could be determined offline.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず PyRuntimeInfo スキーマと issue で指定されている py_runtime ルールから始め、登録済みインタープリターを提供する内部 toolchain リポジトリのセットアップを追跡します。背景については issues #824 と nanobind-bazel#61 を確認してください。sysconfig データ(ext_suffix など)が下流のルールから利用でき、サードパーティの toolchain から提供できれば完了です。

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

評価

技術スタック
python
領域
build-system
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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