bazel-contrib / bazel-contrib/rules_python

Expose `sysconfig` variables in `PyRuntimeInfo` provider

Đang mở
#2,631 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Starlark
Star
688
Fork
721
Merge trung bình
15 giờ 7 phút
Pull request đã merge (30 ngày)
76

Mô tả

# 🚀 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với schema PyRuntimeInfo và quy tắc py_runtime được nêu trong issue, sau đó lần theo thiết lập repository toolchain nội bộ cung cấp các trình thông dịch đã đăng ký. Xem các issue #824 và nanobind-bazel#61 để biết ngữ cảnh; được xem là hoàn tất khi dữ liệu sysconfig như ext_suffix khả dụng cho các quy tắc downstream và có thể được cung cấp bởi các toolchain bên thứ ba.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.