Skip to content

Can't build scala3-compiler with JDK 14 #10133

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

Closed
bishabosha opened this issue Oct 31, 2020 · 3 comments · Fixed by #10135
Closed

Can't build scala3-compiler with JDK 14 #10133

bishabosha opened this issue Oct 31, 2020 · 3 comments · Fixed by #10135

Comments

@bishabosha
Copy link
Member

bishabosha commented Oct 31, 2020

Minimized code

using JDK 14 on commit 1ab76c1:

openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.1+7, mixed mode, sharing)
sbt:scala3> clean
sbt:scala3> repl

Output (click arrow to expand)

exception caught when loading class AnnotationDefault: java.lang.NullPointerException
[error] error while loading PreviewFeature,
[error] class file /modules/java.base/jdk/internal/PreviewFeature.class is broken, reading aborted with class java.lang.NullPointerException
[error] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[error] externalName = jdk.internal.PreviewFeature$Feature,
[error] outerName = jdk.internal.PreviewFeature,
[error] innerName = Feature
[error] owner.fullName = jdk.internal.PreviewFeature
[error] while parsing /modules/java.base/java/lang/Class.class while parsing annotations in /modules/java.base/java/lang/Class.class
[error] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[error] externalName = jdk.internal.PreviewFeature$Feature,
[error] outerName = jdk.internal.PreviewFeature,
[error] innerName = Feature
[error] owner.fullName = jdk.internal.PreviewFeature
[error] while parsing /modules/java.base/java/lang/Class.class while parsing annotations in /modules/java.base/java/lang/Class.class
[error] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[error] externalName = jdk.internal.PreviewFeature$Feature,
[error] outerName = jdk.internal.PreviewFeature,
[error] innerName = Feature
[error] owner.fullName = jdk.internal.PreviewFeature
[error] while parsing /modules/java.base/java/lang/String.class while parsing annotations in /modules/java.base/java/lang/String.class
[error] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[error] externalName = jdk.internal.PreviewFeature$Feature,
[error] outerName = jdk.internal.PreviewFeature,
[error] innerName = Feature
[error] owner.fullName = jdk.internal.PreviewFeature
[error] while parsing /modules/java.base/java/lang/String.class while parsing annotations in /modules/java.base/java/lang/String.class
[error] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[error] externalName = jdk.internal.PreviewFeature$Feature,
[error] outerName = jdk.internal.PreviewFeature,
[error] innerName = Feature
[error] owner.fullName = jdk.internal.PreviewFeature
[error] while parsing /modules/java.base/java/lang/String.class while parsing annotations in /modules/java.base/java/lang/String.class
[error] 6 errors found
[error] (scala3-library-bootstrapped / Compile / compileIncremental) Compilation failed
[error] Total time: 77 s (01:17), completed 1 Nov 2020, 00:27:03
@bishabosha
Copy link
Member Author

related to #10037 and #10131 ?

@smarter
Copy link
Member

smarter commented Oct 31, 2020

It's interesting cause I tried it recently and compilation worked (there was a few test failures for things that have since been fixed): https://github.com/smarter/dotty/actions/runs/245223848, so there's a good chance it regressed in #10037

@griggt
Copy link
Contributor

griggt commented Nov 1, 2020

git bisect shows the culprit as a8f1cfb in #10037 when using:

openjdk version "14.0.2" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.2+12)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.2+12, mixed mode, sharing)

liufengyun added a commit to dotty-staging/dotty that referenced this issue Nov 1, 2020
Now we do the same as Scala 2. It reverts the following commit:

scala@6be9c7c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment