-
Notifications
You must be signed in to change notification settings - Fork 541
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
fix(windows): symlink bootstrap script when not building zip #2015
Conversation
Ah, this is in transition.bzl? So it's the combination of windows + build_zip=false + multi-version rules. Yeah, I think I understand what's going on here. For windows builds, it creates a The Or, actually, we should be able to check the flag and use that to decide. Do you need this to work with Bazel 6, or Bazel 7 with the pystar rules disabled? If not, then we have some more options to fix this.
We have a windows CI, but yeah, our windows support is a bit spotty, and our integration tests are a bit light. An analysis test for this should be doable, though |
@rickeylev thanks for the review! I'm still new to the multi version thing, I think the transition rule applies the version selection and need an output, so it has been chosen to just symlink the output of the actual rule. Hence the error, because the bootstrap script wasn't symlinked. And I'm new to the whole repo as well. I can try changing the logic as you suggested, but it may be out of my understanding. Regarding the call to I'm on Bazel 7+ and I have no idea what pystar is. My .bazelrc merely contains Agreed for the CI, I should have read something unrelated. I guess analysis test means a test that triggers a rule. Where are they located? |
So that calling `to_list()` is faster.
@rickeylev updated as you suggested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a basic analysis test, this allows checking the outputs being produced. It currently fails because, well, it doesn't look like the outputs are correct. I think this is behavior existing before your PR, though, and I'm surprised this works at all, zip true or false, for windows?
In any case, we don't need to fully address that in this PR (out of scope).
The way the logic is written is a bit hard to follow, though, so I'd like that cleaned up a bit; see inline comment
add basic analysis tests
a6f8fbf
to
170f765
Compare
@rickeylev well thanks for having done it :) Your last commit left both logic in place, so I've continued the refactor a bit further. Agreed it's more readable. Feel free to squash. Going further, I was wondering why the bootstrap script should not be executable, because it starts with a shebang. Even if it's ignored on Windows. I realized that both targets are generated as executable, so I removed the variable. |
I'm worried by the CICD: |
Good observation! SGTM
Oh yeah. That is because the I think we could infer the state based on if there is a |
Thanks for the explanation! Regarding what to do now, well, you're contributor and I'm only user so long term view is yours. But it seems I've been the only one to stumble across the bug so far, and I'm on 7+, so I'm fine with the later choice. If someone later complains on 6, just say "meh, upgrade". Kind of kidding, but as far as I remember, I haven't noticed the upgrade to 7, it just worked as before. Whereas the migration to bzlmod required some work, but 7 still supports the WORKSPACE way. |
As a user that's blocked from upgrading to a later version of For us, |
@criemen until the PR is accepted and a new version is released, I'm already using it on prod using a local registry. You could also use a local override with a git submodule. At least two temporary ways to allow you to upgrade. |
You can also use single_version_override and apply this PR as a patch to unblock your move to bazel 7, etc.
…On 5 July 2024 08:16:00 GMT+09:00, "Jonathan Giroux (Koltes)" ***@***.***> wrote:
@criemen until the PR is accepted and a new version is released, I'm already using it on prod using a local registry. You could also use a local override with a git submodule. At least two temporary ways to allow you to upgrade.
--
Reply to this email directly or view it on GitHub:
#2015 (comment)
You are receiving this because your review was requested.
Message ID: ***@***.***>
|
I made the implementation work with both Bazel 6 and Bazel 7. I had to lighten the tests for Bazel 6, but that's NBD. Let's see what CI thinks. |
@aignas talking about BTW, I noticed the central registry is late on the versions. 0.34.0 has been released a few days ago, but https://registry.bazel.build/modules/rules_python is still at 0.33.2. |
This fixes #1840 by supporting again
--build_python_zip=false
on Windows.When the zip file isn't build, the transition executable looks for the eponymous bootstrap script but the latter doesn't exist. I've just added a symlink, and refactored a bit because logic would have been duplicated.
It seems you don't run CICD on Windows. FWIW I've manually tested it, both with
build_python_zip
astrue
andfalse
.