-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Python 2 tools in exec configuration don't work in Bazel 6.x #16935
Comments
@comius for d988e8b, which a bisect points to. @meteorcloudy Looks like a regression. |
If it's useful, we originally saw this regression in our custom rules that use |
@bazel-io flag |
This is caused by ordering of transitions, which happens in the following order:
With Bazel 6.0.0 the There are two options, how to handle python transition:
I decided for #1, because I thought it breaks less people. I assumed that most people were only using My blind spot was We can change the implementation to option #2. However, this will also change the behavior where people are still only using If we stick with #1, you might be able to mitigate by setting config flags. There might be other good arguments for #2. Code would be simpler, more idiomatic and it gives users per target control. (But it will also potentially break somebody). Maybe this issue is on its own a good argument to stop using PY2. |
@comius Didn't you also make |
Yes, there's no |
Fixes: bazelbuild#16935 RELNOTES[INC]: This changes the behavior of Python version in exec/host configuration. Mitigation is to set Python version on the targets. PiperOrigin-RevId: 493545843 Change-Id: I3a4d787e7075d2b76835faf04d4c4e04c9de85b4
@bazel-io fork 6.0.0 |
Fixes: bazelbuild#16935 RELNOTES[INC]: This changes the behavior of Python version in exec/host configuration. Mitigation is to set Python version on the targets. PiperOrigin-RevId: 493545843 Change-Id: I3a4d787e7075d2b76835faf04d4c4e04c9de85b4
Lets continue any py2-specific discussion in #15684, but you really really need to move off Python 2 |
Fixes: bazelbuild#16935 RELNOTES[INC]: This changes the behavior of Python version in exec/host configuration. Mitigation is to set Python version on the targets. PiperOrigin-RevId: 493545843 Change-Id: I3a4d787e7075d2b76835faf04d4c4e04c9de85b4
Fixes: #16935 RELNOTES[INC]: This changes the behavior of Python version in exec/host configuration. Mitigation is to set Python version on the targets. PiperOrigin-RevId: 493804390 Change-Id: I3a4d787e7075d2b76835faf04d4c4e04c9de85b4
Fixes: #16935 RELNOTES[INC]: This changes the behavior of Python version in exec/host configuration. Mitigation is to set Python version on the targets. PiperOrigin-RevId: 493804390 Change-Id: I3a4d787e7075d2b76835faf04d4c4e04c9de85b4 Co-authored-by: Googler <[email protected]>
Description of the bug:
When depending on a py_binary tool in
exec
configuration that usespython_version
to specify"PY2"
, it somehow still tries to run inPY3
configuration and causes a build failure. This issue is not present in Bazel5.3.0
.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create empty files
WORKSPACE
andtest.py
Put the following content in
BUILD
bazel build //:gen
Note that
bazel run //:test
works just fine since it doesn't involve an exec configuration, and inserting ansh_binary
rule in between the genrule and py_binary reveals that the issue is the failure of py_binary to apply an incoming edge transition (which it does apply correctly with Bazel 5.x).Which operating system are you running Bazel on?
No response
What is the output of
bazel info release
?release 6.0.0rc4
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
I'm pretty surprised that this issue leaked through this close to 6.x releasing, so it's possible I'm missing something obvious or misunderstanding how this is supposed to work.
Tagging @fmeum and @gregestren in case this is caused by other configuration transition changes in the 6.x window.
The text was updated successfully, but these errors were encountered: