Debug sphinxdocs build fails when target is in root dir
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 88/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Domaine
- build-system, documentation
Piste de recherche
Inspectez sphinxdocs/private/sphinx_run_template.sh et _sphinx_run_impl dans sphinxdocs/private/sphinx.bzl, puis reproduisez le comportement avec le checkout documenté et bazelisk run :code.run. C’est terminé lorsqu’une cible binaire sphinx dans le paquet racine s’exécute correctement via le runner de débogage généré, sans l’erreur env: ‘build’.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
🐞 bug report
(I let an agent generate this report. I've verified the minimal repro steps as well as the workaround.)
Affected Rule
The issue is caused by the rule: sphinx_docs / sphinx_run (@sphinxdocs//sphinxdocs:sphinx.bzl)
Is this a regression?
No.
Description
When a sphinx_docs target specifies a sphinx binary target defined in the root package of the main repository (e.g., //:build), building the docs normally (bazel build :code) succeeds, but running the generated debug runner target (bazel run :code.run) fails with env: ‘build’: No such file or directory.
Root cause:
- In
_sphinx_run_impl(sphinxdocs/private/sphinx.bzl),%SPHINX_RUNFILES_PATH%insphinx_run_template.shis substituted withsphinx[DefaultInfo].files_to_run.executable.short_path. - When the
sphinxbinary target is in the root package (//:build), itsshort_pathis"build"(which contains no/directory separator). - At runtime,
code.runexecutes in its runfiles directory (code.run.runfiles/_main) and resolves$sphinx:
Becausefor path in "build" "bazel-out/k8-opt-exec/bin/build"; do if [[ -e $path ]]; then sphinx=$path break fi donebuildexists in the current working directory,[[ -e "build" ]]succeeds and setssphinx="build". - Finally,
code.runruns:
Becauseexec env "${sphinx_env[@]}" -- "$sphinx" "${args[@]}" "$@" "$source_dir" "$output_dir""build"does not contain a slash (/),env(execvp) searches$PATHinstead of the current working directory and fails withenv: ‘build’: No such file or directory.
Suggested fix:
In sphinxdocs/private/sphinx_run_template.sh, prefix ./ when checking/assigning relative paths (e.g., for path in "./%SPHINX_RUNFILES_PATH%" "./%SPHINX_EXEC_PATH%"; do or sphinx="./$path").
🔬 Minimal Reproduction
git clone https://github.com/kaycebasques/experiments.git
cd experiments
git checkout 8bd9278d07ee7a8da916941e967e5f20b5354f7a
cd 20260930
bazelisk build :code # succeeds
bazelisk run :code.run # fails
(Workaround: in 20260930/BUILD.bazel, renaming the binary target from name = "build" to name = "bin/build" or moving it into a subpackage so short_path contains a / makes bazel run :code.run succeed.)
🔥 Exception or Error
INFO: Running command line: bazel-bin/code.run
+ exec env -- build --show-traceback --builder=html --fail-on-warning _code/_sources /tmp/sphinx-out
env: ‘build’: No such file or directory
🌍 Your Environment
Operating System:
Linux (Debian x86_64)
Output of bazel version:
Bazelisk version: v1.28.1
Build label: 9.2.0
Rules_python version:
rules_python: 1.8.5
sphinxdocs: 2.2.0
Anything else relevant?
N/A
- Langage dominant
- Starlark
- Étoiles
- 688
- Forks
- 724
- Merge moyen
- 1 j 14 h
- PR mergées (30 j)
- 59
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de bazel-contrib/rules_python
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
bazel-contrib/rules_python#4164 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
go:embed stdlib_list.txt file in gazelle/python/std_modules.go is missingPeut-être pris @udaya2899 l’a pris il y a 13 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
bazel-contrib/rules_python#3821 ·
Les mainteneurs répondent en général sous 1 jour
-
Bazel 7 native py_binary: startup and import failures with rules_python 2.4.1Peut-être pris @gleyba l’a pris il y a 3 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
bazel-contrib/rules_python#4234 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 28/100
bazel-contrib/rules_python#4218 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
type: toolchain
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
bazel-contrib/rules_python#4216 · 6 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de bazel-contrib/rules_python
Issues similaires
-
wanted: [email protected]Ouvertemodule wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
bazelbuild/bazel-central-registry#11070 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
FujiNetWIFI/fujinet-firmware#1932 ·
Les mainteneurs répondent en général sous 1 jour
-
ci dependencies
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
sipyourdrink-ltd/bernstein#6479 ·
Les mainteneurs répondent en général sous 1 jour
-
backend bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
Android: build fails with Android Gradle Plugin 9 (kotlinOptions, lintOptions, proguard-android.txt)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
capacitor-community/stripe#544 ·
Les mainteneurs répondent en général sous 1 jour