-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
bazel: Update to 0.27.0 #7391
bazel: Update to 0.27.0 #7391
Conversation
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
This script is used for the hotrestart_test target, this makes it run with python3 instead of python2 Signed-off-by: Keith Smiley <[email protected]>
This depends on grailbio/bazel-compilation-database#30 |
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
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.
Thanks!
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.
(undo approval)
Hrm I'm not sure about the coverage failure here, any ideas? |
Signed-off-by: Keith Smiley <[email protected]>
Signed-off-by: Keith Smiley <[email protected]>
@keith this looks like it's a Python 3 thing in |
|
I've updated to that version here |
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.
LGTM modulo the coverage issue.
/wait
@htuch we do build it with bazel though https://github.com/keith/envoy/blob/953284d56f42dbe9fe89805441f9b0fc7479e362/ci/do_ci.sh#L247-L251 |
Signed-off-by: Keith Smiley <[email protected]>
Without both of these subpar thinks the main and src files don't match because the generated files end up in different subpaths of bazel-out because of the differences in toolchains Signed-off-by: Keith Smiley <[email protected]>
Ok I think I finally got par_binary to use the right python version with 0.27.0, we'll see tomorrow |
Finally green 🎉 |
@@ -246,7 +246,7 @@ elif [[ "$CI_TARGET" == "bazel.coverage" ]]; then | |||
|
|||
# gcovr is a pain to run with `bazel run`, so package it up into a | |||
# relocatable and hermetic-ish .par file. | |||
bazel build @com_github_gcovr_gcovr//:gcovr.par | |||
bazel build --python_version=PY2 @com_github_gcovr_gcovr//:gcovr.par |
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.
FYI, the Python version is always set by either --host_force_python
(for host-configured targets) or the python_version
attr of py_binary
/py_test
targets. If these are not explicitly specified they default to PY3
.
So setting --python_version
on the command line has no effect on executable Python targets. Its only use is to cause other targets (e.g. a py_library
, or some non-Python rule) to have PY2
or PY3
mode for the purposes of evaluating select()
s on the Python version and for deciding whether to use the -py2
output directory.
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.
@brandjon note this is required because of the genrule
that outputs the source file. Without this, when forcing py2 on this par_binary target, subpar believes that the main
file is not contained in the srcs
because it's not nested in the -py2
output directory.
You can reproduce this by running this command with and without this flag, without it subpar fails here https://github.com/google/subpar/blob/35bb9f0092f71ea56b742a520602da9b3638a24f/subpar.bzl#L29-L30
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 see, thanks.
Signed-off-by: Keith Smiley [email protected]