Skip to content

Commit 1e481ab

Browse files
comiuscopybara-github
authored andcommitted
Remove test_only_target from cc_proto_library
It looks weird that the C++ proto aspect is over proto_library with testonly set and even weirder over _test, because that isn't a proto_library. Removing it to reduce complexity and because test_only_target is protected APIs. The effect of setting this bit is, that under a certain set of flags, FDO indexing is prevented on tests. PiperOrigin-RevId: 673381037 Change-Id: I5e8ce0389fe01d56fc4f1ae39a5a25aabfcaa846
1 parent 5efe7d9 commit 1e481ab

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/main/starlark/builtins_bzl/common/cc/cc_proto_support.bzl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ def get_feature_configuration(ctx, has_sources, extra_requested_features = []):
4444
unsupported_features = unsupported_features,
4545
)
4646

47-
def _get_test_only_target(ctx):
48-
return ctx.rule.kind.endswith("_test") or getattr(ctx.rule.attr, "testonly", False)
49-
5047
def _get_libraries_from_linking_outputs(linking_outputs, feature_configuration):
5148
library_to_link = linking_outputs.library_to_link
5249
if not library_to_link:
@@ -126,7 +123,6 @@ def cc_proto_compile_and_link(ctx, deps, sources, headers, disallow_dynamic_libr
126123
linking_contexts = [dep[CcInfo].linking_context for dep in deps],
127124
name = ctx.label.name,
128125
disallow_dynamic_library = disallow_dynamic_library,
129-
test_only_target = _get_test_only_target(ctx),
130126
alwayslink = alwayslink,
131127
)
132128
libraries = _get_libraries_from_linking_outputs(linking_outputs, feature_configuration)

0 commit comments

Comments
 (0)