Skip to content

Commit 56b554d

Browse files
authored
chore: add Bazel 8 testing (#39)
* chore: add Bazel 8 testing * fix: revert rules_uv upgrade * chore: rules_proto leaked another setup routine for WORKSPACE users * PYSTAR is now required * chore: reduce delta * fix: add a rules_java dependency that protobuf is leaking * chore: give up on bazel8 without bzlmod Revert WORKSPACE-only changes * fix: disable Java toolchain which is causing C++ compiles * disable python too
1 parent 5d9e196 commit 56b554d

File tree

12 files changed

+45
-48
lines changed

12 files changed

+45
-48
lines changed

.bcr/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ bcr_test_module:
22
module_path: "e2e/smoke"
33
matrix:
44
platform: ["debian10", "macos", "ubuntu2004", "windows"]
5-
bazel: ["7.x"]
5+
bazel: ["7.x", "8.x"]
66
tasks:
77
run_tests:
88
name: "Run test module"

.github/workflows/ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ concurrency:
1818

1919
jobs:
2020
test:
21-
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v6
21+
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@646899086d7aaee8e532540480f3e91e00596234 # Dec 11 2024
2222
with:
2323
folders: '[".", "e2e/smoke", "examples"]'
2424
exclude: |
2525
[
26-
{"bazelversion": "6.4.0"},
2726
{"folder": ".", "bzlmodEnabled": false},
2827
{"folder": "examples", "bzlmodEnabled": false},
29-
{"folder": ".", "os": "windows-latest"}
28+
{"bazelversion": "8.0.0", "bzlmodEnabled": false},
3029
]

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module(
88

99
bazel_dep(name = "bazel_features", version = "1.9.0")
1010
bazel_dep(name = "bazel_skylib", version = "1.4.1")
11-
bazel_dep(name = "rules_proto", version = "6.0.0")
11+
bazel_dep(name = "rules_proto", version = "7.1.0")
1212
bazel_dep(name = "platforms", version = "0.0.10")
1313

1414
bazel_dep(name = "aspect_bazel_lib", version = "2.8.1", dev_dependency = True)

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# Pre-built protoc toolchain for Bazel 7
2-
3-
> [!CAUTION]
4-
> Bazel 8 and recent rules_proto changes broke this toolchain.
5-
> We don't currently have any plans to address this.
6-
> Instead, we expect someone on the protobuf team to follow through with the
7-
> "End Goal" promised in https://protobuf.dev/news/2024-10-01/
8-
> where this functionality is upstreamed.
9-
> Follow https://github.com/protocolbuffers/protobuf/issues/19558
1+
# Pre-built protoc toolchain for Bazel
102

113
_#NeverCompileProtocAgain_
124

e2e/smoke/.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.bazelversion

e2e/smoke/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
bazel_dep(name = "toolchains_protoc", version = "0.0.0")
2-
bazel_dep(name = "rules_proto", version = "6.0.0-rc2")
2+
bazel_dep(name = "rules_proto", version = "7.1.0")
33

44
local_path_override(
55
module_name = "toolchains_protoc",

examples/.bazelrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
common --incompatible_enable_proto_toolchain_resolution
33
common --@aspect_rules_py//py:interpreter_version=3.9.18
44

5-
# See https://github.com/bazelbuild/rules_python/issues/1069#issuecomment-1942053014
6-
common --action_env=RULES_PYTHON_ENABLE_PYSTAR=0
7-
85
# Force rules_go to disable CGO even though we have a (fake) C++ toolchain registered.
96
common --host_platform=//tools:no_cgo_host_platform

examples/.bazelversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.bazelversion

examples/BUILD.bazel

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
load("@rules_go//proto:def.bzl", "go_proto_library")
22
load("@rules_proto//proto:defs.bzl", "proto_library")
3-
load("@rules_python//python:proto.bzl", "py_proto_library")
43

54
package(default_visibility = ["//visibility:public"])
65

@@ -10,15 +9,21 @@ proto_library(
109
deps = ["@com_google_protobuf//:any_proto"],
1110
)
1211

13-
py_proto_library(
14-
name = "foo_py_proto",
15-
deps = [":foo_proto"],
16-
)
12+
# Broken because rules_python's py_proto_library doesnt produce the same
13+
# PyInfo symbol that py_test expects.
14+
# load("@rules_python//python:proto.bzl", "py_proto_library")
15+
# py_proto_library(
16+
# name = "foo_py_proto",
17+
# deps = [":foo_proto"],
18+
# )
1719

18-
java_proto_library(
19-
name = "foo_java_proto",
20-
deps = [":foo_proto"],
21-
)
20+
# Broken by https://github.com/protocolbuffers/protobuf/pull/19679
21+
# which causes building C++ code from source.
22+
# TODO: re-enable once protobuf honors the toolchain
23+
# java_proto_library(
24+
# name = "foo_java_proto",
25+
# deps = [":foo_proto"],
26+
# )
2227

2328
go_proto_library(
2429
name = "foo_go_proto",

0 commit comments

Comments
 (0)