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

Compiler crash when importing coursierapi StringUtil #12998

Open
counter2015 opened this issue May 19, 2024 · 2 comments
Open

Compiler crash when importing coursierapi StringUtil #12998

counter2015 opened this issue May 19, 2024 · 2 comments
Milestone

Comments

@counter2015
Copy link

Reproduction steps

$ cat debug2.scala
//> using scala 2.13.14
//> using dep "org.scalameta:scalafmt-dynamic_2.13:3.8.1"

import coursierapi.shaded.coursier.util.shaded.org.jsoup.internal.StringUtil

object A extends App {
  def debug() =
    println(StringUtil.isBlank(" "))
}


$ scala-cli compile debug2.scala
Compiling project (Scala 2.13.14, JVM (17))
Error compiling project (Scala 2.13.14, JVM (17))
Error: Unexpected error when compiling bugs_855e85f73e-d3333b22c0: java.lang.AssertionError: assertion failed:
  No RuntimeVisibleAnnotations in classfile with ScalaSignature attribute: package object coursier
     while compiling: /home/counter/bugs/debug2.scala
        during phase: globalPhase=typer, enteringPhase=parser
     library version: version 2.13.14
    compiler version: version 2.13.14
  reconstructed args: -bootclasspath /home/counter/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.14/scala-library-2.13.14.jar -classpath /home/counter/bugs/.scala-build/.bloop/bugs_855e85f73e-d3333b22c0/bloop-internal-classes/main-Bj84mU4MTEiv0x2RDa_-fQ==:/home/counter/bugs/.scala-build/bugs_855e85f73e-d3333b22c0/classes/classes-empty-bugs_855e85f73e-d3333b22c0:/home/counter/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/scalafmt-dynamic_2.13/3.8.1/scalafmt-dynamic_2.13-3.8.1.jar:/home/counter/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/scalafmt-interfaces/3.8.1/scalafmt-interfaces-3.8.1.jar:/home/counter/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/interface/0.0.17/interface-0.0.17.jar:/home/counter/.cache/coursier/v1/https/repo1.maven.org/maven2/com/typesafe/config/1.4.3/config-1.4.3.jar -Ycache-plugin-class-loader:last-modified

  last tree to typer: Ident(coursierapi)
       tree position: line 4 of /home/counter/bugs/debug2.scala
            tree tpe: coursierapi.type
              symbol: final package coursierapi
   symbol definition: final package coursierapi (a ModuleSymbol)
      symbol package: <none>
       symbol owners: package coursierapi
           call site: package <empty> in <none>

== Source file context for tree position ==

     1 //> using scala 2.13.14
     2 //> using dep "org.scalameta:scalafmt-dynamic_2.13:3.8.1"
     3
     4 import coursierapi.shaded.coursier.util.shaded.org.jsoup.internal.StringUtil
     5
     6 object A extends App {
     7   def debug() =
        at scala.reflect.internal.SymbolTable.throwAssertionError(SymbolTable.scala:171)
        at scala.tools.nsc.symtab.classfile.ClassfileParser.unpickleOrParseInnerClasses(ClassfileParser.scala:1185)
        at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:495)
        at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$2(ClassfileParser.scala:180)
        at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:154)
        at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:137)
        at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:342)
        at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.$anonfun$complete$2(SymbolLoaders.scala:249)
        at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:247)
        at scala.reflect.internal.Symbols$Symbol.completeInfo(Symbols.scala:1566)
        at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1538)
        at scala.reflect.internal.SymbolTable.openPackageModule(SymbolTable.scala:344)
        at scala.reflect.internal.SymbolTable.openPackageModule(SymbolTable.scala:398)
        at scala.tools.nsc.Global.openPackageModule(Global.scala:85)
        at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:312)
        at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.$anonfun$complete$2(SymbolLoaders.scala:249)
        at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:247)
        at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.load(SymbolLoaders.scala:268)
        at scala.reflect.internal.Symbols$Symbol.$anonfun$typeParams$1(Symbols.scala:1811)
        at scala.reflect.internal.Symbols$Symbol.completeTypeParams$1(Symbols.scala:1811)
        at scala.reflect.internal.Symbols$Symbol.typeParams(Symbols.scala:1818)
        at scala.reflect.internal.Types.isRawIfWithoutArgs(Types.scala:4420)
        at scala.reflect.internal.Types.isRawIfWithoutArgs$(Types.scala:4420)
        at scala.reflect.internal.SymbolTable.isRawIfWithoutArgs(SymbolTable.scala:28)
        at scala.reflect.internal.tpe.TypeMaps$$anon$1.apply(TypeMaps.scala:288)
        at scala.reflect.internal.tpe.TypeMaps$$anon$1.apply(TypeMaps.scala:285)
        at scala.reflect.internal.Symbols$Symbol.modifyInfo(Symbols.scala:1601)
        at scala.reflect.internal.Symbols$Symbol.cookJavaRawInfo(Symbols.scala:1762)
        at scala.tools.nsc.typechecker.Infer$Inferencer.checkAccessible(Infer.scala:302)
        at scala.tools.nsc.typechecker.Typers$Typer.makeAccessible(Typers.scala:592)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$63(Typers.scala:5537)
        at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:713)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelect$1(Typers.scala:5537)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:5604)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6206)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6359)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6206)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6359)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6206)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6359)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6206)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6359)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6206)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6359)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6206)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$importSig(Namers.scala:1844)
        at scala.tools.nsc.typechecker.Namers$Namer$ImportTypeCompleter.completeImpl(Namers.scala:884)
        at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter.complete(Namers.scala:2100)
        at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter.complete$(Namers.scala:2098)
        at scala.tools.nsc.typechecker.Namers$TypeCompleterBase.complete(Namers.scala:2093)
        at scala.reflect.internal.Symbols$Symbol.completeInfo(Symbols.scala:1566)
        at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1538)
        at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1733)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3377)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$9(Typers.scala:3539)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3539)
        at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5844)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6171)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6261)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:125)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:481)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:112)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1559)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1543)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1535)
        at scala.tools.nsc.Global$Run.compileFiles(Global.scala:1648)
        at scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:176)
        at scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:139)
        at scala.tools.xsbt.CompilerBridge.run(CompilerBridge.scala:43)
        at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
        at sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.compileSources$1(BloopHighLevelCompiler.scala:133)
        at sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.$anonfun$compile$7(BloopHighLevelCompiler.scala:159)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.$anonfun$compile$1(BloopHighLevelCompiler.scala:71)
        at bloop.tracing.NoopTracer$.trace(BraveTracer.scala:53)
        at sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.timed$1(BloopHighLevelCompiler.scala:70)
        at sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.$anonfun$compile$6(BloopHighLevelCompiler.scala:159)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:81)
        at monix.eval.internal.TaskRestartCallback.syncOnSuccess(TaskRestartCallback.scala:101)
        at monix.eval.internal.TaskRestartCallback.onSuccess(TaskRestartCallback.scala:74)
        at monix.eval.internal.TaskExecuteOn$AsyncRegister$$anon$1.run(TaskExecuteOn.scala:71)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Compilation failed

Problem

It should compile noramlly.

see also: scala/scala3#20405

@SethTisue SethTisue added this to the 2.13.15 milestone May 21, 2024
@SethTisue
Copy link
Member

SethTisue commented May 21, 2024

Interesting. We should look into this.

Though perhaps the root cause lies in how the shading was done, somehow?

@som-snytt
Copy link

There is a lrytz diagnostic on the linked ticket, but I'm not sure whose assumption was broken.

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