bazel-contrib / bazel-contrib/rules_python

Add support for building C extensions

Ouverte
#824 38 commentaires 10 réactions 0 personnes assignées Voir sur GitHub
Can Close? type: feature request
Langage dominant
Starlark
Étoiles
688
Forks
721
Merge moyen
15 h 7 min
PR mergées (30 j)
76

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par inspecter les cibles existantes @rules_python//python/cc:current_py_cc_headers et current_py_cc_libs, puis comparez les implémentations de python_configure.bzl et py_extension mentionnées dans l’issue. Le travail est terminé lorsqu’il fournit des bibliothèques statiques, une règle pour compiler des extensions C et un champ PyInfo.cc_info qui propage CcInfo sans permettre aux cibles Python d’être utilisées dans des cibles C++ simples.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
c, python
Domaine
build-system, tooling
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.