bazel-contrib / bazel-contrib/rules_python
native_test + py_binary + Windows
- Lenguaje dominante
- Starlark
- Estrellas
- 688
- Forks
- 721
- Merge medio
- 15 h 7 min
- PR fusionados (30 d)
- 76
Descripción
# 🐞 bug report
### Affected Rule
The issue is caused by the rule: `py_binary`
### Is this a regression?
I don't believe so, although `native_test` was introduced specifically to support Windows (https://github.com/bazelbuild/bazel-skylib/issues/148), so it's surprising that it fails on this OS.
### Description
Attempting to run a `native_test` wrapping a `py_binary` on Windows produces errors.
## 🔬 Minimal Reproduction
https://github.com/bazelbuild/rules_python/pull/2516 introduced a new test in `examples/bzlmod`, `//py_proto_library:external_import_test`. This test is marked incompatible with Windows (via `target_compatible_with`) because it fails on Windows.
## 🔥 Exception or Error
https://buildkite.com/bazel/rules-python-python/builds/10080#0193e584-8c2e-4cf4-8c53-9f339641422d
C:/b/7bjinhbd/external/rules_python~~python~python_3_9_x86_64-pc-windows-msvc/python.exe: can't open file 'C:\b\7bjinhbd\execroot\_main\bazel-out\x64_windows-fastbuild\bin\py_proto_library\external_import_test.exe.runfiles\_main\py_proto_library\external_import_test.zip': [Errno 2] No such file or directory
Guía de contribución
Línea de trabajo
Comienza con la prueba incompatible con Windows en examples/bzlmod, //py_proto_library:external_import_test, y reproduce el fallo de native_test al envolver py_binary. Compara la ruta de runfiles generada con la ruta .zip ausente del error informado; se considera terminado cuando la prueba se ejecuta correctamente en Windows sin que target_compatible_with la excluya.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- build-system, operating-systems, testing
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100