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

XBasicAnnotationProcessor not fully shaded and confuses kotlinc in 2.38 #2765

Closed
ZacSweers opened this issue Jul 20, 2021 · 0 comments · Fixed by #2777 · May be fixed by #2767
Closed

XBasicAnnotationProcessor not fully shaded and confuses kotlinc in 2.38 #2765

ZacSweers opened this issue Jul 20, 2021 · 0 comments · Fixed by #2777 · May be fixed by #2767

Comments

@ZacSweers
Copy link

We have some custom code gen that runs dagger-compiler manually in some compile tests, and Dagger 2.38 seems to have some confusing dependencies/classpath issues.

This is the trace from compileKotlin when we try to compile against it with some sources directly referencing ComponentProcessor.

e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:	
    class dagger.shaded.androidx.room.compiler.processing.javac.JavacBasicAnnotationProcessor, unresolved supertypes: com.google.auto.common.BasicAnnotationProcessor, androidx.room.compiler.processing.XBasicAnnotationProcessor	
Adding -Xextended-compiler-checks argument might provide additional information.
copybara-service bot pushed a commit that referenced this issue Jul 22, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched to using shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Closes #2765

RELNOTES=Fix #2765: Fixes xprocessing jar to properly handle shading.
PiperOrigin-RevId: 386099651
copybara-service bot pushed a commit that referenced this issue Jul 22, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched to using shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Closes #2765

RELNOTES=Fix #2765: Fixes xprocessing jar to properly handle shading.
PiperOrigin-RevId: 386099651
copybara-service bot pushed a commit that referenced this issue Jul 22, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched to using shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Closes #2765

RELNOTES=Fix #2765: Fixes xprocessing jar to properly handle shading.
PiperOrigin-RevId: 386099651
copybara-service bot pushed a commit that referenced this issue Jul 23, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 386485460
copybara-service bot pushed a commit that referenced this issue Jul 26, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 386485460
copybara-service bot pushed a commit that referenced this issue Jul 26, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 386485460
copybara-service bot pushed a commit that referenced this issue Jul 26, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 386485460
copybara-service bot pushed a commit that referenced this issue Jul 26, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 386485460
copybara-service bot pushed a commit that referenced this issue Jul 27, 2021
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 386485460
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant