+26
-6
lines changedFilter options
+26
-6
lines changed Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ jobs:
67
67
uses: protocolbuffers/protobuf-ci/bazel@v4
68
68
with:
69
69
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
70
-
bazel-cache: examples
70
+
bazel-cache: examples-${{ matrix.bazelversion }}-${{ matrix.bzlmod }}-${{ matrix.toolchain_resolution }}
71
71
version: ${{ matrix.bazelversion }}
72
72
bash: >
73
73
cd examples;
Original file line number Diff line number Diff line change
@@ -46,6 +46,14 @@ bazel_dep(name = "rules_license", version = "1.0.0")
46
46
bazel_dep(name = "rules_pkg", version = "1.0.1")
47
47
bazel_dep(name = "rules_python", version = "1.0.0")
48
48
49
+
# Pin to rules_proto to 7.1.0 to avoid toolchain incompatibilities when
50
+
# --incompatible_enable_proto_toolchain_resolution=true in Bazel 7.
51
+
# rules_proto 7.0.2 from deps incorrectly rules_proto's toolchain_type but protobuf's toolchain, but
52
+
# 7.1.0 uses protobuf's toolchain and toolchain_type.
53
+
# TODO: Restore to dev_dependency once Bazel 7 is dropped.
54
+
# rules_proto is needed for @com_google_protobuf_v25 used in //compatibility/... tests
55
+
bazel_dep(name = "rules_proto", version = "7.1.0")
56
+
49
57
bazel_dep(name = "rules_rust", version = "0.56.0", dev_dependency = True)
50
58
bazel_dep(name = "rules_ruby", version = "0.17.3", dev_dependency = True)
51
59
@@ -82,6 +90,7 @@ ruby.toolchain(
82
90
version = "system",
83
91
)
84
92
use_repo(ruby, "ruby")
93
+
85
94
ruby.bundle_fetch(
86
95
name = "protobuf_bundle",
87
96
gem_checksums = {
@@ -227,9 +236,6 @@ bazel_dep(
227
236
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
228
237
use_repo(cc_configure, "local_config_cc")
229
238
230
-
# rules_proto are needed for @com_google_protobuf_v25 used in //compatibility/... tests
231
-
bazel_dep(name = "rules_proto", version = "7.0.2", dev_dependency = True)
232
-
233
239
# For the Lua upb implementation
234
240
bazel_dep(name = "lua", version = "5.4.6", dev_dependency = True)
235
241
Original file line number Diff line number Diff line change
@@ -11,8 +11,12 @@ load("@proto_bazel_features//:features.bzl", "bazel_features")
11
11
load("//bazel/private:proto_library_rule.bzl", _proto_library = "proto_library")
12
12
13
13
def proto_library(**kwattrs):
14
-
# This condition causes Starlark rules to be used only on Bazel >=7.0.0
15
-
if bazel_features.proto.starlark_proto_info:
14
+
# Bazel 6 predates Starlark ProtoInfo and is not compatible with Starklark proto_library.
15
+
if not bazel_features.proto.starlark_proto_info:
16
+
fail("Protobuf proto_library is not compatible with Bazel 6.")
17
+
18
+
# Only use Starlark rules when they are removed from Bazel.
19
+
if not hasattr(native, "proto_library"):
16
20
_proto_library(**kwattrs)
17
21
else:
18
22
# On older Bazel versions keep using native rules, so that mismatch in ProtoInfo doesn't happen
Original file line number Diff line number Diff line change
@@ -53,6 +53,16 @@ def _github_archive(repo, commit, **kwargs):
53
53
def protobuf_deps():
54
54
"""Loads common dependencies needed to compile the protobuf library."""
55
55
56
+
# Pin rules_proto since Bazel 7 otherwise depends on rules_proto 5.3.0-21.7 which is missing
57
+
# @rules_proto//proto:toolchain_type used by Bazel.
58
+
# 6.0.0 would at least require users to add `register_toolchains` for rules_proto
59
+
# TODO: Remove once Bazel 7 is no longer supported.
60
+
if not native.existing_rule("rules_proto"):
61
+
http_archive(
62
+
name = "rules_proto",
63
+
strip_prefix = "rules_proto-7.1.0",
64
+
url = "https://github.com/bazelbuild/rules_proto/releases/download/7.1.0/rules_proto-7.1.0.tar.gz",
65
+
)
56
66
if not native.existing_rule("bazel_features"):
57
67
http_archive(
58
68
name = "bazel_features",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4