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 crashes when using macros in Scala 2.12 with JDK 13 #11608

Closed
lukaseder opened this issue Jul 3, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@lukaseder
Copy link

commented Jul 3, 2019

Starting from JDK 13, compilation of some Scala classes that use third party libraries using macros behind the scenes causes the compiler to crash.

The compiler output can be seen here:

C:\Users\lukas\workspace\playground\scala>mvn clean install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:scala-jdk-13:jar:0.0.1
[WARNING] 'build.plugins.plugin.version' for net.alchim31.maven:scala-maven-plugin is missing. @ line 21, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ----------------------< com.example:scala-jdk-13 >----------------------
[INFO] Building scala-jdk-13 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ scala-jdk-13 ---
[INFO] Deleting C:\Users\lukas\workspace\playground\scala\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ scala-jdk-13 ---
[WARNING] Using platform encoding (UTF8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\lukas\workspace\playground\scala\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ scala-jdk-13 ---
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:4.1.0:compile (default) @ scala-jdk-13 ---
[INFO] compile in 0.0 s
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ scala-jdk-13 ---
[WARNING] Using platform encoding (UTF8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\lukas\workspace\playground\scala\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ scala-jdk-13 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:4.1.0:testCompile (default) @ scala-jdk-13 ---
[INFO] Using incremental compilation using Mixed compile order
[INFO] Compiling 1 Scala source to C:\Users\lukas\workspace\playground\scala\target\test-classes ...
[ERROR] ## Exception when compiling 1 sources to C:\Users\lukas\workspace\playground\scala\target\test-classes
java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
java.base/jdk.internal.jrtfs.JrtPath.toUri(JrtPath.java:176)
scala.tools.nsc.classpath.JrtClassPath.asURLs(DirectoryClassPath.scala:213)
scala.tools.nsc.classpath.AggregateClassPath.$anonfun$asURLs$1(AggregateClassPath.scala:64)
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:244)
scala.collection.Iterator.foreach(Iterator.scala:941)
scala.collection.Iterator.foreach$(Iterator.scala:941)
scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
scala.collection.IterableLike.foreach(IterableLike.scala:74)
scala.collection.IterableLike.foreach$(IterableLike.scala:73)
scala.collection.AbstractIterable.foreach(Iterable.scala:56)
scala.collection.TraversableLike.flatMap(TraversableLike.scala:244)
scala.collection.TraversableLike.flatMap$(TraversableLike.scala:241)
scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
scala.tools.nsc.classpath.AggregateClassPath.asURLs(AggregateClassPath.scala:64)
scala.tools.nsc.typechecker.Macros.findMacroClassLoader(Macros.scala:78)
scala.tools.nsc.typechecker.Macros.findMacroClassLoader$(Macros.scala:77)
scala.tools.nsc.Global$$anon$4.findMacroClassLoader(Global.scala:477)
scala.reflect.macros.runtime.MacroRuntimes.$anonfun$defaultMacroClassloaderCache$2(MacroRuntimes.scala:68)
scala.reflect.internal.SymbolTable$perRunCaches$$anon$2.apply(SymbolTable.scala:477)
scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader(MacroRuntimes.scala:70)
scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader$(MacroRuntimes.scala:70)
scala.tools.nsc.Global$$anon$4.defaultMacroClassloader(Global.scala:477)
scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveRuntime(MacroRuntimes.scala:88)
scala.reflect.macros.runtime.MacroRuntimes.$anonfun$standardMacroRuntime$3(MacroRuntimes.scala:50)
scala.collection.mutable.MapLike.getOrElseUpdate(MapLike.scala:209)
scala.collection.mutable.MapLike.getOrElseUpdate$(MapLike.scala:206)
scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:82)
scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime(MacroRuntimes.scala:50)
scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime$(MacroRuntimes.scala:43)
scala.tools.nsc.Global$$anon$4.standardMacroRuntime(Global.scala:477)
scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$14.default(AnalyzerPlugins.scala:455)
scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$14.default(AnalyzerPlugins.scala:452)
scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:408)
scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime(AnalyzerPlugins.scala:452)
scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime$(AnalyzerPlugins.scala:452)
scala.tools.nsc.Global$$anon$4.pluginsMacroRuntime(Global.scala:477)
scala.reflect.macros.runtime.MacroRuntimes.macroRuntime(MacroRuntimes.scala:37)
scala.reflect.macros.runtime.MacroRuntimes.macroRuntime$(MacroRuntimes.scala:37)
scala.tools.nsc.Global$$anon$4.macroRuntime(Global.scala:477)
scala.tools.nsc.typechecker.Macros$MacroExpander.$anonfun$expand$1(Macros.scala:631)
scala.tools.nsc.Global.withInfoLevel(Global.scala:227)
scala.tools.nsc.typechecker.Macros$MacroExpander.expand(Macros.scala:625)
scala.tools.nsc.typechecker.Macros$MacroExpander.apply(Macros.scala:612)
scala.tools.nsc.typechecker.Macros.standardMacroExpand(Macros.scala:787)
scala.tools.nsc.typechecker.Macros.standardMacroExpand$(Macros.scala:785)
scala.tools.nsc.Global$$anon$4.standardMacroExpand(Global.scala:477)
scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:439)
scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:436)
scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:408)
scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand(AnalyzerPlugins.scala:436)
scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand$(AnalyzerPlugins.scala:436)
scala.tools.nsc.Global$$anon$4.pluginsMacroExpand(Global.scala:477)
scala.tools.nsc.typechecker.Macros.macroExpand(Macros.scala:776)
scala.tools.nsc.typechecker.Macros.macroExpand$(Macros.scala:769)
scala.tools.nsc.Global$$anon$4.macroExpand(Global.scala:477)
scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1183)
scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1243)
scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1216)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.scala:768)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.scala:705)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecker$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:529)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:1028)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:1059)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1116)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1512)
scala.tools.nsc.typechecker.Implicits.inferImplicit1(Implicits.scala:111)
scala.tools.nsc.typechecker.Implicits.inferImplicit(Implicits.scala:92)
scala.tools.nsc.typechecker.Implicits.inferImplicit$(Implicits.scala:89)
scala.tools.nsc.Global$$anon$4.inferImplicit(Global.scala:477)
scala.tools.nsc.typechecker.Implicits.inferImplicitFor(Implicits.scala:47)
scala.tools.nsc.typechecker.Implicits.inferImplicitFor$(Implicits.scala:46)
scala.tools.nsc.Global$$anon$4.inferImplicitFor(Global.scala:477)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$applyImplicitArgs$2(Typers.scala:263)
scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:256)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$1(Typers.scala:901)
scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:491)
scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1239)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5790)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3373)
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3373)
scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2030)
scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1843)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5646)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5726)
scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5790)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3373)
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3373)
scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5356)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5649)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5726)
scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:114)
scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:448)
scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:103)
scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1498)
scala.tools.nsc.Global$Run.compileUnits(Global.scala:1482)
scala.tools.nsc.Global$Run.compileSources(Global.scala:1475)
scala.tools.nsc.Global$Run.compile(Global.scala:1598)
xsbt.CachedCompiler0.run(CompilerInterface.scala:153)
xsbt.CachedCompiler0.run(CompilerInterface.scala:125)
xsbt.CompilerInterface.run(CompilerInterface.scala:39)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/java.lang.reflect.Method.invoke(Method.java:567)
sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:248)
sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:122)
sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:95)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:91)
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3$adapted(MixedAnalyzingCompiler.scala:77)
sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:215)
sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:77)
sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:146)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:343)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:343)
sbt.internal.inc.Incremental$.doCompile(Incremental.scala:120)
sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:100)
sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:180)
sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:98)
sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:102)
sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:155)
sbt.internal.inc.Incremental$.compile(Incremental.scala:92)
sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:75)
sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:348)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:301)
sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:168)
sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:248)
sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:74)
sbt_inc.SbtIncrementalCompiler.compile(SbtIncrementalCompiler.java:130)
scala_maven.ScalaCompilerSupport.incrementalCompile(ScalaCompilerSupport.java:299)
scala_maven.ScalaCompilerSupport.compile(ScalaCompilerSupport.java:101)
scala_maven.ScalaCompilerSupport.doExecute(ScalaCompilerSupport.java:83)
scala_maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:555)
scala_maven.ScalaTestCompileMojo.execute(ScalaTestCompileMojo.java:49)
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/java.lang.reflect.Method.invoke(Method.java:567)
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.693 s
[INFO] Finished at: 2019-07-03T11:34:33+02:00
[INFO] ------------------------------------------------------------------------
---------------------------------------------------
constituent[0]: file:/C:/apache-maven-3.6.0/bin/../conf/logging/
constituent[1]: file:/C:/apache-maven-3.6.0/bin/../lib/animal-sniffer-annotations-1.14.jar
constituent[2]: file:/C:/apache-maven-3.6.0/bin/../lib/aopalliance-1.0.jar
constituent[3]: file:/C:/apache-maven-3.6.0/bin/../lib/cdi-api-1.0.jar
constituent[4]: file:/C:/apache-maven-3.6.0/bin/../lib/checker-compat-qual-2.0.0.jar
constituent[5]: file:/C:/apache-maven-3.6.0/bin/../lib/commons-cli-1.4.jar
constituent[6]: file:/C:/apache-maven-3.6.0/bin/../lib/commons-io-2.5.jar
constituent[7]: file:/C:/apache-maven-3.6.0/bin/../lib/commons-lang3-3.8.1.jar
constituent[8]: file:/C:/apache-maven-3.6.0/bin/../lib/error_prone_annotations-2.1.3.jar
constituent[9]: file:/C:/apache-maven-3.6.0/bin/../lib/guava-25.1-android.jar
constituent[10]: file:/C:/apache-maven-3.6.0/bin/../lib/guice-4.2.1-no_aop.jar
constituent[11]: file:/C:/apache-maven-3.6.0/bin/../lib/j2objc-annotations-1.1.jar
constituent[12]: file:/C:/apache-maven-3.6.0/bin/../lib/jansi-1.17.1.jar
constituent[13]: file:/C:/apache-maven-3.6.0/bin/../lib/javax.inject-1.jar
constituent[14]: file:/C:/apache-maven-3.6.0/bin/../lib/jcl-over-slf4j-1.7.25.jar
constituent[15]: file:/C:/apache-maven-3.6.0/bin/../lib/jsr250-api-1.0.jar
constituent[16]: file:/C:/apache-maven-3.6.0/bin/../lib/jsr305-3.0.2.jar
constituent[17]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-artifact-3.6.0.jar
constituent[18]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-builder-support-3.6.0.jar
constituent[19]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-compat-3.6.0.jar
constituent[20]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-core-3.6.0.jar
constituent[21]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-embedder-3.6.0.jar
constituent[22]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-model-3.6.0.jar
constituent[23]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-model-builder-3.6.0.jar
constituent[24]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-plugin-api-3.6.0.jar
constituent[25]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-repository-metadata-3.6.0.jar
constituent[26]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-api-1.3.1.jar
constituent[27]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-connector-basic-1.3.1.jar
constituent[28]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-impl-1.3.1.jar
constituent[29]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-provider-3.6.0.jar
constituent[30]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-spi-1.3.1.jar
constituent[31]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-transport-wagon-1.3.1.jar
constituent[32]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-resolver-util-1.3.1.jar
constituent[33]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-settings-3.6.0.jar
constituent[34]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-settings-builder-3.6.0.jar
constituent[35]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-shared-utils-3.2.1.jar
constituent[36]: file:/C:/apache-maven-3.6.0/bin/../lib/maven-slf4j-provider-3.6.0.jar
constituent[37]: file:/C:/apache-maven-3.6.0/bin/../lib/org.eclipse.sisu.inject-0.3.3.jar
constituent[38]: file:/C:/apache-maven-3.6.0/bin/../lib/org.eclipse.sisu.plexus-0.3.3.jar
constituent[39]: file:/C:/apache-maven-3.6.0/bin/../lib/plexus-cipher-1.7.jar
constituent[40]: file:/C:/apache-maven-3.6.0/bin/../lib/plexus-component-annotations-1.7.1.jar
constituent[41]: file:/C:/apache-maven-3.6.0/bin/../lib/plexus-interpolation-1.25.jar
constituent[42]: file:/C:/apache-maven-3.6.0/bin/../lib/plexus-sec-dispatcher-1.4.jar
constituent[43]: file:/C:/apache-maven-3.6.0/bin/../lib/plexus-utils-3.1.0.jar
constituent[44]: file:/C:/apache-maven-3.6.0/bin/../lib/slf4j-api-1.7.25.jar
constituent[45]: file:/C:/apache-maven-3.6.0/bin/../lib/wagon-file-3.2.0.jar
constituent[46]: file:/C:/apache-maven-3.6.0/bin/../lib/wagon-http-3.2.0-shaded.jar
constituent[47]: file:/C:/apache-maven-3.6.0/bin/../lib/wagon-provider-api-3.2.0.jar
---------------------------------------------------
Exception in thread "main" java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
        at java.base/jdk.internal.jrtfs.JrtPath.toUri(JrtPath.java:176)
        at scala.tools.nsc.classpath.JrtClassPath.asURLs(DirectoryClassPath.scala:213)
        at scala.tools.nsc.classpath.AggregateClassPath.$anonfun$asURLs$1(AggregateClassPath.scala:64)
        at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:244)
        at scala.collection.Iterator.foreach(Iterator.scala:941)
        at scala.collection.Iterator.foreach$(Iterator.scala:941)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
        at scala.collection.IterableLike.foreach(IterableLike.scala:74)
        at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
        at scala.collection.TraversableLike.flatMap(TraversableLike.scala:244)
        at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:241)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
        at scala.tools.nsc.classpath.AggregateClassPath.asURLs(AggregateClassPath.scala:64)
        at scala.tools.nsc.typechecker.Macros.findMacroClassLoader(Macros.scala:78)
        at scala.tools.nsc.typechecker.Macros.findMacroClassLoader$(Macros.scala:77)
        at scala.tools.nsc.Global$$anon$4.findMacroClassLoader(Global.scala:477)
        at scala.reflect.macros.runtime.MacroRuntimes.$anonfun$defaultMacroClassloaderCache$2(MacroRuntimes.scala:68)
        at scala.reflect.internal.SymbolTable$perRunCaches$$anon$2.apply(SymbolTable.scala:477)
        at scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader(MacroRuntimes.scala:70)
        at scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader$(MacroRuntimes.scala:70)
        at scala.tools.nsc.Global$$anon$4.defaultMacroClassloader(Global.scala:477)
        at scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveRuntime(MacroRuntimes.scala:88)
        at scala.reflect.macros.runtime.MacroRuntimes.$anonfun$standardMacroRuntime$3(MacroRuntimes.scala:50)
        at scala.collection.mutable.MapLike.getOrElseUpdate(MapLike.scala:209)
        at scala.collection.mutable.MapLike.getOrElseUpdate$(MapLike.scala:206)
        at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:82)
        at scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime(MacroRuntimes.scala:50)
        at scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime$(MacroRuntimes.scala:43)
        at scala.tools.nsc.Global$$anon$4.standardMacroRuntime(Global.scala:477)
        at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$14.default(AnalyzerPlugins.scala:455)
        at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$14.default(AnalyzerPlugins.scala:452)
        at scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:408)
        at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime(AnalyzerPlugins.scala:452)
        at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime$(AnalyzerPlugins.scala:452)
        at scala.tools.nsc.Global$$anon$4.pluginsMacroRuntime(Global.scala:477)
        at scala.reflect.macros.runtime.MacroRuntimes.macroRuntime(MacroRuntimes.scala:37)
        at scala.reflect.macros.runtime.MacroRuntimes.macroRuntime$(MacroRuntimes.scala:37)
        at scala.tools.nsc.Global$$anon$4.macroRuntime(Global.scala:477)
        at scala.tools.nsc.typechecker.Macros$MacroExpander.$anonfun$expand$1(Macros.scala:631)
        at scala.tools.nsc.Global.withInfoLevel(Global.scala:227)
        at scala.tools.nsc.typechecker.Macros$MacroExpander.expand(Macros.scala:625)
        at scala.tools.nsc.typechecker.Macros$MacroExpander.apply(Macros.scala:612)
        at scala.tools.nsc.typechecker.Macros.standardMacroExpand(Macros.scala:787)
        at scala.tools.nsc.typechecker.Macros.standardMacroExpand$(Macros.scala:785)
        at scala.tools.nsc.Global$$anon$4.standardMacroExpand(Global.scala:477)
        at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:439)
        at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:436)
        at scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:408)
        at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand(AnalyzerPlugins.scala:436)
        at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand$(AnalyzerPlugins.scala:436)
        at scala.tools.nsc.Global$$anon$4.pluginsMacroExpand(Global.scala:477)
        at scala.tools.nsc.typechecker.Macros.macroExpand(Macros.scala:776)
        at scala.tools.nsc.typechecker.Macros.macroExpand$(Macros.scala:769)
        at scala.tools.nsc.Global$$anon$4.macroExpand(Global.scala:477)
        at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1183)
        at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1243)
        at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1216)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.scala:768)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.scala:705)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecker$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:529)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:1028)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:1059)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1116)
        at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1512)
        at scala.tools.nsc.typechecker.Implicits.inferImplicit1(Implicits.scala:111)
        at scala.tools.nsc.typechecker.Implicits.inferImplicit(Implicits.scala:92)
        at scala.tools.nsc.typechecker.Implicits.inferImplicit$(Implicits.scala:89)
        at scala.tools.nsc.Global$$anon$4.inferImplicit(Global.scala:477)
        at scala.tools.nsc.typechecker.Implicits.inferImplicitFor(Implicits.scala:47)
        at scala.tools.nsc.typechecker.Implicits.inferImplicitFor$(Implicits.scala:46)
        at scala.tools.nsc.Global$$anon$4.inferImplicitFor(Global.scala:477)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$applyImplicitArgs$2(Typers.scala:263)
        at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:256)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$1(Typers.scala:901)
        at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:491)
        at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1239)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5790)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3373)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3373)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2030)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1843)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5646)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5726)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5790)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3373)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3373)
        at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5356)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5649)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5726)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:114)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:448)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:103)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1498)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1482)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1475)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1598)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:153)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:125)
        at xsbt.CompilerInterface.run(CompilerInterface.scala:39)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:248)
        at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:122)
        at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:95)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:91)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3$adapted(MixedAnalyzingCompiler.scala:77)
        at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:215)
        at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:77)
        at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:146)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:343)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:343)
        at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:120)
        at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:100)
        at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:180)
        at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:98)
        at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:102)
        at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:155)
        at sbt.internal.inc.Incremental$.compile(Incremental.scala:92)
        at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:75)
        at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:348)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:301)
        at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:168)
        at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:248)
        at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:74)
        at sbt_inc.SbtIncrementalCompiler.compile(SbtIncrementalCompiler.java:130)
        at scala_maven.ScalaCompilerSupport.incrementalCompile(ScalaCompilerSupport.java:299)
        at scala_maven.ScalaCompilerSupport.compile(ScalaCompilerSupport.java:101)
        at scala_maven.ScalaCompilerSupport.doExecute(ScalaCompilerSupport.java:83)
        at scala_maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:555)
        at scala_maven.ScalaTestCompileMojo.execute(ScalaTestCompileMojo.java:49)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: /packages cannot be represented as URI
        ... 159 more

The JDK version is:

C:\Users\lukas\workspace\playground\scala>java -version
openjdk version "13-ea" 2019-09-17
OpenJDK Runtime Environment (build 13-ea+27)
OpenJDK 64-Bit Server VM (build 13-ea+27, mixed mode, sharing)

The Windows version is:

C:\Users\lukas\workspace\playground\scala>ver

Microsoft Windows [Version 10.0.17134.829]

Here's a minimal, complete, verifiable example project to reproduce the crash:
https://github.com/lukaseder/scala-jdk13-compilation-issue

@lukaseder

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

Please note also @AlanBateman's comment on the jOOQ issue tracker here: jOOQ/jOOQ#8869 (comment)

And his reference to a relevant JDK issue:
https://bugs.openjdk.java.net/browse/JDK-8224946

@AlanBateman

This comment has been minimized.

Copy link

commented Jul 7, 2019

The scala compiler seems to be broken with JDK 13 EA and JDK 14 EA builds due to this issue so would be good to get this issue evaluated quickly. The change in JDK 13 is to fix the encoding (and decoding) of jrt file paths as URLs, which didn't work JDK 9 to JDK 12. I suspect scala.tools.nsc.classpath.JrtClassPath.asURLs really wants to return the URL "jrt:/" (to identify the run-time image), not "jrt:/packages" (invalid), but the bug wasn't caught previously.

@lrytz lrytz added this to the 2.12.9 milestone Jul 8, 2019

@SethTisue SethTisue added the blocker label Jul 8, 2019

@retronym retronym pinned this issue Jul 10, 2019

@lrytz lrytz closed this Jul 11, 2019

@SethTisue

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

now that scala/scala#8210 is merged, if you want to test the fix, you can use a 2.12.x nightly build, see https://stackoverflow.com/q/40622878/86485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.