Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-value 1.10 includes (very old) copies of org.jetbrains.annotations.(NotNull|Nullable) #1389

Closed
pburka opened this issue Nov 4, 2022 · 2 comments · Fixed by #1393
Closed
Assignees

Comments

@pburka
Copy link

pburka commented Nov 4, 2022

The auto-value-1.10.jar on Maven includes two non-shaded classes copied from jetbrains-annotations 13.0:

     546  Defl:N      325  41% 2013-12-17 16:10 ed26fa9e  org/jetbrains/annotations/NotNull.class
     548  Defl:N      326  41% 2013-12-17 16:10 d6e46bc1  org/jetbrains/annotations/Nullable.class

The current version of jetbrains-annotations is 23.0, and the annotations are different in the new version. Specifically, the annotation target has been extended to include TYPE_USE in newer versions. By including these old annotations, auto-value can shadow the new versions (depending on classpath order), resulting in compilation errors, especially if auto-value is being used somewhat naively (i.e. on the classpath instead of the processorpath).

Ideally, the auto-value jar shouldn't include unshaded jetbrains annotations. If it must include them, it should pull them from the latest version rather than the oldest.

@eamonnmcmanus
Copy link
Member

The problem arises like this:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ auto-value ---
[INFO] com.google.auto.value:auto-value:jar:HEAD-SNAPSHOT
[INFO] \- org.jetbrains.kotlinx:kotlinx-metadata-jvm:jar:0.5.0:compile
[INFO]    \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.7.0:compile
[INFO]       \- org.jetbrains:annotations:jar:13.0:compile

Sadly kotlin-stdlib depends on this ancient version of org.jetbrains:annotations. From 2013!

Anyway, this was an oversight. There's no reason we can't shade org.jetbrains along with everything else.

copybara-service bot pushed a commit that referenced this issue Nov 17, 2022
Also reorder the `<relocation>` configuration entries lexicographically.

Fixes #1389.

RELNOTES=Two annotations from `org.jetbrains.annotations` were accidentally included unshaded in the AutoValue jar. That has been fixed.
PiperOrigin-RevId: 489251131
copybara-service bot pushed a commit that referenced this issue Nov 17, 2022
Also reorder the `<relocation>` configuration entries lexicographically.

Fixes #1389.

RELNOTES=Two annotations from `org.jetbrains.annotations` were accidentally included unshaded in the AutoValue jar. That has been fixed.
PiperOrigin-RevId: 489251131
@eamonnmcmanus
Copy link
Member

This problem is fixed in the just-released 1.10.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants