-
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
[Bootstrap Template] Fixed bootstrap template not being passed to py_binary from py_runtime on bazel latest #18103
[Bootstrap Template] Fixed bootstrap template not being passed to py_binary from py_runtime on bazel latest #18103
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
cc @rickeylev should be a relatively simple fix. |
Ah that must have gotten lost when rewriting the java to starlark and a following refactor. Yeah, simple fix. |
@ankit-agarwal1999, as PR is awaiting to merge, could you please fix the above buildkite errors? Thanks! |
@@ -290,11 +290,13 @@ def _expand_bootstrap_template( | |||
|
|||
if runtime: | |||
shebang = runtime.stub_shebang | |||
template = runtime.bootstrap_template |
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.
It looks like just one test is failing because bootstrap template is None, which makes sense -- the test is specifically testing a manually created PyRuntimeInfo. It's expected that PyRuntimeInfo.bootstrap_template is set; Normally this is handled by the py_runtime rule, but the test is specifically checking for a custom implementation.
This is around the line you'll need to modify:
https://cs.opensource.google/bazel/bazel/+/master:src/test/java/com/google/devtools/build/lib/rules/python/PythonStarlarkApiTest.java;l=120;drc=17827eee79808fceb6558d632c5b5594e8e9a47a
The net changes should be something like:
- In the call to PyRuntimeInfo(), add
bootstrap_template=ctx.file.bootstrap_template
- A couple lines below, to the
userruntime
rule definition, add'bootstrap_template': attr.label_list(allow_files=True)
- A couple lines below, in the call to
userruntime()
addbootstrap_template='bootstrap.txt'
And bazel test //src/test/java/com/google/devtools/build/lib/rules/python:PythonStarlarkApiTest
Thanks for the help @rickeylev I think I was able to get it to work. The test passes when I run it locally. |
@Pavank1992 tests are fixed |
…y_runtime on bazel latest This PR fixes a small bug where the bootstrap template runtime file was not being passed to Py Binary. This broke the bootstrap template feature on bazel latest authored in bazelbuild#16806 Closes bazelbuild#18103. PiperOrigin-RevId: 525042380 Change-Id: I8b8a200634eb98e156b4d8ba6b2e5baef5d06c73
This PR fixes a small bug where the bootstrap template runtime file was not being passed to Py Binary. This broke the bootstrap template feature on bazel latest authored in #16806