-
Notifications
You must be signed in to change notification settings - Fork 374
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
GWT Compiler failure with type-use annotations #10001
Comments
I can reproduce the issue with both 2.11 and HEAD. The error message seems to imply that asm's ClassReader believes that the bytecode of javap believes that this is valid:
At the time when the error is happening, it is processing the I'm pretty sure objectweb has misread the preceding annotation Java and asm disagree here, I'm inclined to side with Java without more evidence, but this does look like a bug in asm rather than GWT. I'll try to dig in a little more and file an issue with asm with a reproducer trying to read jspecify.jar More reading: https://docs.oracle.com/javase/specs/jvms/se20/html/jvms-4.html#jvms-4.7.16 |
While GWT has no use for JPMS modules, sources that rely on this target fail to compile with GWT (causing an error in JDT that results in a hard-to-interpret asm stack trace). Fixes gwtproject#10001
My notes from working on this today, in case something like this comes back again and finding these in a search helps me or anyone else: Updating GWT to asm 9.7 does not resolve this. Based on the spec link above, I went over the bytes again, starting from the top of the RuntimeVisibleAnnotations section. I didn't quite have the pattern right above, the Bytes of the file with their offset and my summary, starting at 432:
So the bytes don't make sense, but I couldn't understand why. Next I looked to see where the bytes were coming from, in case ASM was doing its best, but something in GWT was causing the issue. DiskCacheToken had an offset into my /tmp/gwtbyte-cache file, which pointed to 4 bytes before the specific class started. Those 4 bytes had the length to read from the file - after adding 4 to the offset and using the given length, I was able to use In contrast, MarkedNull had many more inconsistencies, whole sections of the data were missing, rather than just having written slightly different values in a few places. Tracing how the CompiledClass instance was created (the constructor of the call in the initial stack trace), the original JDT-created class had errors associated with it - specifically that ElementType.MODULE could not be found. Updating GWT's own copy of ElementType.java appears to have resolved this:
The linked PR resolves this for me locally, but it might be a good idea to warn about JDT-reported errors, in case they cause other internal errors like this. |
I did a test and it seems to be working fine with dagger HEAD-SNAPSHOT. You have done an exceptional job in solving this problem. |
Hi,
I rely on dagger in all of my projects, but I have encountered an issue with the recent changes made to it. These changes have caused the GWT compiler to fail. The details of this problem can be found in the following link:
google/dagger#4391 (comment)
I have a repo where this issue is present and would like some help resolving them:
https://github.com/natros/jspec
The error messages are as follows:
My understanding is that the GWT compiler does not support type-use annotations with the JSpecify library.
The code in question is similar to the code generated by Dagger.
Tested with gwt 2.11.0 and HEAD-SNAPSHOT
Thanks
The text was updated successfully, but these errors were encountered: