Ignore stub symbols when API hashing annotations#701
Conversation
|
this will ship in sbt 1.3.3? |
|
Yes. |
|
@retronym I tried compiling kafka with Gradle, Scala 2.12.11, Java 11 and Zinc 1.3.5 (which has this fix) and I still get: Any ideas? |
This stack trace suggests that I'm still using an old version of Zinc via Gradle 6.3 -- notice that it stall calls What version of Gradle (or Gradle Scala Plugin, if that is separately upgradable) are you testing with? |
|
Oh, I see you've been busy: gradle/gradle@3dfd2b1 |
|
Thanks for checking this! I thought I was overriding the zinc version via: https://github.com/apache/kafka/blob/trunk/build.gradle#L428 As you found, I also submitted the Zinc upgrade to the Gradle project. That should be part of Gradle 6.4. I'll try Gradle 6.4 RC1 to check if it fixes the issue. |
|
Hmmm, it does look like the right version of Zinc is in use already. |
|
Hmmm, it was already backported in #705. |
|
Good news, Gradle 6.4-RC1 fixes the issue! No idea why though. Gradle 6.3:
Gradle 6.4:
|
|
I suspect there is a bug in Gradle's resolution and/or dynamic compilation of compiler-interface.jar, perhaps only when you exceed the maximum supported version of Zinc? |
|
Possibly. :) In any case, it looks like this should work out of the box soon, which is great. Thanks for the help! |
|
DownloadingScalaToolChain in Gradle code hard codes references to |
|
Good find! Are you planning to submit the bug upstream? |
|
Good idea: gradle/gradle#12869 |
|
Thanks! |
In 6f32b62, I made sure the compiler could survive parsing a Java classfile referring to annotations missing from the classpath, but we could still run into trouble when a Scala unpickled class does the same. Tweaking the Tasty unpickler to drop missing annotations would require always forcing the symbols of all annotations which I would rather avoid doing. Instead, we adopt the same solution as Scala 2 did in sbt/zinc#701 and special-case the single place where we force annotations of inherited members to ignore missing annotations.

Fixes scala/bug#11679