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

Library has Kotlin runtime bundled into it #1440

Open
Simon3 opened this issue Jan 25, 2023 · 3 comments
Open

Library has Kotlin runtime bundled into it #1440

Simon3 opened this issue Jan 25, 2023 · 3 comments
Assignees

Comments

@Simon3
Copy link

Simon3 commented Jan 25, 2023

Getting this warning(->error) since I bumped to their latest version, some Google libs using auto-value-1.10.1, e.g. com.google.cloud:google-cloud-build (not the only one impacted).

> Task :compileKotlin
w: Some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there's a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath
e: warnings found and -Werror specified
w: /root/.gradle/caches/modules-2/files-2.1/com.google.auto.value/auto-value/1.10.1/e0184c26c3a20257c6fb46eaea16fdd3d7b6d357/auto-value-1.10.1.jar: Library has Kotlin runtime bundled into it

Bumping Kotlin to its latest version fixes the issue.

@eamonnmcmanus eamonnmcmanus self-assigned this Jan 25, 2023
@eamonnmcmanus
Copy link
Member

I think we could probably make this a <scope>provided</scope> dependency, so it's used when building AutoValue but not included in the bundled dependencies.

@tbroyer
Copy link
Contributor

tbroyer commented Jan 26, 2023

Isn't auto-value supposed to only be on the processor classpath, and auto-value-annotations on the compile classpath?

(that said, the Kotlin runtime probably should be a normal dependency rather than shaded? or maybe it's just an issue with shading where it leaves some Kotlin-specific metadata files that should be removed or somehow shaded as well?)

@eamonnmcmanus
Copy link
Member

I already felt a bit bad about bundling the Kotlin runtime. If you're using @AutoBuilder with Kotlin data classes then you presumably already have it, and if you're not using Kotlin at all then it's slightly weird for it to be there. I think with a small bit of reflection we can make things work when it is provided.

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

No branches or pull requests

4 participants