bazel-contrib / bazel-contrib/rules_python

Expose `sysconfig` variables in `PyRuntimeInfo` provider

Abierto
#2,631 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Starlark
Estrellas
688
Forks
721
Merge medio
15 h 7 min
PR fusionados (30 d)
76

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con el esquema PyRuntimeInfo y la regla py_runtime mencionada en el issue, y luego sigue la configuración del repositorio interno de toolchains que proporciona intérpretes registrados. Revisa los issues #824 y nanobind-bazel#61 para obtener contexto; se considera terminado cuando los datos de sysconfig, como ext_suffix, están disponibles para las reglas posteriores y pueden ser proporcionados por toolchains de terceros.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
build-system
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.