Skip to content

Commit df4a5e6

Browse files
l46kokcopybara-github
authored andcommitted
Add safe guards to ensure we don't build protoc from source
PiperOrigin-RevId: 933291946
1 parent 54acafe commit df4a5e6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.bazelrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
common --enable_bzlmod
22
# Use built-in protoc
3-
common --incompatible_enable_proto_toolchain_resolution --@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc
3+
common --incompatible_enable_proto_toolchain_resolution
4+
common --@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc=true
45

6+
# Ensure that we don't accidentally build protobuf or gRPC
7+
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
8+
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
9+
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
10+
common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
511
build --java_runtime_version=remotejdk_11
612
build --java_language_version=11
713

java_lite_proto_cel_library_impl.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This is an implementation detail. Clients should use 'java_lite_proto_cel_librar
2020
load("@rules_java//java:defs.bzl", "java_library")
2121
load("//publish:cel_version.bzl", "CEL_VERSION")
2222
load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
23-
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
23+
load("@com_google_protobuf//bazel/common:proto_info.bzl", "ProtoInfo")
2424

2525
def java_lite_proto_cel_library_impl(
2626
name,

0 commit comments

Comments
 (0)