bazel-contrib / bazel-contrib/rules_python
Missing files when running with `venvs_site_packages=yes`
- Langage dominant
- Starlark
- Étoiles
- 688
- Forks
- 721
- Merge moyen
- 15 h 7 min
- PR mergées (30 j)
- 76
Description
When I try to run `bazel build @rules_python//python/config_settings:venvs_site_packages=yes //...` I see the following output from one of my internal usages of `py_wheel`:
```
INFO: Invocation ID: 45e6114d-6e00-443c-95d4-ae1757315abd
ERROR: /Users/frank/workspace/yobi/data-alt-2/tools/runnable/examples/python/BUILD:10:17: Building wheel @@//tools/runnable/examples/python:example_app_deploy_wheel failed: (Exit 1): sandbox-exec failed: error executing PyWheel command
(cd /private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
TMPDIR=/var/folders/kb/_rxq15gs3gq21765gfcbbdjw0000gn/T/ \
/usr/bin/sandbox-exec -f /private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/sandbox.sb /var/tmp/_bazel_fp/install/f96a4af1851d4fb5dafa59d311169545/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/stats.out' bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker --name example_app --version 0 --python_tag py3 --abi none --platform any --out bazel-out/darwin_arm64-fastbuild/bin/tools/runnable/examples/python/example_app-0-py3-none-any.whl --name_file bazel-out/darwin_arm64-fastbuild/bin/tools/runnable/examples/python/example_app_deploy_wheel.name --input_file_list bazel-out/darwin_arm64-fastbuild/bin/tools/runnable/examples/python/example_app_deploy_wheel_target_wrapped_inputs.txt --metadata_file bazel-out/darwin_arm64-fastbuild/bin/tools/runnable/examples/python/example_app_deploy_wheel.metadata.txt --entry_points_file bazel-out/darwin_arm64-fastbuild/bin/tools/runnable/examples/python/example_app_deploy_wheel_entry_points.txt)
Traceback (most recent call last):
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/_main/../rules_python+/tools/_wheelmaker_stage2_bootstrap.py", line 506, in
main()
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/_main/../rules_python+/tools/_wheelmaker_stage2_bootstrap.py", line 500, in main
_run_py_path(main_filename, args=sys.argv[1:])
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/_main/../rules_python+/tools/_wheelmaker_stage2_bootstrap.py", line 287, in _run_py_path
runpy.run_path(main_filename, run_name="__main__")
File "", line 286, in run_path
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/rules_python+/tools/wheelmaker.py", line 660, in
main()
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/rules_python+/tools/wheelmaker.py", line 560, in main
maker.add_file(package_filename, real_filename)
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/rules_python+/tools/wheelmaker.py", line 323, in add_file
self._whlfile.add_file(package_filename, real_filename)
File "/private/var/tmp/_bazel_fp/01684213bb9c693047272ec8f0247481/sandbox/darwin-sandbox/5853/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_python+/tools/wheelmaker.runfiles/rules_python+/tools/wheelmaker.py", line 173, in add_file
with open(real_filename, "rb") as fsrc:
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'bazel-out/darwin_arm64-fastbuild/bin/tools/runnable/examples/python/_example_app_bin.venv/lib/python3.12/site-packages/attr'
INFO: Elapsed time: 2.497s, Critical Path: 2.02s
INFO: 79 processes: 53 action cache hit, 79 internal.
ERROR: Build did NOT complete successfully
```
I am still investigating whether this is user error and whether I may have been doing something "unofficial" without declaring formal runfiles deps, but wanted to post this early since I know there is a lot of ongoing work for this feature.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire la commande `bazel build @rules_python//python/config_settings:venvs_site_packages=yes //...` et inspectez les entrées de l’action `py_wheel`. Lisez `tools/wheelmaker.py` et le point d’entrée `wheelmaker` autour de l’appel `add_file` qui échoue, puis déterminez pourquoi le chemin généré `_example_app_bin.venv/lib/python3.12/site-packages/attr` est absent. Le travail est terminé lorsque la construction du wheel réussit avec `venvs_site_packages=yes` et inclut les fichiers attendus.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- build-system
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100