bazel-contrib / bazel-contrib/rules_python

Add support for building C extensions

Đang mở
#824 38 bình luận 10 reaction 0 người được giao Xem trên GitHub
Can Close? type: feature request
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

* [x] Add support for getting Python headers (Python.h) -- use `@rules_python//python/cc:current_py_cc_headers`
* [x] Provide shared libraries (libpython.so et al) -- use `@rules_python//python/cc:current_py_cc_libs`
* [ ] Provide static libraries (libpython.a)
* [ ] Add a rule/rules to build C extensions
* [ ] Add `PyInfo.cc_info` field to allow C/C++ info (CcInfo) to propagate (directly
propagating CcInfo it isn't done to prevent a Python target from
being accidentally accepted by a plain CC target)

### Describe alternatives you've considered

I've cobbled support for these things by hand in the past, was hoping building extension modules would be officially supported at some point.

Some projects, such as tensorflow and pybind11_bazel, have a python_configure.bzl file and/or py_extension rule that attempts to implement this.

(Note: this issue was originally about updating the readme to address the lack of this feature; it's been edited to be a feature request for this feature directly - rickeylev)

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

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

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra các target hiện có @rules_python//python/cc:current_py_cc_headers và current_py_cc_libs, sau đó so sánh các triển khai python_configure.bzl và py_extension được đề cập trong issue. Công việc được xem là hoàn tất khi cung cấp các thư viện tĩnh, một rule để build các phần mở rộng C và một trường PyInfo.cc_info truyền bá CcInfo mà không cho phép các target Python đi vào các target C++ thuần túy.

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

Đánh giá

Công nghệ
c, python
Lĩnh vực
build-system, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ 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.