bazel-contrib / bazel-contrib/rules_python

native_test + py_binary + Windows

Đang mở
#2,518 3 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Starlark
Star
688
Fork
721
Merge trung bình
15 giờ 7 phút
Pull request đã merge (30 ngày)
76

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bài kiểm thử không tương thích với Windows trong examples/bzlmod, //py_proto_library:external_import_test, và tái hiện lỗi native_test bọc py_binary. So sánh đường dẫn runfiles được tạo với đường dẫn .zip bị thiếu trong lỗi được báo cáo; hoàn tất khi bài kiểm thử chạy thành công trên Windows mà không bị target_compatible_with loại trừ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system, operating-systems, testing
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.