Skip to content

fix: add rules_proto and explicit load statements for proto_library / cc_proto_library#13

Merged
fcostaoliveira merged 7 commits into
masterfrom
fix/bazel-proto-dependency
May 27, 2026
Merged

fix: add rules_proto and explicit load statements for proto_library / cc_proto_library#13
fcostaoliveira merged 7 commits into
masterfrom
fix/bazel-proto-dependency

Conversation

@fcostaoliveira

Copy link
Copy Markdown

Problem

CI fails on both build-and-test and test-deb-build jobs with:

ERROR: src/BUILD:169:1: name 'proto_library' is not defined
ERROR: src/BUILD:174:1: name 'cc_proto_library' is not defined
ERROR: src/quipper/BUILD:23:1: name 'proto_library' is not defined
ERROR: src/quipper/BUILD:29:1: name 'cc_proto_library' is not defined
...

Root cause

Bazel 9.1.0 (used by CI) with Bzlmod no longer auto-loads proto_library and cc_proto_library as built-in rules. These symbols must now be explicitly imported via load() statements, and rules_proto must be declared as an explicit dependency in MODULE.bazel.

Fix

  1. MODULE.bazel — Add bazel_dep(name = "rules_proto", version = "7.1.0").

  2. src/BUILD — Add at the top:

    load("@rules_proto//proto:defs.bzl", "proto_library")
    load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
  3. src/quipper/BUILD — Same two load statements at the top.

rules_proto 7.1.0 is the current stable release in the Bazel Central Registry and is compatible with Bazel 9.x and protobuf 31.x+.

@fcostaoliveira fcostaoliveira merged commit 2fd9675 into master May 27, 2026
6 checks passed
@fcostaoliveira fcostaoliveira deleted the fix/bazel-proto-dependency branch May 27, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants