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

Blacklist .proto source files if Bazel allows us to #7065

Merged
merged 3 commits into from
Jan 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
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"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lberki @cushon @hlopko I'd love to get your lgtm on this "feature flag" so we don't have to synchronize flipping a future --incompatible_blacklisted_protos_requires_proto_info (or whatever that flag will be called) with protobuf releases. See bazelbuild/bazel#10493 and bazelbuild/bazel#10484 for context.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that the sole reason for this change is http://github.com/bazelbuild/bazel/issues/10484 and thus if that is fixed, this change and the flag becomes unnecessary?

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