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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

--build_python_zip=false broken on Windows #1840

Open
KoltesDigital opened this issue Apr 11, 2024 · 5 comments
Open

--build_python_zip=false broken on Windows #1840

KoltesDigital opened this issue Apr 11, 2024 · 5 comments

Comments

@KoltesDigital
Copy link

馃悶 bug report

Affected Rule

The issue is caused by the function **_transition_py_impl** so impacts **py_binary** and **py_test**.

Is this a regression?

The bug was not present with WORKSPACE method.

Description

I can't use --build_python_zip=false anymore.

However this might not be a bad thing. I've put that in .bazelrc a long time ago, when I had some troubles with caches. Maybe this is not needed anyway.

馃敩 Minimal Reproduction

Any repo using rules_python with bzlmod on Windows, I guess.

馃敟 Exception or Error


ERROR: C:/.../BUILD:X:X: in _transition_py_binary rule //:requirements.update:
Traceback (most recent call last):
        File "C:/.../external/rules_python~/python/config_settings/transition.bzl", line 57, column 28, in _transition_py_impl
                ctx.actions.symlink(
Error in symlink: Exactly one of "target_file" or "target_path" is required
ERROR: C:/.../BUILD:X:X: Analysis of target '//:requirements.update' failed

From what I understand, because zipfile is still None, because the previous loop didn't find any zip file in the runfiles.

馃實 Your Environment

Operating System: Windows 10 x64
Output of bazel version:

  
Build label: 7.1.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Mar 21 18:11:32 2024 (1711044692)
Build timestamp: 1711044692
Build timestamp as int: 1711044692
  

Rules_python version: 0.31.0

@KoltesDigital
Copy link
Author

Well, now binaries/tests are incredibly slow. Good reminder why I was using it.

@KoltesDigital
Copy link
Author

It may not be linked to bzlmod after all, because it only adds an extension of top of previous functions. Surely this is due to upgrading from 0.19.0 馃槃

@KoltesDigital KoltesDigital changed the title bzlmod doesn't support --build_python_zip=false on Windows --build_python_zip=false broken on Windows Apr 26, 2024
@KoltesDigital
Copy link
Author

Still not working with 0.32.2.

@aignas
Copy link
Collaborator

aignas commented May 15, 2024

Could you test if this is still not working well with 0.29.0 please? That is before we switched to starlark implementation of the rules.

@KoltesDigital
Copy link
Author

@aignas Well, I tried to bisect. The flag still works in version 0.25.0, with only bazel_dep in MODULE.bazel and the pip deps kept in WORKSPACE. But 0.26.0 had a weird dep cycle so I moved everything into MODULE.bazel, and then the flag doesn't work. So I couldn't tell if it's related to the version in itself, or to the switch to bzlmod.

As a side note, the code dealing with the zips has been added in 0.15.0.

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