-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add JDK 9 constant types to the ClassfileParser #8289
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
Conversation
Fixes scala/bug#11635 Occasionally the compiler tries to parse the class files from the classpath. This happens, for example, during scaladoc comment referencing a class name `java.time.Instant`. This would cause error in JDK11 because it includes an unknown constant pool tag 9 (CONSTANT_Module). This updates the parser to skip it over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for 2.12.9
According to the JVMS:
(same for CONSTANT_PACKAGE). And classfiles with ACC_MODULE set correspond to The crash here means that the ClassfileParser is in fact reading these module-info classfiles, skipping over these constants may mask the problem, but something is still wrong here, it might not matter in practice, but it might make the compiler hallucinate classes called |
@retronym wdyt, is this sufficient for 2.12.9, or should we aim higher? |
This is okay for now. When we pick up https://github.com/scala/scala/pull/7218/files#diff-80bc15dacd4ac157908b9e98551ea58aR174 again, we'll exclude this |
Chiefly, this fixes an issue where the doc task would fail with Lift 3.3.0 and Scala <2.12.9, because Lift 3.3.0 was compiled with JDK 9 and the doc compiler pre-2.12.9 had issues with certain constants from JDK 9 (see scala/bug#11635 and scala/scala#8289).
We still maintain 2.11.12 cross builds and are affected by it, is there a workaround without reverting the offending dependencies? |
whether there is a workaround might depend on what context you're hitting this in. is it during Scaladoc generation, or somewhere else? separately, it's not exactly a "workaround", but you (or someone) could submit a 2.11.x backport of this PR, for inclusion in a possible eventual 2.11.13 release (no such release is planned, but if one does happen, you wouldn't want this change to miss the boat). if the PR is merged, then a Scala nightly would be published that you could use in your crossbuild. (caveat: the nightly builds aren't published to Maven Central and aren't guaranteed to exist indefinitely, though in practice they are re-create-able and aren't likely to disappear in the first place) |
Yeah it failed in Submitted #8595 backport. A few libs (notably Spark) may have to support 2.11 for a while so it'd be nice to have a 2.11.13 release eventually :) |
Fixes scala/bug#11635
Occasionally the compiler tries to parse the class files from the classpath. This happens, for example, during scaladoc comment referencing a class name
java.time.Instant
. This would cause error in JDK11 because it includes an unknown constant pool tag 19 (CONSTANT_Module). This updates the parser to skip it over.