Status Update
Comments
am...@google.com <am...@google.com> #2
First issue:
ERROR: Error loading '@@bazel_tools//tools/android:android_extensions.bzl' for module extensions, requested by https://bcr.bazel.build/modules/rules_jvm_external/6.2/MODULE.bazel:38:42: Label '@@bazel_tools//tools/android:android_extensions.bzl' is invalid because 'tools/android' is not a package; perhaps you meant to put the colon here: '@@bazel_tools//tools:android/android_extensions.bzl'?: Label '@@bazel_tools//tools/android:android_extensions.bzl' is invalid because 'tools/android' is not a package; perhaps you meant to put the colon here: '@@bazel_tools//tools:android/android_extensions.bzl'?. Type 'bazel help mod' for syntax and help.
Probably need to reference rules_android
am...@google.com <am...@google.com> #3
Weirdly, a bazel_dep
on rules android seems to not be working properly:
$ bazel build //...
WARNING: For repository 'com_google_protobuf', the root module requires module version protobuf@24.4, but got protobuf@27.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.0.10, but got rules_cc@0.0.12 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'protobuf' found. This will result in a failure if there's a reference to those rules or symbols.
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:24:15: name 'ApkInfo' is not defined (did you mean 'PyInfo'?)
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:25:34: name 'AndroidInstrumentationInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:26:28: name 'AndroidResourcesInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:27:29: name 'AndroidNativeLibsInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:28:38: name 'AndroidApplicationResourceInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:29:35: name 'AndroidBinaryNativeLibsInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:30:22: name 'AndroidSdkInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:31:27: name 'AndroidManifestInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:32:25: name 'AndroidAssetsInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:33:29: name 'AndroidLibraryAarInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:34:27: name 'AndroidProguardInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:35:22: name 'AndroidIdlInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:36:22: name 'AndroidIdeInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:37:28: name 'AndroidPreDexJarInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:38:31: name 'AndroidCcLinkParamsInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:39:25: name 'DataBindingV2Info' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:40:46: name 'AndroidLibraryResourceClassJarProvider' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:41:29: name 'AndroidFeatureFlagSet' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:42:27: name 'ProguardMappingInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:43:25: name 'AndroidBinaryData' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:44:31: name 'BaselineProfileProvider' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:45:41: name 'AndroidNeverLinkLibrariesProvider' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:46:31: name 'AndroidOptimizedJarInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:47:22: name 'AndroidDexInfo' is not defined
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/reexport_providers.bzl:48:31: name 'AndroidOptimizationInfo' is not defined
WARNING: Target pattern parsing failed.
ERROR: Skipping '//...': error loading package under directory '': error loading package 'pw_hdlc/java/main/dev/pigweed/pw_hdlc': at /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/rules.bzl:39:5: at /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/providers.bzl:16:6: compilation of module 'rules/reexport_providers.bzl' failed
ERROR: error loading package under directory '': error loading package 'pw_hdlc/java/main/dev/pigweed/pw_hdlc': at /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/rules.bzl:39:5: at /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/rules_android+/rules/providers.bzl:16:6: compilation of module 'rules/reexport_providers.bzl' failed
INFO: Elapsed time: 1.391s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
am...@google.com <am...@google.com> #5
Unfortunately, it looks like rules_android_ndk
itself needs to be updated still, the latest release is insufficient.
Effectively blocked by
Edit: There's no older versions to choose from, unfortunately. The only two bzlmod compatible versions appear to have this issue.
am...@google.com <am...@google.com> #6
ah...@google.com <ah...@google.com> #7
Hi, rules_android 0.6.0 is being prepared this week that should address (we think) all compatibility issues with bazel 8. We can then update rules_jvm_external, rules_kotlin, and rules_android_ndk
jc...@google.com <jc...@google.com> #9
FYI, we just uploaded
tp...@google.com <tp...@google.com> #10
Couple comments based on my independent attempt at upgrading to Bazel 8 (
- We don't really need
rules_android
. We haveandroid_library
targets in Pigweed, but they're alltags = ["manual"]
and exist only for Copybara into google3. (They do build in google3, but never built with Bazel in OSS.) So if gettingandroid_library
to build in OSS is hard, we can just introduce a stub implementation for upstream. - However,
https://github.com/bazelbuild/rules_cc/pull/267 is a blocker (we're not compatible with the newest rules_cc, 0.0.17, and Bazel 8 somehow upgrades us by default). - I also ran into some issues with
--incompatible_disallow_empty_glob
. I thought "let me just fix all the errors this throws up", but I think I got a false positive? (The glob sure looks like it should return some files!) I'll file an issue on GH if that's indeed the case.
am...@google.com <am...@google.com> #11
IIRC I had a short-term workaround for the rules_cc incompatibility. That PR was mostly just a step towards more conclusively solving the discrepancy.
tp...@google.com <tp...@google.com> #12
am...@google.com <am...@google.com> #13
Made progress, the only issue I'm hitting now is a protoc crash:
ERROR: /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/external/nanopb+/BUILD.bazel:88:17: ProtoCompile external/nanopb+/generator/proto/google/protobuf/descriptor_pb2.py [for tool] failed: (Aborted): protoc failed: error executing ProtoCompile command (from target @@nanopb+//:descriptor_py_proto_genproto)
(cd /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/sandbox/darwin-sandbox/4943/execroot/_main && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
bazel-out/darwin_x86_64-opt-exec-ST-d57f47055a04/bin/external/protobuf+/protoc '--python_out=bazel-out/darwin_x86_64-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/generator/proto' -Iexternal/nanopb+/generator/proto external/nanopb+/generator/proto/google/protobuf/descriptor.proto)
# Configuration: 48002e13bf69599bc76da09be27c256b8f3383a2af0c04c9551762172433b540
# Execution platform: @@platforms//host:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
F1205 13:25:46.556696 2276387 generator.cc:471] Check failed: feature_set != nullptr Malformed descriptor.proto doesn't contain google.protobuf.FeatureSet
*** Check failure stack trace: ***
@ 0x101715cd3 absl::lts_20240116::log_internal::LogMessage::PrepareToDie()
@ 0x101715738 absl::lts_20240116::log_internal::LogMessage::SendToLog()
@ 0x101714deb absl::lts_20240116::log_internal::LogMessage::Flush()
@ 0x101715f15 absl::lts_20240116::log_internal::LogMessageFatal::~LogMessageFatal()
@ 0x101715f35 absl::lts_20240116::log_internal::LogMessageFatal::~LogMessageFatal()
@ 0x1013feae5 google::protobuf::compiler::python::Generator::GetResolvedFeatures<>()
@ 0x1013fdb23 google::protobuf::compiler::python::Generator::PrintResolvedFeatures()
@ 0x1013fbe72 google::protobuf::compiler::python::Generator::Generate()
@ 0x10147735f google::protobuf::compiler::CodeGenerator::GenerateAll()
@ 0x1010e31b6 google::protobuf::compiler::CommandLineInterface::GenerateOutput()
@ 0x1010df749 google::protobuf::compiler::CommandLineInterface::Run()
@ 0x10108eb0c google::protobuf::compiler::ProtobufMain()
@ 0x10108ed42 main
@ 0x7ff805651345 start
ERROR: /Users/amontanez/development/projects/pigweed/pigweed/pw_rpc/BUILD.bazel:485:21 Compiling pw_rpc/pw_rpc_test_protos/test.pb.c failed: (Aborted): protoc failed: error executing ProtoCompile command (from target @@nanopb+//:descriptor_py_proto_genproto)
(cd /private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/sandbox/darwin-sandbox/4943/execroot/_main && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
bazel-out/darwin_x86_64-opt-exec-ST-d57f47055a04/bin/external/protobuf+/protoc '--python_out=bazel-out/darwin_x86_64-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/generator/proto' -Iexternal/nanopb+/generator/proto external/nanopb+/generator/proto/google/protobuf/descriptor.proto)
# Configuration: 48002e13bf69599bc76da09be27c256b8f3383a2af0c04c9551762172433b540
# Execution platform: @@platforms//host:host
am...@google.com <am...@google.com> #14
I suspect this crash will go away once we've updated nanopb.
tp...@google.com <tp...@google.com> #15
Yes, this looks like a mismatch between the nanopb and protobuf versions. I'm hoping to upgrade nanopb this week (
am...@google.com <am...@google.com> #16
Also, I did have to disable --incompatible_disallow_empty_glob
because of the Fuchsia SDK:
am...@google.com <am...@google.com> #18
Drat, now we're tripping over this:
ERROR: @@bazel_tools//tools/cpp:cc_configure.bzl does not export a module extension called cc_configure_extension, yet its use is requested at https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel:22:29
<root> (pigweed@0.0.1)
ERROR: Results may be incomplete as 1 extension failed.
am...@google.com <am...@google.com> #19
Someone else hit the re2 issue and added a BCR-specific patch for the issue, added the workaround to the WIP CL.
am...@google.com <am...@google.com> #20
Latest update, hitting a crash when Bazel tries to update the lockfile:
$ bazel build //pw_build/...
Starting local Bazel server and connecting to it...
WARNING: For repository 'com_google_protobuf', the root module requires module version protobuf@28.2, but got protobuf@29.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: WORKSPACE support will be removed in Bazel 9 (late 2025), please migrate to Bzlmod, see https://bazel.build/external/migration.
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
WARNING: /Users/amontanez/development/projects/pigweed/pigweed/pw_toolchain/arm_gcc/BUILD.bazel:370:10: in toolchain rule //pw_toolchain/arm_gcc:arm_gcc_cc_toolchain_cortex-m33+nofp: target '//pw_toolchain/arm_gcc:arm_gcc_cc_toolchain_cortex-m33+nofp' depends on deprecated target '//pw_build/constraints/arm:cortex-m33+nofp': FPU properties should be expressed with different constraints
WARNING: /Users/amontanez/development/projects/pigweed/pigweed/pw_toolchain/arm_gcc/BUILD.bazel:343:10: in toolchain rule //pw_toolchain/arm_gcc:arm_gcc_cc_toolchain_cortex-m4+nofp: target '//pw_toolchain/arm_gcc:arm_gcc_cc_toolchain_cortex-m4+nofp' depends on deprecated target '//pw_build/constraints/arm:cortex-m4+nofp': FPU properties should be expressed with different constraints
INFO: Analyzed 55 targets (254 packages loaded, 15823 targets configured).
INFO: Found 55 targets...
INFO: Elapsed time: 28.115s, Critical Path: 0.17s
INFO: 44 processes: 175 action cache hit, 44 internal.
INFO: Build completed successfully, 44 total actions
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.NullPointerException: Cannot invoke "com.google.devtools.build.lib.bazel.bzlmod.RepoRuleId.toString()" because "repoRuleId" is null
at com.google.devtools.build.lib.bazel.bzlmod.GsonTypeAdapterUtil$4.write(GsonTypeAdapterUtil.java:114)
at com.google.devtools.build.lib.bazel.bzlmod.GsonTypeAdapterUtil$4.write(GsonTypeAdapterUtil.java:111)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:73)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$2.write(ReflectiveTypeAdapterFactory.java:247)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:490)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:73)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:253)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:154)
at com.google.devtools.build.lib.bazel.bzlmod.DelegateTypeAdapterFactory$1.write(DelegateTypeAdapterFactory.java:128)
at com.google.devtools.build.lib.bazel.bzlmod.LockFileModuleExtension_GsonTypeAdapter.write(LockFileModuleExtension_GsonTypeAdapter.java:108)
at com.google.devtools.build.lib.bazel.bzlmod.LockFileModuleExtension_GsonTypeAdapter.write(LockFileModuleExtension_GsonTypeAdapter.java:17)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:73)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:253)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:154)
at com.google.devtools.build.lib.bazel.bzlmod.DelegateTypeAdapterFactory$1.write(DelegateTypeAdapterFactory.java:128)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:73)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:253)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:154)
at com.google.devtools.build.lib.bazel.bzlmod.DelegateTypeAdapterFactory$1.write(DelegateTypeAdapterFactory.java:128)
at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileValue_GsonTypeAdapter.write(BazelLockFileValue_GsonTypeAdapter.java:78)
at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileValue_GsonTypeAdapter.write(BazelLockFileValue_GsonTypeAdapter.java:15)
at com.google.gson.Gson.toJson(Gson.java:944)
at com.google.gson.Gson.toJson(Gson.java:899)
at com.google.gson.Gson.toJson(Gson.java:848)
at com.google.gson.Gson.toJson(Gson.java:825)
at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.updateLockfile(BazelLockFileModule.java:226)
at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.afterCommand(BazelLockFileModule.java:131)
at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:721)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:710)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:253)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
at io.grpc.Context$1.run(Context.java:566)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
am...@google.com <am...@google.com> #21
Manually running bazel mod deps --lockfile_mode=update
seems to have fixed it. Filed a bug at
am...@google.com <am...@google.com> #22
Lots of new bizarre failures:
- Many failures of the form
ERROR: /b/s/w/ir/x/w/co/pw_bluetooth_hci/BUILD.bazel:92:16: Creating runfiles tree bazel-out/k8-fastbuild/bin/pw_bluetooth_hci/uart_transport_fuzzer.runfiles failed: java.io.FileNotFoundException: /b/s/w/ir/cache/bazel/_bazel_swarming/823a25200ba977576a072121498f22ec/execroot/_main/bazel-out/k8-fastbuild/bin/pw_bluetooth_hci/uart_transport_fuzzer.runfiles/_main/pw_bluetooth_hci (No such file or directory)
- Python runfiles path handling appears to have changed (again).
- pw_bluetooth_sapphire trips over this:
ERROR: Targets are missing required license information!
The following 1 targets are missing license information:
@@rules_cc+//cc:current_cc_toolchain in cc/BUILD (rule=cc_toolchain_alias)
am...@google.com <am...@google.com> #23
Latest issue is protoc-gen-nanopb
inexplicably can't find nanopb_pb2
:
ERROR: /b/s/w/ir/x/w/co/pw_trace_tokenized/BUILD.bazel:159:14: Generating ["pb.h", "pb.c"] C++ files for protos failed: (Exit 1): protoc failed: error executing Action command (from target //pw_trace_tokenized:protos)
(cd /b/s/w/ir/cache/bazel/_bazel_swarming/823a25200ba977576a072121498f22ec/sandbox/linux-sandbox/3159/execroot/_main && \
exec env - \
NANOPB_PB2_NO_REBUILD=1 \
NANOPB_PB2_TEMP_DIR='<derived root>' \
bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/protobuf+/protoc -Ibazel-out/k8-fastbuild/bin/pw_chrono/_virtual_imports/chrono_proto -Ibazel-out/k8-fastbuild/bin/pw_trace_tokenized/_virtual_imports/protos '--plugin=protoc-gen-custom=bazel-out/k8-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/protoc-gen-nanopb' '--custom_opt=-I./pw_trace_tokenized' '--custom_opt=--library-include-format=#include "external/nanopb+/%s"' '--custom_out=bazel-out/k8-fastbuild/bin/pw_trace_tokenized' bazel-out/k8-fastbuild/bin/pw_trace_tokenized/_virtual_imports/protos/pw_trace_protos/trace.proto bazel-out/k8-fastbuild/bin/pw_trace_tokenized/_virtual_imports/protos/pw_trace_protos/trace_rpc.proto bazel-out/k8-fastbuild/bin/pw_trace_tokenized/_virtual_imports/protos/pw_trace_protos/trace_service.proto)
# Configuration: 93647ac409ad4d7d977fd67acfe8173bb29174b002acf23540a8fefe98421e23
# Execution platform: @@platforms//host:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Traceback (most recent call last):
File "/b/s/w/ir/cache/bazel/_bazel_swarming/823a25200ba977576a072121498f22ec/sandbox/linux-sandbox/3159/execroot/_main/bazel-out/k8-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/protoc-gen-nanopb.runfiles/_main/../nanopb+/generator/protoc-gen-nanopb.py", line 7, in <module>
from nanopb_generator import *
File "/b/s/w/ir/cache/bazel/_bazel_swarming/823a25200ba977576a072121498f22ec/sandbox/linux-sandbox/3159/execroot/_main/bazel-out/k8-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/protoc-gen-nanopb.runfiles/nanopb+/generator/nanopb_generator.py", line 76, in <module>
nanopb_pb2 = proto.load_nanopb_pb2()
^^^^^^^^^^^^^^^^^^^^^^^
File "/b/s/w/ir/cache/bazel/_bazel_swarming/823a25200ba977576a072121498f22ec/sandbox/linux-sandbox/3159/execroot/_main/bazel-out/k8-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/protoc-gen-nanopb.runfiles/nanopb+/generator/proto/__init__.py", line 81, in load_nanopb_pb2
import nanopb_pb2 as nanopb_pb2_mod
ModuleNotFoundError: No module named 'nanopb_pb2'
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
tp...@google.com <tp...@google.com> #24
I wonder if rules_python
upgrade, since nanopb_pb2
is a generated Python file.
tp...@google.com <tp...@google.com> #25
BTW, rolling Bazel to a version that contains override_repo
(ideally 8, but anything later than 46341b1a59c7a1cc8ca0dc604ad53b6de7fee653
) would allow us to declare googletest as a bazel_dep
(
am...@google.com <am...@google.com> #26
It looks like rolling back rules_python
doesn't help.
Another thing I've noticed that may or may not be a red herring is python_imports
seems to be pointing to a bad path:
$ cat bazel-out/darwin_x86_64-opt-exec-ST-d57f47055a04/bin/external/nanopb+/protoc-gen-nanopb | grep "python_imports ="
python_imports = 'protobuf+/python/python:protobuf+/python:_main/external/protobuf+/src/google/protobuf/_virtual_imports/descriptor_proto:_main/external/nanopb+/_virtual_imports/nanopb_proto:nanopb+/generator:nanopb+'
The import in the python wrapper is _main/external/nanopb+/_virtual_imports/nanopb_proto
, but under the runfiles tree that path doesn't exist. The actual path in the runfiles dir is nanopb+/_virtual_imports/nanopb_proto/
.
am...@google.com <am...@google.com> #27
I've verified that this is the issue. To be more precise:
/private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/sandbox/darwin-sandbox/7/execroot/_main/bazel-out/darwin_x86_64-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/protoc-gen-nanopb.runfiles/_main/external/nanopb+/_virtual_imports/nanopb_proto
actually exists at:
/private/var/tmp/_bazel_amontanez/e724b21efc8bc19866072fbc72ee5907/sandbox/darwin-sandbox/7/execroot/_main/bazel-out/darwin_x86_64-opt-exec-ST-e8d06b237d06/bin/external/nanopb+/protoc-gen-nanopb.runfiles/_main/../nanopb+/_virtual_imports/nanopb_proto
This is a breakage caused by --legacy_external_runfiles=True
works around this issue. We'll probably want to fix that at the source (rules_python
?) to avoid submitting this particular workaround.
am...@google.com <am...@google.com> #28
Double-verified with a minimal reproducer, and filed
am...@google.com <am...@google.com> #29
--legacy_external_runfiles=True
fails in CQ:
ERROR: /Volumes/Work/s/w/ir/x/w/co/targets/rp2040/BUILD.bazel:219:14: Creating runfiles tree bazel-out/darwin_arm64-fastbuild/bin/targets/rp2040/rp2040_system_async_example.runfiles failed: java.io.FileNotFoundException: /Volumes/Work/s/w/ir/cache/bazel/_bazel_chrome-bot/b8d148453ab029c90d2464c812e12339/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/targets/rp2040/rp2040_system_async_example.runfiles/_main/external/pico-sdk+/src/rp2040/boot_stage2 (No such file or directory)
Though I can't reproduce that locally. Could be related to caching.
tp...@google.com <tp...@google.com> #30
If it's indeed cache poisoning, we can address it by incrementing our
am...@google.com <am...@google.com> #31
Previously, I was testing with bazel build //...
. I've just confirmed the full pw presubmit --step=bazel_build
passes locally for me on x86_64 macOS with the current patch set.
tp...@google.com <tp...@google.com> #32
Sounds like we're almost there, then? Anything I can help with? (I have a fix out for the rules_python
issue but it looks like that's not a blocker since we can set --legacy_external_runfiles=True
.)
am...@google.com <am...@google.com> #33
Fixing the ERROR: Targets are missing required license information!
that seems to be caused by changes to rules_cc is a pretty separable task, you're welcome to grab that one:
tp...@google.com <tp...@google.com> #34
I'll take a look at it. It reminds me of the issues with license collection we ran into when first adopting bzlmod (
EDIT: Filed
tp...@google.com <tp...@google.com> #35
I took a look at some of the downstream builder failures, e.g. the quickstart one (
The error is related to a change in rules_java
, cl/697997376. That CL added a bunch of if-statements of the form if get_internal_java_common().google_legacy_api_enabled()
; but the get_internal_java_common
function (also added in that CL) may return None
. In actual Bazel 8.0.0, it all somehow works out, but at the prerelease commit we've been pinning we hit the Error: 'NoneType' value has no field or method 'google_legacy_api_enabled'
.
am...@google.com <am...@google.com> #36
I'm not sure it's worth fighting with this incompatibility. We might just want to eat the cost of a truly breaking roll after we have sufficient confidence we can resolve all downstream breakages quickly.
tp...@google.com <tp...@google.com> #37
Hopefully we'll be able to submit a large non-breaking subset of the changes in
ap...@google.com <ap...@google.com> #38
Project: pigweed/pigweed
Branch: main
Author: Armando Montanez <
Link:
bazel: Load android_library from rules_android
Expand for full commit details
bazel: Load android_library from rules_android
Loads android_library from rules_android as an incremental step towards
supporting the update to Bazel 8.0.0.
Bug: b/372510795
Change-Id: I5910aadf2d68f2011b4f3435bf5db275c08281ae
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/256832
Docs-Not-Needed: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Files:
- M
MODULE.bazel
- M
pw_hdlc/java/main/dev/pigweed/pw_hdlc/BUILD.bazel
- M
pw_log/java/android_main/dev/pigweed/pw_log/BUILD.bazel
- M
pw_rpc/java/main/dev/pigweed/pw_rpc/BUILD.bazel
- M
pw_transfer/java/main/dev/pigweed/pw_transfer/BUILD.bazel
Hash: 256d1ec6f8851851786b2e3a92cca39caff0f4ee
Date: Mon Dec 30 12:23:07 2024
ap...@google.com <ap...@google.com> #39
Project: pigweed/pigweed
Branch: main
Author: Armando Montanez <
Link:
bazel: Clean up empty globs
Expand for full commit details
bazel: Clean up empty globs
Cleans up uses of `glob()` that were sometimes empty to make Pigweed
behave better with --incompatible_disallow_empty_glob.
Bug: b/372510795
Change-Id: Ia7c4ec016243facf188099afbd6d9ab2266231bc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/256833
Docs-Not-Needed: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Files:
- M
pw_protobuf/BUILD.bazel
- M
pw_toolchain/rust/rust_toolchain.BUILD
- M
third_party/stm32cube/cmsis_core.BUILD.bazel
Hash: bc6e04c72ca1f9dd589cb5dbd3fedcb70da27022
Date: Mon Dec 30 15:02:42 2024
ap...@google.com <ap...@google.com> #40
Project: pigweed/pigweed
Branch: main
Author: Armando Montanez <
Link:
bazel: Load from @rules_android//android:rules.bzl
Expand for full commit details
bazel: Load from @rules_android//android:rules.bzl
While library.bzl does not exist in both rules_android 0.1.0 and 0.6.0,
rules.bzl does.
Bug: b/372510795
Change-Id: I33176b452b1856c5dcfd884d766d945006bc107d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/256834
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Docs-Not-Needed: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Files:
- M
pw_hdlc/java/main/dev/pigweed/pw_hdlc/BUILD.bazel
- M
pw_log/java/android_main/dev/pigweed/pw_log/BUILD.bazel
- M
pw_rpc/java/main/dev/pigweed/pw_rpc/BUILD.bazel
- M
pw_transfer/java/main/dev/pigweed/pw_transfer/BUILD.bazel
Hash: e851b2c537e4f4a5e1aa9480ac41d47dd4e64cde
Date: Mon Dec 30 15:46:01 2024
am...@google.com <am...@google.com> #41
I think I've managed to pave a path forward:
- Migrate users to rules_cc 0.17.0.
- Add a
single_version_override
forrules_android
in Pigweed and land the Bazel 8.0.0 update in Pigweed, but do NOT update requiredbazel_dep
versions in the MODULE.bazel. - Roll downstream projects to Bazel 8.0.0.
- Remove the
rules_android
single version override, and properly express the new resolved versions in their respectivebazel_dep
declarations.
Which means we're still blocked on:
- Migrating downstream projects to rules_cc 0.17.0.
- The error when creating the runfiles tree.
am...@google.com <am...@google.com> #42
For the failures related to creating runfiles trees:
ERROR: /usr/local/google/home/amontanez/development/projects/pigweed/pigweed/targets/rp2040/BUILD.bazel:247:14: Creating runfiles tree bazel-out/k8-fastbuild/bin/targets/rp2040/rp2350_system_async_example.runfiles failed: java.io.FileNotFoundException: /usr/local/google/home/amontanez/.cache/bazel/_bazel_amontanez/06cb1b6ef37c7adbbc0068a64c52919c/execroot/_main/bazel-out/k8-fastbuild/bin/targets/rp2040/rp2350_system_async_example.runfiles/_main/external/pico-sdk+/src/rp2350/boot_stage2 (No such file or directory)
The fix is to turn off --experimental_inprocess_symlink_creation
for builds that enable remote caching.
am...@google.com <am...@google.com> #43
It looks like the only remaining blocker is updating projects to rules_cc@0.0.17, which is almost done (one project left).
The only trailing fallout is the need for downstream projects to set common --legacy_external_runfiles=True
when they flip to Bazel 8. This is not solely a Pigweed-specific problem, as the biggest failure we're seeing related to this is caused by rules_python/protobuf. I'll split that out into a follow up bug.
ap...@google.com <ap...@google.com> #44
Project: pigweed/pigweed
Branch: main
Author: Armando Montanez <
Link:
bazel: Update rules_cc
Expand for full commit details
bazel: Update rules_cc
Updates rules_cc to the latest release.
Fixes: b/384050813
Bug: b/372510795
Change-Id: I23e4c60bfb25c56cb8ac7664063202e876824abf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/254156
Docs-Not-Needed: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Files:
- M
MODULE.bazel
- M
MODULE.bazel.lock
- M
pw_toolchain/host_clang/BUILD.bazel
Hash: d2ef5fdeed8b56c120a7913add62bee78671f4d6
Date: Tue Jan 07 16:02:31 2025
am...@google.com <am...@google.com> #45
ap...@google.com <ap...@google.com> #46
Project: pigweed/pigweed
Branch: main
Author: Armando Montanez <
Link:
bazel: Update to Bazel 8.0.0
Expand for full commit details
bazel: Update to Bazel 8.0.0
Moves from a floating commit of Bazel to 8.0.0.
Fixes: b/372510795
Change-Id: I97e55e519b8033ce61a86e14081d5e6f19b5f3aa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/242033
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Docs-Not-Needed: Armando Montanez <amontanez@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Files:
- M
.bazelrc
- M
.bazelversion
- M
MODULE.bazel
- M
MODULE.bazel.lock
- M
WORKSPACE
- M
pw_bloat/py/pw_bloat/bloat.py
- M
pw_build/pigweed.bazelrc
- M
pw_transfer/integration_test/legacy_binaries_test.py
- M
targets/rp2040/py/rp2040_utils/device_detector.py
Hash: b13f7bf334b239174e87d91fbfac8b8c1d209403
Date: Wed Jan 08 12:15:07 2025
am...@google.com <am...@google.com> #47
Follow-ups to chase down:
--experimental_inprocess_symlink_creation
breaks remote caching:https://github.com/bazelbuild/bazel/issues/24867 rules_android
override hack:https://pwbug.dev/388565113 - Fuchsia SDK incompatible with
--incompatible_disallow_empty_glob
:https://fxbug.dev/382533028 --legacy_external_runfiles=False
broken (needs new release ofrules_python
, and maybe some other fixes):https://pwbug.dev/388568022
ap...@google.com <ap...@google.com> #48
Project: pigweed/pigweed
Branch: main
Author: Armando Montanez <
Link:
docs: Remove admonition about Bazel version pin
Expand for full commit details
docs: Remove admonition about Bazel version pin
Pigweed has finally switched to an official Bazel 8.0.0 release, so we
can remove the admonition about the floating commit hash we were
previously using.
Bug: b/372510795
Change-Id: I775b7fc978302b892fb259adb833832dc22564e3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/258833
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ronan Chauvin <ronanchauvin@gmail.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Files:
- M
docs/get_started/bazel_integration.rst
Hash: 3e0b8328908b258d67510364f4321f7c59fe4e4a
Date: Wed Jan 08 13:20:05 2025
tp...@google.com <tp...@google.com> #49
We've had some minor infra issues as a result of this change:
- A couple CI builders have timed out because of the widespread cache invalidation (e.g.,
http://ci.chromium.org/b/8726278888733237089 ). This will fix itself, since the cache is being updated even by the timed-out runs. But we should increase the timeouts; I'll send a CL. - There are issues with rolling the change into some downstream projects. I'll file a separate internal bug for this. EDIT: filed internal
.b/388587072
ap...@google.com <ap...@google.com> #50
Project: pigweed/examples
Branch: main
Author: Armando Montanez <
Link:
Update to Bazel 8.0.0
Expand for full commit details
Update to Bazel 8.0.0
Updates to Bazel 8.0.0 and tidies up the MODULE.bazel and .bazelrc
files.
Bug: b/372510795, b/315871648
Change-Id: I309f13888e5ba9c75de8d8a338513f84c1f7d696
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/examples/+/259292
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Dave Roth <davidroth@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Files:
- M
.bazelrc
- M
.bazelversion
- M
MODULE.bazel
Hash: 970624db2bbff9150335ebef455dd50478c33a47
Date: Thu Jan 09 11:40:27 2025
ap...@google.com <ap...@google.com> #51
Project: pigweed/quickstart/bazel
Branch: main
Author: Armando Montanez <
Link:
Update to Bazel 8.0.0
Expand for full commit details
Update to Bazel 8.0.0
Updates to Bazel 8.0.0 and tidies up the MODULE.bazel and .bazelrc
files.
Bug: b/372510795
Change-Id: Ifb14ba9161d90a69f1b7baa9461e4ef4c8253aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/quickstart/bazel/+/259352
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Files:
- M
.bazelrc
- M
.bazelversion
- M
MODULE.bazel
- M
MODULE.bazel.lock
Hash: fc4dfaa3ab3de4e308cd565bfd825d0cb6129171
Date: Thu Jan 09 12:10:35 2025
ap...@google.com <ap...@google.com> #52
Project: pigweed/showcase/sense
Branch: main
Author: Armando Montanez <
Link:
Update to Bazel 8.0.0
Expand for full commit details
Update to Bazel 8.0.0
Updates to Bazel 8.0.0 and tidies up the MODULE.bazel and .bazelrc
files.
Bug: b/372510795
Change-Id: I6244e9296ea22fdcbdf3f236b79b65d5e281b5bc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/showcase/sense/+/259274
Commit-Queue: Armando Montanez <amontanez@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Files:
- M
.bazelrc
- M
.bazelversion
- M
MODULE.bazel
- M
MODULE.bazel.lock
Hash: 884f07125793c1f52f87387c931b40b8536c1cfe
Date: Fri Jan 10 10:36:12 2025
ap...@google.com <ap...@google.com> #53
Project: pigweed/maize
Branch: main
Author: Armando Montanez <
Link:
Update to Bazel 8.0.0
Expand for full commit details
Update to Bazel 8.0.0
Updates to Bazel 8.0.0 and tidies up the MODULE.bazel and .bazelrc
files.
Bug: b/372510795
Change-Id: I118e8548eb062e068905b387cd3bfcf5e4020733
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/maize/+/259372
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Travis Geiselbrecht <travisg@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Erik Gilling <konkers@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Files:
- M
.bazelrc
- M
.bazelversion
- M
BUILD.bazel
- M
MODULE.bazel
- M
pigweed.json
Hash: e0149c2be44efc6820bbf5da1a0a5a537fe8dfdd
Date: Mon Jan 13 09:58:32 2025
Description
Now that it's out (https://github.com/bazelbuild/bazel/releases/tag/8.0.0rc1 ), this provides an opportunity to both get off of a random GitHub commit, and make sure Bazel 8.0.0 will work for Pigweed.
WIP CL:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/242033