| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Relocate and ship Guava annotation packages (common.annotations, errorprone, j2objc, checker-qual, jsr305) with the minimized Guava shade so RuntimeInvisibleAnnotations on ImmutableList and friends no longer point at types absent from the published jar. Consumers compiling with -Xlint:classfile -Werror (e.g. Spring for GraphQL) failed on those dangling descriptors. Add a packaging check and Spock guard for the published jar. Fixes graphql-java#4436 Signed-off-by: Burak KALAYCI <kalayciburak1996@gmail.com>
|
@kalayciburak did you check how much this adds to the resulting JAR? Is this only adding the relevant classes or the entire contents of the JAR because those are excluded from the minimize task? |
Sorry, something went wrong.
|
minimize exclude pulls the whole annotation jars, not just the types the shaded Guava classfiles point at. on 26.0 (3.7mb) thats about +270kb, almost all checker-qual (~224kb). jsr305 + error_prone + j2objc together are ~45kb. the classfiles only actually reference 26 annotation types though, ~7kb compressed if we keep just those. i can slim it to the referenced types if youd rather not ship the rest. |
Sorry, something went wrong.
|
@kalayciburak I'm not part of the graphql-java team so I'll defer to them. I was wondering about the implications of this change. I tried myself to implement an alternative fix, but this involves listing all the relevant annotations manually - so pretty hard to maintain and test. While this problem is still worth looking into, I have also found new information. |
Sorry, something went wrong.
|
looks like #4445 already landed the annotation cleanup on master, so this include-the-jars approach is obsolete. closing |
Sorry, something went wrong.
|
Sorry for not commenting earlier @kalayciburak : we appreciate all contributions and your PR helped us to decide how to solve it. Thanks |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #4436.
The published jar shades a minimized subset of Guava under graphql.com.google.common, but classfiles such as ImmutableList keep RuntimeInvisibleAnnotations that reference annotation types that were never included:
Consumers that compile with -Xlint:classfile -Werror (reported from Spring for GraphQL against 26.0) fail with Cannot find annotation method … class file for … not found.
Change
Test plan
Executed locally: