Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`compile_pip_requirements` fails because setuptools contains file with spaces in name

Offen
#3,681 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
python
Bereich
build-system

Rechercherichtung

Beginne damit, bazel run //:requirements.update mit der gezeigten compile_pip_requirements-Konfiguration zu reproduzieren, und untersuche, wie die Regel den setuptools-Pfad Lorem ipsum.txt behandelt. Prüfe das generierte Runfiles-Manifest und die zugehörigen Einstiegspunkte der Regel. Erledigt ist die Aufgabe, wenn das Ziel zur Aktualisierung der Requirements erfolgreich erstellt wird, sobald eine Abhängigkeit einen Dateinamen mit Leerzeichen enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

🐞 bug report

Affected Rule

compile_pip_requirements when ran with bazel run //:requirements.update

Is this a regression?

Not sure. Similar issue is #4605.

Description

My BUILD file contains the following -

load("@rules_python//python:pip.bzl", "compile_pip_requirements")
compile_pip_requirements(
    name = "requirements",
    src = "requirements.in",
    requirements_txt = "requirements_lock.txt",
)

The issue seems to be that the file "pypi__setuptools/setuptools/_vendor/jaraco/text/Lorem ipsum.txt" used by setuptools has a space in the name and Bazel won't accept that.

I am using USE_BAZEL_VERSION=7.3.2. With MODULE having -

bazel_dep(name = "rules_python", version = "1.8.5")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    python_version = "3.13",
)

🔬 Minimal Reproduction

bazel run //:requirements.update

🔥 Exception or Error


BUILD.bazel:31:25: Creating runfiles tree bazel-out/k8-fastbuild/bin/requirements.update.runfiles failed: build-runfiles failed: error executing  command 

  (cd /home/rishin/.cache/bazel/_bazel_rishin/a5698ab7503342d8072bd8e495f01f91/execroot/_main && \

  exec env - \

    PATH=/home/rishin/.cache/bazelisk/downloads/sha256/96e9c34caf77b25a2fe1f0699cb85d23226a7a9f563ac156f0ed2033402b080b/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin \

  /home/rishin/.cache/bazel/_bazel_rishin/install/aeea4605fbb10c56d04772b8e314db75/build-runfiles --allow_relative bazel-out/k8-fastbuild/bin/requirements.update.runfiles_manifest bazel-out/k8-fastbuild/bin/requirements.update.runfiles): Process exited with status 1: Process exited with status 1

/home/rishin/.cache/bazel/_bazel_rishin/install/aeea4605fbb10c56d04772b8e314db75/build-runfiles (args bazel-out/k8-fastbuild/bin/requirements.update.runfiles_manifest bazel-out/k8-fastbuild/bin/requirements.update.runfiles): link or target filename contains space on line 937: '_main/external/rules_python~~config~pypi__setuptools/setuptools/_vendor/jaraco/text/Lorem ipsum.txt /home/rishin/.cache/bazel/_bazel_rishin/a5698ab7503342d8072bd8e495f01f91/external/rules_python~~config~pypi__setuptools/setuptools/_vendor/jaraco/text/Lorem ipsum.txt'
Target //:requirements.update failed to build 

🌍 Your Environment

Operating System: 11.8.5

Output of bazel version:

  
Bazelisk version: v1.27.0
Starting local Bazel server and connecting to it...
Build label: 7.3.2
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Oct 1 17:46:05 2024 (1727804765)
Build timestamp: 1727804765
Build timestamp as int: 1727804765
  

Rules_python version: 1.8.5

Vorherrschende Sprache
Starlark
Sterne
688
Forks
724
Ø Merge
1 T. 21 Std.
Gemergte PRs (30 T.)
48

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus bazel-contrib/rules_python

Alle Issues in bazel-contrib/rules_python

Ähnliche Issues

Weitere Issues zu Build System

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.