bazel-contrib / bazel-contrib/rules_python

native_test + py_binary + Windows

Aperta
#2,518 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

# 🐞 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the Windows-incompatible test in examples/bzlmod, //py_proto_library:external_import_test, and reproduce the native_test wrapping py_binary failure. Compare the generated runfiles path with the missing .zip path in the reported error; done means the test runs successfully on Windows without target_compatible_with excluding it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system, operating-systems, testing
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.