Skip to content

Commit

Permalink
Blacklist .proto source files is Bazel allows us to
Browse files Browse the repository at this point in the history
This is a partial revert of protocolbuffers@7b28278 to unblock, e.g., grpc/grpc#21590 or envoyproxy/envoy-mobile#617 until Bazel is fixed.

Note: this is a forward-compatible change that automatically switches to the behavior intended by protocolbuffers@7b28278 when a compatible Bazel is released without requiring users to upgrade Protobuf. We will revert this change when Bazel is fixed.
  • Loading branch information
Yannic committed Jan 8, 2020
1 parent ed8688d commit 8db99b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BUILD
Expand Up @@ -2,7 +2,7 @@

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library")
load("@rules_java//java:defs.bzl", "java_library")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("@rules_proto//proto:defs.bzl", "proto_common", "proto_lang_toolchain", "proto_library")
load("@rules_python//python:defs.bzl", "py_library")

licenses(["notice"])
Expand Down Expand Up @@ -986,9 +986,11 @@ cc_library(
],
)

reject_blacklisted_files = not hasattr(proto_common, "proto_lang_toolchain_rejects_files_do_not_use_or_we_will_break_you_without_mercy"),
cc_toolchain_blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()] if reject_blacklisted_files else [":well_known_protos"],
proto_lang_toolchain(
name = "cc_toolchain",
blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
blacklisted_protos = cc_toolchain_blacklisted_protos,
command_line = "--cpp_out=$(OUT)",
runtime = ":protobuf",
visibility = ["//visibility:public"],
Expand Down

0 comments on commit 8db99b7

Please sign in to comment.