-
Notifications
You must be signed in to change notification settings - Fork 4.4k
cc_proto_library does not filter blacklisted protos inside the protobuf repo #10590
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)staleIssues or PRs that are stale (no activity for 30 days)Issues or PRs that are stale (no activity for 30 days)team-Rules-CPPIssues for C++ rulesIssues for C++ rulestype: bug
Description
For Bazel //:src/google/protobuf/any.proto and @com_google_protobuf//:src/google/protobuf/any.proto are different files, which causes blacklisting of .proto sources to fail inside the protobuf repo.
protocolbuffers/protobuf#7075 (comment)
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
git clone --branch proto_blacklist_test https://github.com/Yannic/protobuf.git
cd protobuf
bazel test @com_google_protobuf//:cc_proto_blacklist_test //:cc_proto_blacklist_test
# @com_google_protobuf//:cc_proto_blacklist_test passes
# //:cc_proto_blacklist_test fails
bazel test --proto_toolchain_for_cc=//:cc_toolchain @com_google_protobuf//:cc_proto_blacklist_test //:cc_proto_blacklist_test
# //:cc_proto_blacklist_test passes
# @com_google_protobuf//:cc_proto_blacklist_test failsWhat operating system are you running Bazel on?
N/A
What's the output of bazel info release?
Tested with several versions between 0.22.0 and 2.0.0
Any other information, logs, or outputs that you want to share?
This is mostly an issue for the protobuf repo or for users defining their own proto_lang_toolchain, which shouldn't be too many.
I see two possible fixes:
- a: Teach Bazel that
//:src/google/protobuf/any.protoand@com_google_protobuf//:src/google/protobuf/any.protoare equivalent. - b: Filter
.protofiles based on their import path.
b Is blocked on making ProtoInfo mandatory for proto_lang_toolchain#blacklisted_protos (cc @cushon). I have no idea how hard a would be. Is it related to --incompatible_remap_main_repo (cc @aehlig)?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)staleIssues or PRs that are stale (no activity for 30 days)Issues or PRs that are stale (no activity for 30 days)team-Rules-CPPIssues for C++ rulesIssues for C++ rulestype: bug