Support consumer-configured project scoping for python_version
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- build-system
Rechercherichtung
Start by reading the python_version flag declaration in @rules_python//python/config_settings and the root module's Python configuration API; then review the target and exec transitions, including the behavior needed by the precompiler in #4335. The issue describes the desired opt-in and ownership boundary, but leaves the API design and supported Bazel versions open. Done means documenting a supported root-module option and testing target transitions and exec tools while preserving the default behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Relevant Rules
@rules_python//python/config_settings:python_version and the root module's Python configuration API.
Description
I build Python extensions for multiple interpreter versions, with large Python-independent Rust/C++ libraries underneath them. The bindings need different Python configurations, but the native libraries should share a configuration when their other inputs are equal.
For example:
Python 3.11 binding -> native core
Python 3.12 binding -> native core
A version transition on a binding also reaches its native dependencies unless that setting is reset. This creates extra configured targets and can change action keys even where the native library does not use Python. Exec-only flag trimming does not address ordinary target-configured libraries.
Bazel's configurability roadmap explicitly describes project-scoped flags as a way to avoid this cache fragmentation; its public example demonstrates the mechanism.
Currently I need a source patch to make the version flag project-scoped and associate it with my project's ownership definition. I would like to configure that through a supported API.
Describe the solution you'd like
An opt-in, root-module-controlled configuration that:
- Selects project scope for the Python-version flag while preserving the existing default behavior.
- Associates the flag with a consumer-supplied
PROJECT.scldefinition, without requiring a patch to the dependency's source tree.
The consumer would own the paths for bindings, intervening aliases, Python headers/runtimes and Python-sensitive build scripts. Python-independent native dependencies would remain outside those paths. The API need not infer that boundary automatically.
Please document the supported Bazel versions and test both target transitions and exec tools. In particular, #4335 deliberately sets universal scope so Bazel 10's precompiler uses the correct interpreter. An opt-in project mode must account for that correctness requirement rather than simply replacing the default.
This request uses Bazel's existing invocation-baseline reset semantics. It does not require the separate declared-default reset proposal in bazelbuild/bazel#32178.
Describe alternatives you've considered
Patching the flag declaration and adding a project-definition alias works as a local workaround, but ties the policy to dependency implementation details. Custom reset transitions require maintaining explicit boundaries and wrappers. A supported project-scoping option would let the ruleset own the integration while the consuming project owns its dependency boundary.
- Vorherrschende Sprache
- Starlark
- Sterne
- 688
- Forks
- 730
- Ø Merge
- 12 Std. 4 Min.
- Gemergte PRs (30 T.)
- 141
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus bazel-contrib/rules_python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
bazel-contrib/rules_python#4251 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
bazel-contrib/rules_python#4164 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Can Close? need: repro
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
bazel-contrib/rules_python#4315 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
bazel-contrib/rules_python#4311 ·
Maintainer antworten meist innerhalb von 1 Tag
-
pip.parse ignores uv.lock dependency-edge platform markersEvtl. vergeben @kdelalic hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
bazel-contrib/rules_python#4287 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in bazel-contrib/rules_python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
dbt-msft/dbt-sqlserver#897 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
linxiv-dev/linXiv#384 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Mend: dependency security vulnerability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag
-
area: dependencies auto-generated cwe: 405 dependencies ecosystem: npm help wanted package: minimatch scope: runtime security security-alert severity: medium source: dependabot supply-chain vulnerability
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 65/100
tdk-landscape/tdk-cli-core#2811 ·
-
critical
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag