Repository navigation
bazel: Export jspecify from //:auto_value_annotations - #13179
Open
robot-head wants to merge 1 commit into
Open
robot-head wants to merge 1 commit into
robot-head wants to merge 1 commit into
Conversation
When org.jspecify:jspecify is on the compile classpath, AutoValue 1.11.1 and later annotate generated classes with org.jspecify.annotations.Nullable. The AutoValue users (//rls, //xds) don't depend on jspecify directly, so a consumer whose Maven graph resolves a newer AutoValue alongside jspecify gets a Java strict-deps error on the generated sources. Add org.jspecify:jspecify:1.0.0 to IO_GRPC_GRPC_JAVA_ARTIFACTS and export it from //:auto_value_annotations next to auto-value-annotations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Author
|
/easycla |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
org.jspecify:jspecifyis on the compile classpath, AutoValue 1.11.1 and later annotate the classes they generate withorg.jspecify.annotations.Nullable. Recent Guava releases depend on jspecify, so a consumer's Maven graph usually includes it. The AutoValue targets here (//rls,//xds) don't depend on jspecify directly, so Bazel's Java strict-deps check rejects the generated sources.grpc-java's own build passes on master because it pins AutoValue 1.11.0, which doesn't emit jspecify annotations. The failure shows up when a consumer's Maven graph resolves a newer AutoValue and puts jspecify on the AutoValue compile classpath.
This PR adds
org.jspecify:jspecify:1.0.0toIO_GRPC_GRPC_JAVA_ARTIFACTSin MODULE.bazel and repositories.bzl, and exports it from//:auto_value_annotationsalongsideauto-value-annotations, so every AutoValue user gets it.Repro (Bazel 8.7.0, Bzlmod): a consumer module that depends on grpc-java through
local_path_overrideand has a rootmaven.installwithcom.google.auto.value:auto-value:1.11.1,auto-value-annotations:1.11.1andcom.google.guava:guava:33.7.2-jre. On master,bazel build @grpc-java//rlsfails:Testing with this change:
@grpc-java//rlsand@grpc-java//xds.bazel build --config=skip_android //rls //xds //:auto_value_annotationspasses with Bzlmod, and//rls //:auto_value_annotationspasses with--enable_bzlmod=false --enable_workspace=true.bazel test //...or the Gradle build. Gradle isn't touched.🤖 Generated with Claude Code