-
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
Use real rules_python #17545
Use real rules_python #17545
Conversation
47fd43e
to
5fcef16
Compare
Initial motivation was to use py_proto_library from rules_python
11d9548
to
9fd53eb
Compare
This is great, I guess we can delete https://github.com/bazelbuild/bazel/tree/master/third_party/rules_python after merging this one? |
Hey, @meteorcloudy, Fails: Succeeds: |
It doesn't look like a caching issue, did you try to reproduce in the docker container? This is also failing on other platforms without RBE enabled |
I can reproduce the issue in the docker container (
|
I guess this is because I do have the protobuf pip package installed on my workstation, but not in the docker container:
|
Do we expect users to have protobuf pip package preinstalled when using py_proto_library? |
android-related changes LGTM (just //tools/python -> @rules_python replacement for tools/android/BUILD and tools/android/BUILD.tools). As long as presubmit passes then it should be fine. |
No, that's a bug that was fixed but hasn't been released yet (see bazelbuild/rules_python#1046). I'll do a 0.19 release Monday. To workaround it in the meantime...I'm not sure there's an easy way in the mock environment. The files are there in runfiles, the path to them just has to get onto sys.path. So either manually modify sys.path at runtime, or, maybe manually depend on the proto repo's py_library target (the bug causing the missing sys.path entry is in py_proto_library, so anything coming through that won't propagate the necessary sys.path entry) |
Thank @meteorcloudy for the analysis, it saved my day! I found out there is a bug, in py_proto_library. I worked around it and submitted a patch to rules_python. (bazelbuild/rules_python#1091) |
Ups, I missed comment from @rickeylev. My fix is not actually needed. |
Hi @comius, Could you please guide, Whether to import third-party changes first or the other changes in the CL. Thanks! |
Hey, I didn't realize before, but the import is more complex than I thought. I'll prepare separate parts for it. |
The file was removed in Bazel@HEAD in bazelbuild/bazel#17545 Addresses: bazelbuild/bazel#17874
Since bazelbuild/bazel#17545, bazel_tools apparantly requires rules_python and rules_proto to successfully parse under bazel (load lines only). We only use affected bazel_tools (src/main/protobuf) in persistentworkers. Import these repositories to reinstate downstream CI passing.
Since bazelbuild/bazel#17545, bazel_tools apparantly requires rules_python and rules_proto to successfully parse under bazel (load lines only). We only use affected bazel_tools (src/main/protobuf) in persistentworkers. Import these repositories to reinstate downstream CI passing. Ignore rules_oss_audit setup and invoke install_deps omitted from it in a generated.bzl (move maven here as well). Relocated all WORKSPACE-scope invocations to deps/defs/generated.
Since bazelbuild/bazel#17545, bazel_tools apparantly requires rules_python and rules_proto to successfully parse under bazel (load lines only). We only use affected bazel_tools (src/main/protobuf) in persistentworkers. Import these repositories to reinstate downstream CI passing. Ignore rules_oss_audit setup and invoke install_deps omitted from it in a generated.bzl (move maven here as well). Relocated all WORKSPACE-scope invocations to deps/defs/generated.
…1173) The file was removed in Bazel@HEAD in bazelbuild/bazel#17545 This fixes failures when using rules_python with Bazel@HEAD. Addresses: bazelbuild/bazel#17874
Initial motivation was to use py_proto_library from rules_python, but then a yak came along. Fixes: bazelbuild#9029 Closes bazelbuild#17545. PiperOrigin-RevId: 513834100 Change-Id: I11a99381e1169a9fb7a7a3eaa733ddd348ebac2b
Initial motivation was to use py_proto_library from rules_python, but then a yak came along.
Fixes: #9029