bazel-contrib / bazel-contrib/rules_python

Add support for building C extensions

Aperta
#824 38 commenti 10 reazioni 0 assegnatari Vedi su GitHub
Can Close? type: feature request
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by inspecting the existing @rules_python//python/cc:current_py_cc_headers and current_py_cc_libs targets, then compare the python_configure.bzl and py_extension implementations mentioned in the issue. Done means providing static libraries, a rule for building C extensions, and a PyInfo.cc_info field that propagates CcInfo without allowing Python targets into plain C++ targets.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, python
Ambito
build-system, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.