bazel-contrib / bazel-contrib/rules_python

native_test + py_binary + Windows

オープン
#2,518 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Starlark
スター
688
フォーク
721
平均マージ
15時間 7分
マージ済み PR(30日)
76

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

examples/bzlmod にある Windows 非対応のテスト、//py_proto_library:external_import_test から始め、native_test で py_binary をラップしたときの失敗を再現します。生成された runfiles パスと、報告されたエラーにある欠落した .zip パスを比較します。target_compatible_with で除外せずに Windows 上でテストが正常に実行できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system, operating-systems, testing
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。