Problem
Building with Bazel 9 (the current default installed by bazelisk) fails because proto_library and cc_proto_library are no longer native rules in Bazel 9:
$ bazel build src:perf_to_profile
ERROR: /home/user/perf_data_converter/src/BUILD:170:1: name 'proto_library' is not defined
ERROR: /home/user/perf_data_converter/src/BUILD:175:1: name 'cc_proto_library' is not defined
This affects both src/BUILD (lines 170, 175) and src/quipper/BUILD (lines 23, 29, 35, 41, 47, 55) which use these rules without load() statements.
Root Cause
Bazel 9 removed proto_library and cc_proto_library from the set of natively available rules. They now need to be explicitly loaded, e.g.:
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
Similarly, src/quipper/BUILD uses cc_library, cc_binary, and cc_test without load() statements, which may also break in future Bazel versions.
Workaround
Adding a .bazelversion file with 8.2.1 pins bazelisk to Bazel 8 and restores a working build. See PR linked below.
Full Fix
The BUILD files should be updated to add explicit load() statements for all Starlark rules to be compatible with Bazel 9+.
Problem
Building with Bazel 9 (the current default installed by bazelisk) fails because
proto_libraryandcc_proto_libraryare no longer native rules in Bazel 9:This affects both
src/BUILD(lines 170, 175) andsrc/quipper/BUILD(lines 23, 29, 35, 41, 47, 55) which use these rules withoutload()statements.Root Cause
Bazel 9 removed
proto_libraryandcc_proto_libraryfrom the set of natively available rules. They now need to be explicitly loaded, e.g.:Similarly,
src/quipper/BUILDusescc_library,cc_binary, andcc_testwithoutload()statements, which may also break in future Bazel versions.Workaround
Adding a
.bazelversionfile with8.2.1pins bazelisk to Bazel 8 and restores a working build. See PR linked below.Full Fix
The BUILD files should be updated to add explicit
load()statements for all Starlark rules to be compatible with Bazel 9+.