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

Compiles Error: ClassBType.info not yet assigned #228

Closed
He-Pin opened this issue Dec 7, 2024 · 3 comments
Closed

Compiles Error: ClassBType.info not yet assigned #228

He-Pin opened this issue Dec 7, 2024 · 3 comments

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Dec 7, 2024

When run mill __.compile with Java 21 gets:

java 21.0.5 2024-10-15 LTS
Java(TM) SE Runtime Environment (build 21.0.5+9-LTS-239)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.5+9-LTS-239, mixed mode, sharing)

2 tasks failed
sjsonnet.jvm[2.12.18].compile Compilation failed
sjsonnet.jvm[2.13.12].compile java.lang.AssertionError: assertion failed: ClassBType.info not yet assigned: Ljava/lang/Object;
    scala.tools.nsc.backend.jvm.BTypes$ClassBType.info(BTypes.scala:608)
    scala.tools.nsc.backend.jvm.opt.CallGraph.samTypes(CallGraph.scala:274)
    scala.tools.nsc.backend.jvm.opt.CallGraph.samParamTypes(CallGraph.scala:266)
    scala.tools.nsc.backend.jvm.opt.CallGraph.analyzeCallsite(CallGraph.scala:355)
    scala.tools.nsc.backend.jvm.opt.CallGraph.$anonfun$addMethod$6(CallGraph.scala:176)
    scala.tools.nsc.backend.jvm.opt.CallGraph.$anonfun$addMethod$4(CallGraph.scala:173)
    scala.tools.nsc.backend.jvm.opt.CallGraph.$anonfun$addMethod$1(CallGraph.scala:172)
    scala.tools.nsc.backend.jvm.opt.CallGraph.$anonfun$addMethod$1$adapted(CallGraph.scala:140)
    scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
    scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
    scala.collection.AbstractIterator.foreach(Iterator.scala:1300)
    scala.tools.nsc.backend.jvm.opt.CallGraph.addMethod(CallGraph.scala:140)
    scala.tools.nsc.backend.jvm.opt.CallGraph.$anonfun$addClass$1(CallGraph.scala:121)
    scala.tools.nsc.backend.jvm.opt.CallGraph.$anonfun$addClass$1$adapted(CallGraph.scala:121)
    scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
    scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
    scala.collection.AbstractIterable.foreach(Iterable.scala:933)
    scala.tools.nsc.backend.jvm.opt.CallGraph.addClass(CallGraph.scala:121)
    scala.tools.nsc.backend.jvm.PostProcessor.$anonfun$runGlobalOptimizations$5(PostProcessor.scala:120)
    scala.tools.nsc.backend.jvm.PostProcessor.$anonfun$runGlobalOptimizations$5$adapted(PostProcessor.scala:118)
    scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
    scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
    scala.collection.AbstractIterable.foreach(Iterable.scala:933)
    scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:903)
    scala.tools.nsc.backend.jvm.PostProcessor.$anonfun$runGlobalOptimizations$3(PostProcessor.scala:118)
    scala.tools.nsc.backend.jvm.PostProcessor.$anonfun$runGlobalOptimizations$3$adapted(PostProcessor.scala:118)
    scala.collection.immutable.List.foreach(List.scala:333)
    scala.tools.nsc.backend.jvm.PostProcessor.runGlobalOptimizations(PostProcessor.scala:118)
    scala.tools.nsc.backend.jvm.GeneratedClassHandler$GlobalOptimisingGeneratedClassHandler.complete(GeneratedClassHandler.scala:98)
    scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.$anonfun$run$1(GenBCode.scala:81)
    scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:78)
    scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1546)
    scala.tools.nsc.Global$Run.compileUnits(Global.scala:1530)
    scala.tools.nsc.Global$Run.compileSources(Global.scala:1522)
    scala.tools.nsc.Global$Run.compileFiles(Global.scala:1635)
    xsbt.CachedCompiler0.run(CompilerBridge.scala:165)
    xsbt.CachedCompiler0.run(CompilerBridge.scala:134)
    xsbt.CompilerBridge.run(CompilerBridge.scala:39)
    sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
    sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:196)
    scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:252)
    sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:186)
    sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:166)
    sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:241)
    sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:166)
    sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:214)
    sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:542)
    sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:542)
    sbt.internal.inc.Incremental$.$anonfun$apply$3(Incremental.scala:178)
    sbt.internal.inc.Incremental$.$anonfun$apply$3$adapted(Incremental.scala:176)
    sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:454)
    sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:117)
    sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
    sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
    sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:265)
    sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:409)
    sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:496)
    sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:396)
    sbt.internal.inc.Incremental$.apply(Incremental.scala:204)
    sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:542)
    sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:496)
    sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
    sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:433)
    sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
    mill.scalalib.worker.ZincWorkerImpl.compileInternal(ZincWorkerImpl.scala:638)
    mill.scalalib.worker.ZincWorkerImpl.$anonfun$compileMixed$1(ZincWorkerImpl.scala:447)
    mill.scalalib.worker.ZincWorkerImpl.$anonfun$withCompilers$2(ZincWorkerImpl.scala:481)
    mill.api.CachedFactory.withValue(CachedFactory.scala:39)
    mill.scalalib.worker.ZincWorkerImpl.withCompilers(ZincWorkerImpl.scala:480)
    mill.scalalib.worker.ZincWorkerImpl.compileMixed(ZincWorkerImpl.scala:446)
    mill.scalalib.ScalaModule.$anonfun$compile$2(ScalaModule.scala:266)
    mill.define.Task$TraverseCtx.evaluate(Task.scala:215)

@JoshRosen
Copy link
Contributor

Based on some searches on scala/bug and scala/scala, I'm guessing that we might need to bump the Scala maintenance release version in order to support compilation on newer JDKs.

@He-Pin
Copy link
Contributor Author

He-Pin commented Dec 9, 2024

that's true.

@stephenamar-db
Copy link
Collaborator

I do believe we are running the appropriate versions here per https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html

Right now, I think the reasonable objective is to move to JDK17

stephenamar-db pushed a commit that referenced this issue Dec 17, 2024
Motivation:
When compiles it on JDK21, it needs newer version of Scala

Result:
compiles with Java 21 successfully

refs: #228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants