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

0.13.6 throws null pointer with macro paradise #1655

Closed
MasseGuillaume opened this issue Oct 9, 2014 · 31 comments
Closed

0.13.6 throws null pointer with macro paradise #1655

MasseGuillaume opened this issue Oct 9, 2014 · 31 comments

Comments

@MasseGuillaume
Copy link
Member

clone this https://github.com/MasseGuillaume/sbt-example-paradise

git@github.com:MasseGuillaume/sbt-example-paradise.git

sbt "core/run"

@gkossakowski
Copy link
Contributor

Could you try 0.13.7-M3? What's the full stacktrace?

@MasseGuillaume
Copy link
Member Author

trace for 0.13.6 =>

last core/compile:compile
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set(/home/masgui/Projects/Kata/sbt-example-paradise/core/src/main/scala/Test.scala)
[debug]     modified: Set()
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(/home/masgui/Projects/Kata/sbt-example-paradise/core/src/main/scala/Test.scala)
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] All initially invalidated sources: Set(/home/masgui/Projects/Kata/sbt-example-paradise/core/src/main/scala/Test.scala)
[debug] Recompiling all 1 sources: invalidated sources (1) exceeded 50.0% of all sources
[info] Compiling 1 Scala source to /home/masgui/Projects/Kata/sbt-example-paradise/core/target/scala-2.11/classes...
[debug] Getting compiler-interface from component compiler for Scala 2.11.2
[debug] Getting compiler-interface from component compiler for Scala 2.11.2
[debug] Running cached compiler 1a08fea1, interfacing (CompilerInterface) with Scala compiler version 2.11.2
[debug] Calling Scala compiler with arguments  (CompilerInterface):
[debug]     -Xplugin:/home/masgui/.ivy2/cache/org.scalamacros/paradise_2.11.2/jars/paradise_2.11.2-2.0.1.jar
[debug]     -bootclasspath
[debug]     /opt/jdk1.8.0_20/jre/lib/resources.jar:/opt/jdk1.8.0_20/jre/lib/rt.jar:/opt/jdk1.8.0_20/jre/lib/sunrsasign.jar:/opt/jdk1.8.0_20/jre/lib/jsse.jar:/opt/jdk1.8.0_20/jre/lib/jce.jar:/opt/jdk1.8.0_20/jre/lib/charsets.jar:/opt/jdk1.8.0_20/jre/lib/jfr.jar:/opt/jdk1.8.0_20/jre/classes:/home/masgui/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar
[debug]     -classpath
[debug]     /home/masgui/Projects/Kata/sbt-example-paradise/core/target/scala-2.11/classes:/home/masgui/Projects/Kata/sbt-example-paradise/macros/target/scala-2.11/classes:/home/masgui/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar
java.lang.NullPointerException
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser$$anonfun$1.isDefinedAt(Dependency.scala:132)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser$$anonfun$1.isDefinedAt(Dependency.scala:131)
    at xsbt.Dependency$CollectTypeTraverser.traverse(Dependency.scala:89)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:134)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser.traverseTypeAscription(Trees.scala:2478)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1207)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1196)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1321)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:149)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:138)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1201)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1196)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1320)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:149)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at scala.reflect.internal.Trees$class.traverseComponents$1(Trees.scala:1277)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1323)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:149)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:146)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser$$anonfun$traverseStats$1$$anonfun$apply$1.apply$mcV$sp(Trees.scala:2498)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.api.Trees$Traverser.traverseStats(Trees.scala:2497)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1319)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:149)
    at xsbt.Dependency.xsbt$Dependency$$extractDependenciesByMemberRef(Dependency.scala:155)
    at xsbt.Dependency$DependencyPhase$$anonfun$run$2.apply(Dependency.scala:42)
    at xsbt.Dependency$DependencyPhase$$anonfun$run$2.apply(Dependency.scala:38)
    at scala.collection.Iterator$class.foreach(Iterator.scala:743)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1177)
    at xsbt.Dependency$DependencyPhase.run(Dependency.scala:38)
    at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1557)
    at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1542)
    at scala.tools.nsc.Global$Run.compileSources(Global.scala:1537)
    at scala.tools.nsc.Global$Run.compile(Global.scala:1644)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
    at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:162)
    at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:96)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:139)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:38)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:36)
    at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:39)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
    at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:66)
    at sbt.inc.Incremental$.compile(Incremental.scala:38)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:26)
    at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:153)
    at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
    at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45)
    at sbt.Compiler$.apply(Compiler.scala:74)
    at sbt.Compiler$.apply(Compiler.scala:65)
    at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:777)
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:769)
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:769)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (core/compile:compile) java.lang.NullPointerException

ibid for 0.13.7-M3

last core/compile:compile
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set(/home/masgui/Projects/Kata/sbt-example-paradise/core/src/main/scala/Test.scala)
[debug]     modified: Set()
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(/home/masgui/Projects/Kata/sbt-example-paradise/core/src/main/scala/Test.scala)
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] All initially invalidated sources: Set(/home/masgui/Projects/Kata/sbt-example-paradise/core/src/main/scala/Test.scala)
[debug] Recompiling all 1 sources: invalidated sources (1) exceeded 50.0% of all sources
[info] Compiling 1 Scala source to /home/masgui/Projects/Kata/sbt-example-paradise/core/target/scala-2.11/classes...
[debug] Getting compiler-interface from component compiler for Scala 2.11.2
[debug] Plain interface to Scala compiler 2.11.2  with arguments: 
[debug]     -nowarn
[debug]     -d
[debug]     /tmp/sbt_fcf70e57
[debug]     -bootclasspath
[debug]     /opt/jdk1.8.0_20/jre/lib/resources.jar:/opt/jdk1.8.0_20/jre/lib/rt.jar:/opt/jdk1.8.0_20/jre/lib/sunrsasign.jar:/opt/jdk1.8.0_20/jre/lib/jsse.jar:/opt/jdk1.8.0_20/jre/lib/jce.jar:/opt/jdk1.8.0_20/jre/lib/charsets.jar:/opt/jdk1.8.0_20/jre/lib/jfr.jar:/opt/jdk1.8.0_20/jre/classes:/home/masgui/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar
[debug]     -classpath
[debug]     /home/masgui/.sbt/boot/scala-2.10.4/org.scala-sbt/sbt/0.13.7-M3/xsbti/interface-0.13.7-M3.jar:/home/masgui/.sbt/boot/scala-2.10.4/org.scala-sbt/sbt/0.13.7-M3/compiler-interface-src/compiler-interface-src-0.13.7-M3.jar:/home/masgui/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.2.jar:/home/masgui/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar:/home/masgui/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar:/home/masgui/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.2.jar:/home/masgui/.ivy2/cache/jline/jline/jars/jline-2.12.jar
[debug]     /tmp/sbt_119f8964/xsbt/API.scala
[debug]     /tmp/sbt_119f8964/xsbt/Analyzer.scala
[debug]     /tmp/sbt_119f8964/xsbt/Command.scala
[debug]     /tmp/sbt_119f8964/xsbt/Compat.scala
[debug]     /tmp/sbt_119f8964/xsbt/CompilerInterface.scala
[debug]     /tmp/sbt_119f8964/xsbt/ConsoleInterface.scala
[debug]     /tmp/sbt_119f8964/xsbt/DelegatingReporter.scala
[debug]     /tmp/sbt_119f8964/xsbt/Dependency.scala
[debug]     /tmp/sbt_119f8964/xsbt/ExtractAPI.scala
[debug]     /tmp/sbt_119f8964/xsbt/ExtractUsedNames.scala
[debug]     /tmp/sbt_119f8964/xsbt/LocateClassFile.scala
[debug]     /tmp/sbt_119f8964/xsbt/Log.scala
[debug]     /tmp/sbt_119f8964/xsbt/Message.scala
[debug]     /tmp/sbt_119f8964/xsbt/ScaladocInterface.scala
[debug] Getting compiler-interface from component compiler for Scala 2.11.2
[debug] Running cached compiler 4496f177, interfacing (CompilerInterface) with Scala compiler version 2.11.2
[debug] Calling Scala compiler with arguments  (CompilerInterface):
[debug]     -Xplugin:/home/masgui/.ivy2/cache/org.scalamacros/paradise_2.11.2/jars/paradise_2.11.2-2.0.1.jar
[debug]     -bootclasspath
[debug]     /opt/jdk1.8.0_20/jre/lib/resources.jar:/opt/jdk1.8.0_20/jre/lib/rt.jar:/opt/jdk1.8.0_20/jre/lib/sunrsasign.jar:/opt/jdk1.8.0_20/jre/lib/jsse.jar:/opt/jdk1.8.0_20/jre/lib/jce.jar:/opt/jdk1.8.0_20/jre/lib/charsets.jar:/opt/jdk1.8.0_20/jre/lib/jfr.jar:/opt/jdk1.8.0_20/jre/classes:/home/masgui/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar
[debug]     -classpath
[debug]     /home/masgui/Projects/Kata/sbt-example-paradise/core/target/scala-2.11/classes:/home/masgui/Projects/Kata/sbt-example-paradise/macros/target/scala-2.11/classes:/home/masgui/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar
java.lang.NullPointerException
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser$$anonfun$1.isDefinedAt(Dependency.scala:142)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser$$anonfun$1.isDefinedAt(Dependency.scala:141)
    at xsbt.Dependency$CollectTypeTraverser.traverse(Dependency.scala:89)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:144)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser.traverseTypeAscription(Trees.scala:2478)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1207)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1196)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1321)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:153)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:148)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1201)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1196)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1320)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:153)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at scala.reflect.internal.Trees$class.traverseComponents$1(Trees.scala:1277)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1323)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:153)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:150)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:104)
    at scala.reflect.api.Trees$Traverser$$anonfun$traverseStats$1$$anonfun$apply$1.apply$mcV$sp(Trees.scala:2498)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.api.Trees$Traverser.traverseStats(Trees.scala:2497)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1319)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at xsbt.Dependency$ExtractDependenciesByMemberRefTraverser.traverse(Dependency.scala:153)
    at xsbt.Dependency.xsbt$Dependency$$extractDependenciesByMemberRef(Dependency.scala:159)
    at xsbt.Dependency$DependencyPhase$$anonfun$run$2.apply(Dependency.scala:42)
    at xsbt.Dependency$DependencyPhase$$anonfun$run$2.apply(Dependency.scala:38)
    at scala.collection.Iterator$class.foreach(Iterator.scala:743)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1177)
    at xsbt.Dependency$DependencyPhase.run(Dependency.scala:38)
    at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1557)
    at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1542)
    at scala.tools.nsc.Global$Run.compileSources(Global.scala:1537)
    at scala.tools.nsc.Global$Run.compile(Global.scala:1644)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
    at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:162)
    at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:96)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:139)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:38)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:36)
    at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:39)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
    at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:66)
    at sbt.inc.Incremental$.compile(Incremental.scala:38)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:26)
    at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:153)
    at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
    at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45)
    at sbt.Compiler$.apply(Compiler.scala:74)
    at sbt.Compiler$.apply(Compiler.scala:65)
    at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:777)
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:769)
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:769)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (core/compile:compile) java.lang.NullPointerException

@gkossakowski
Copy link
Contributor

@Duhemm, would you like to have a look?

@Duhemm
Copy link
Contributor

Duhemm commented Oct 9, 2014

I've discussed this issue with @xeno-by a few days ago and I think this is a bug in scalamacros/paradise.

I have a fix that simply ignores TypeTrees where tpe == null.

Shall I open a PR with it while the bug is not fixed in paradise ?

@gkossakowski
Copy link
Contributor

Hmmm, I'd prefer not clutter our code too much if not absolutely necessary. If this is a bug in the paradise, I'd prefer it being fixed there. @xeno-by, what's your take on this?

@gkossakowski
Copy link
Contributor

@Duhemm, also is there any work-around for people using paradise. E.g., manually setting tpe for TypeTrees?

@Duhemm
Copy link
Contributor

Duhemm commented Oct 9, 2014

That's why I didn't share this patch...

Not that I know of. I quickly showed Duhemm/macro-annotation (not sure about the name, I'm on my phone) to Eugene when I first encountered this bug and he couldn't tell me how to fix it either (my first guess was that the problem came from my macro).

@xeno-by
Copy link

xeno-by commented Oct 10, 2014

This ExtractDependenciesByMemberRefTraverser, what does it traverse? Where does it get the trees to look into?

I don't remember this off the top of my head, but it might very well be that after expanding macro annotations, macro paradise saves the expansion into MacroExpansionAttachment. Naturally, the attachment will be unattributed, so if someone looks into it, they might find empty TypeTrees there (signifying types that haven't been specified by the user that will need to be inferred).

@xeno-by
Copy link

xeno-by commented Oct 10, 2014

@MasseGuillaume Disable name hashing, and you should be fine - crashes only happen when name hashing is turned on.

@dragos
Copy link
Contributor

dragos commented Oct 15, 2014

Here's a debugging session of what's happening. Notice that all trees have null types at the time when dependency extraction gets to run. @xeno-by, is there some cleanup phase in macro paradise that should run before dependency extraction?

 Compiling 1 Scala source to /Users/dragos/workspace/git/plugin/sbt-example-paradise/core/target/scala-2.11/classes...
[info] [running phase parser on Test.scala]
[info] [running phase namer on Test.scala]
[info] [running phase packageobjects on Test.scala]
[info] [running phase typer on Test.scala]
[info] [running phase patmat on Test.scala]
[info] [running phase superaccessors on Test.scala]
[info] [running phase extmethods on Test.scala]
[info] [running phase pickler on Test.scala]
[info] [log xsbt-dependency] Crash while compiling <type ?>
[info] [log xsbt-dependency] Crash while compiling def <init>() = {
[info]   super{<null>}.<init>{<null>}();
[info]   (){<null>}
[info] }{<null>}
[info] [log xsbt-dependency] Crash while compiling App {
[info]   def <init>() = {
[info]     super{<null>}.<init>{<null>}();
[info]     (){<null>}
[info]   }{<null>};
[info]   println{<null>}(this{<null>}.hello{<null>}){<null>}
[info] }
[info] [log xsbt-dependency] Crash while compiling object Test extends App {
[info]   def <init>() = {
[info]     super{<null>}.<init>{<null>}();
[info]     (){<null>}
[info]   }{<null>};
[info]   println{<null>}(this{<null>}.hello{<null>}){<null>}
[info] }
[info] [log xsbt-dependency] Crash while compiling new hello{<null>}.<init>{<null>}(){<null>}.macroTransform{<null>}(object Test extends App {
[info]   def <init>() = {
[info]     super{<null>}.<init>{<null>}();
[info]     (){<null>}
[info]   }{<null>};
[info]   println{<null>}(this{<null>}.hello{<null>}){<null>}
[info] }){<null>}
[info] [log xsbt-dependency] Crash while compiling <module> object Test extends scala.this.AnyRef with scala.this.App {
[info]   <method> def <init>(): <empty>.this.Test.type = {
[info]     Test.super{Test.super.type}.<init>{()lang.this.Object}(){lang.this.Object};
[info]     (){scala.this.Unit}
[info]   }{scala.this.Unit};
[info]   <method> <triedcooking> def hello: String = "hello"{lang.this.String("hello")};
[info]   scala.this{scala.type}.Predef.println{(<param> x: scala.this.Any)scala.this.Unit}(this{Test.this.type}.hello{String}){scala.this.Unit}
[info] }
[info] [log xsbt-dependency] Crash while compiling package <empty>{<empty>.type} {
[info]   <module> object Test extends scala.this.AnyRef with scala.this.App {
[info]     <method> def <init>(): <empty>.this.Test.type = {
[info]       Test.super{Test.super.type}.<init>{()lang.this.Object}(){lang.this.Object};
[info]       (){scala.this.Unit}
[info]     }{scala.this.Unit};
[info]     <method> <triedcooking> def hello: String = "hello"{lang.this.String("hello")};
[info]     scala.this{scala.type}.Predef.println{(<param> x: scala.this.Any)scala.this.Unit}(this{Test.this.type}.hello{String}){scala.this.Unit}
[info]   }
[info] }
[trace] Stack trace suppress

@xeno-by
Copy link

xeno-by commented Oct 15, 2014

How does SBT get hold of new hello().macroTransform(...)?

@dragos
Copy link
Contributor

dragos commented Oct 15, 2014

Probably by handling MacroExpansion. @gkossakowski can explain better what he's after.

@Duhemm
Copy link
Contributor

Duhemm commented Oct 15, 2014

Macro paradise does not attach any MacroExpansionAttachment, so it won't get in this block.

@xeno-by we discussed the origin of this problem last week, do you think that my previous "analysis" of the problem was wrong ?

@xeno-by
Copy link

xeno-by commented Oct 15, 2014

It looks like I actually misled you. Paradise does attach this attachment, because expansion of macro annotations is retrofitted onto the infrastructure that expands def macros (hence the new annot().macroTransform(...) thingie in the code).

What I can do is not attaching anything when expanding annotations. That shouldn't be very hard to implement in paradise. Alternatively, we can keep the attachment, so that it's available for anyone who might want to analyze it and then in SBT you could insert a check: if a tpe of the attached tree is null, you disregard it and don't recur into its children. What would make more sense?

@dragos
Copy link
Contributor

dragos commented Oct 15, 2014

@Duhemm, the stack trace is pretty clear on that.

@xeno-by, my preference is to harden Sbt in the event that macros can break this assumption, and it would also fix #1593, which so far isn't directly linked to a macro. But @gkossakowski has the final say.

@vigoo
Copy link

vigoo commented Oct 24, 2014

Possible related issue: vigoo/scalafxml#13

@xeno-by
Copy link

xeno-by commented Oct 24, 2014

Allright guys, is there any news? What do we do about this?

@gkossakowski
Copy link
Contributor

@xeno-by, regarding your comment above. Do you attach untyped trees as an MacroExpansion attachment?

@xeno-by
Copy link

xeno-by commented Oct 25, 2014

@gkossakowski Yes. Arguments to macro annotations are untyped, so that's what's attached.

@Duhemm
Copy link
Contributor

Duhemm commented Nov 27, 2014

Hey guys,
Since this is not a bug in macro paradise, should we add this check in sbt ?

@dragos
Copy link
Contributor

dragos commented Nov 27, 2014

I think we agreed we should add a null check, but nobody did it so far (maybe the discussion was on #1593). I promise to review the PR if you open one :)

Duhemm pushed a commit to Duhemm/sbt that referenced this issue Nov 29, 2014
In some cases the dependency extraction may encounter a null `TypeTree`
(eg. arguments of macro annotations that are untyped). In such cases,
we simply ignore the node.

Fixes sbt#1593, sbt#1655.
Duhemm pushed a commit to Duhemm/sbt that referenced this issue Nov 29, 2014
In some cases the dependency extraction may encounter a null `TypeTree`
(eg. arguments of macro annotations that are untyped). In such cases,
we simply ignore the node.

Fixes sbt#1593, sbt#1655.
@ASchmidt84
Copy link

I have still the same issue on using 0.13.5 and @sfxml 😢

@dragos
Copy link
Contributor

dragos commented Dec 22, 2014

I don't think there's a release containing a fix for this one yet (this bug was reported on 0.13.6 anyway). @jsuereth or @gkossakowski do you know when will this fix be released?

@ASchmidt84
Copy link

Also the workaround:
https://github.com/milessabin/shapeless#building-shapeless isnt working. It is not important to solve the complete problem if their exist a working workaround 😱

Do someone use now sfxml and why this work at his code?

@gkossakowski
Copy link
Contributor

@IntelligyScience, if the workaround doesn't work then I think you are hitting some different problem.

@gkossakowski
Copy link
Contributor

According to milestones, 0.13.8 should be around the corner: https://github.com/sbt/sbt/milestones
I'll let @jsuereth have a final say on this.

indrajitr pushed a commit to indrajitr/xsbt that referenced this issue Jan 16, 2015
In some cases the dependency extraction may encounter a null `TypeTree`
(eg. arguments of macro annotations that are untyped). In such cases,
we simply ignore the node.

Fixes sbt#1593, sbt#1655.
@MasseGuillaume
Copy link
Member Author

@gkossakowski same error with 0.13.8-M2

@eed3si9n eed3si9n added this to the 0.13.8 milestone Feb 2, 2015
@eed3si9n
Copy link
Member

eed3si9n commented Feb 2, 2015

This is now fixed via #1754

@eed3si9n eed3si9n closed this as completed Feb 2, 2015
@MasseGuillaume
Copy link
Member Author

@eed3si9n cool can you release this under v0.13.8-M3 ?

@xeno-by
Copy link

xeno-by commented Feb 2, 2015

\o/

@eed3si9n
Copy link
Member

eed3si9n commented Feb 2, 2015

0.13.8-M3 should be out today.

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

No branches or pull requests

8 participants