Skip to content
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

[Bazel CI] Error: no native function or rule 'cc_proto_library' #2429

Closed
sgowroji opened this issue Nov 20, 2024 · 0 comments · Fixed by #2432
Closed

[Bazel CI] Error: no native function or rule 'cc_proto_library' #2429

sgowroji opened this issue Nov 20, 2024 · 0 comments · Fixed by #2432

Comments

@sgowroji
Copy link
Member

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4278#019347c3-2f19-4b39-8dd0-5bcdcfe15694

Platform: Multiple

Logs:

Error: no native function or rule 'cc_proto_library'

Culprit:

Steps:

git clone https://github.com/bazelbuild/rules_python
git reset b9b0948234216cf43bb898eec078b1c71a37c1f9  --hard
export USE_BAZEL_VERSION=4b37e244d0c73e7faa0d840069e80a63dfc1b580
bazel build //... 

CC Greenteam @meteorcloudy

github-merge-queue bot pushed a commit that referenced this issue Nov 21, 2024
The only way to support both workspace and bzlmod mode, is to call
protobuf com_google_protobuf. This is because old Bazel's encode it in
default values of `--protoco_compiler` flag, and so new Bazel 8 needs to
do the same.

For bzlmod, upgrade rules_cc to 0.0.16 and rules_java (dev dep) to
8.3.1. Those are minimal versions that are also calling protobuf again
com_google_protobuf.

For workspace, upgrade rules_cc to 0.1.0. This is an incompatible
version that doesn't call Protobuf. rules_python users may use it. In
case they need cc_proto_library in `@rules_cc//cc/defs.bzl`, they can
overwrite the version to 0.0.16 in WORKSPACE (or use protobuf_deps that
already does that).

Disable docs generation targets on WORKSPACE CI setups. They are broken
by rules_java upgrade.

Upgrades dependencies:
* rules_cc 0.0.16 (Bzlmod) and rules_cc 0.1.0 (WORKSPACE)
* rules_java 8.3.1
* bazel_skylib 1.7.0 (workspace; bzlmod already specifying that version)
* protobuf 29.0-rc2 (workspace; bzlmod already specifying that version)

Fixes #2429

---------

Co-authored-by: Richard Levasseur <[email protected]>
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 a pull request may close this issue.

1 participant