google / google/bazel-common

`exported_plugins` doesn't do quite what we want for `beta-checker` in `guava`

Open
#200 0 comments 0 reactions 0 assignees View on GitHub
bug P4
Dominant language
Starlark
Stars
91
Forks
45
Avg merge
14m
Merged PRs (30d)
7

Description

`exported_plugins` is ["The list of `java_plugins` (e.g. annotation processors) to export to libraries that directly depend on this library."](https://bazel.build/reference/be/java#java_library.exported_plugins) That makes it suitable for plain old annotation processors (since you can't write an annotation in your code without depending directly upon it) and for static analysis that applies to such annotation usages, but it does not make it suitable for cases like [ours](https://github.com/google/bazel-common/blob/ebce2af3f0de560b649dcf98ef732a56b80e829c/third_party/java/guava/BUILD#L23), "No one calls a `@Beta` method from Guava," since it's possible to call a `@Beta` method on Guava without declaring a direct dependency on Guava itself.

The practical danger here is slim, since Guava has few `@Beta` APIs nowadays. But it might be more honest to remove `exported_plugins` or to find another way of fully enabling the checking that we want. Really, though, I'm filing this bug because TIL from a question on YAQS :) See also some Google-internal documentation added in CL 149351089 (though the Bazel docs are crystal-clear on the behavior, even if they don't go into the implications in detail).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.