bazelbuild / rules_kotlin

Bazel rules for Kotlin
Apache License 2.0
331 stars 206 forks source link

Shade Guava to avoid conflicts with ksp plugins #1167

Closed erikkerber closed 5 months ago

erikkerber commented 5 months ago

We have a KSP plugin locally that uses Guava, and would conflict at class load time.

I'm not 100% sure if this rule is the best rule, but experimentally com.google.common.base.* and com.google.* both broke other parts of the build process.

Bencodes commented 5 months ago

This should be resolved by https://github.com/bazelbuild/rules_kotlin/pull/1139. Let me know if it doesn't.

erikkerber commented 5 months ago

It does not unfortunately. This jarjar rule on top of that change still does fix the build on our side though.

EdbertChan commented 5 months ago

Linking https://github.com/bazelbuild/rules_kotlin/issues/1138 since the primary issue I was running into was that Dagger is picking up the Guava classes packed with KotlinCompiler.jar

restingbull commented 5 months ago

I'm somewhat inclined to suggest you shade the KSP plugin that uses Guava, tbh.

I suspect the correct answer is that everyone shades guava.