Support incompatible_strict_action_env
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- build-system
Rechercherichtung
Beginne damit, den Windows-Fall mit Bazel 9 und aktivierter strikter Aktionsumgebung zu reproduzieren: ein sh_binary mit einem py_binary in data. Lies das Runfiles- und Interpreter-Suchverhalten des Bazel-Launchers und vergleiche es anschließend mit der direkten Python-Ausführung und dem RunEnvironmentInfo-Ansatz. Erledigt ist die Aufgabe, wenn die verschachtelte Binärdatei ihren Python-Interpreter finden kann, ohne die Vererbung von PATH oder den dokumentierten Workaround zu benötigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
As of Bazel 9, --incompatible_strict_action_env=true is the default.
Almost everything works with that set, the one exception is Windows in a particular case. That particular case appears to be when the python program is a data dep of another binary, e.g. an sh_binary with a py_binary in data. What happens is the Bazel launcher can't find the python interpreter in runfiles, so falls back to looking for python.exe on PATH. When strict action env is enabled, the outer PATH isn't inherited, so python.exe can't be found, and thus the launcher fails to execute.
A direct execution of a python program is ok, since the runfiles structure is present enough that the bazel launcher can find the interpreter.
Other than moving away from the Bazel launcher, I don't see a way to solve this. We've wanted to stop using the bazel launcher anyways, so this isn't a big deal, this case just add additional pressure to do so.
Fundamentally, when a binary is running within another binary's runfiles, the logic to find things is a bit more convoluted. We can use RunEnvironmentInfo so that tests auto-inherit PATH, but this only helps tests. binaries-in-binaries or binaries-run-by-actions wouldn't be affected.
There are two workarounds:
- Set
--incompatible_strict_action_env=false(restore non-strict env behavior, which includes PATH) - Set
--action_env=PATH(only inherit PATH for actions)
- Vorherrschende Sprache
- Starlark
- Sterne
- 688
- Forks
- 728
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 99
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
-
pip.parse ignores uv.lock dependency-edge platform markersEvtl. vergeben @kdelalic hat das vor 2 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
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
bazel-contrib/rules_python#4278 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
bazel-contrib/rules_python#4269 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in bazel-contrib/rules_python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
area: ci-release effort: S good first issue P3 type: packaging
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
ferenyl/azuredevopstui#58 ·
-
harlan-agent-ready-to-implement routine:ci-review
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
harlan-zw/unlighthouse#454 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] The h5 and zarr extras allow versions that fail tensordict's tests or that pip marks as yankedOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
pytorch/tensordict#3274 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
githubnext/desktop-tools#192 ·
Maintainer antworten meist innerhalb von 1 Tag