Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native_test + py_binary + Windows #2518

Open
tpudlik opened this issue Dec 20, 2024 · 1 comment
Open

native_test + py_binary + Windows #2518

tpudlik opened this issue Dec 20, 2024 · 1 comment

Comments

@tpudlik
Copy link
Contributor

tpudlik commented Dec 20, 2024

🐞 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 (bazelbuild/bazel-skylib#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

#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
@rickeylev
Copy link
Collaborator

Thanks for the repro. This error looks familiar to a weird bug report I saw filed against the builtin rules in bazel. So maybe this repro at least lets us figure out what the cause is.

The thing that comes to mind is: I seem to recall that the windows bootstrap expects, given blaze-bin/foo that there is a sibling file (i.e. bazel-bin/foo or bazel-bin/foo.zip depending on whether zip-builds are enabled or not (default true for windows)) to exist. Being as how native_test symlinks to the original executable, I wouldn't be surprised if that assumption doesn't hold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants