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

Error when trying to run stryker4s: [error] java.lang.NoSuchMethodError: scala.meta.inputs.Position$Range.<init>(Lscala/meta/inputs/Input;II)V #302

Closed
amorfis opened this issue Nov 25, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@amorfis
Copy link

amorfis commented Nov 25, 2019

Summary

I added the Stryker4s plugin to my project, but when I run sbt stryker the error occurs:

[error] java.lang.NoSuchMethodError: scala.meta.inputs.Position$Range.<init>(Lscala/meta/inputs/Input;II)V
[error] 	at scala.meta.internal.trees.InternalTree.pos(InternalTrees.scala:59)
[error] 	at scala.meta.internal.trees.InternalTree.pos$(InternalTrees.scala:53)
[error] 	at scala.meta.Type$Name$TypeNameImpl.pos(Trees.scala:133)
[error] 	at scala.meta.internal.prettyprinters.TreeSyntax$.$anonfun$apply$1(TreeSyntax.scala:714)
[error] 	at scala.meta.prettyprinters.Syntax$$anon$1.apply(Syntax.scala:9)
[error] 	at scala.meta.internal.prettyprinters.TreeToString$.apply(TreeToString.scala:16)
[error] 	at scala.meta.Tree.toString(Trees.scala:20)
[error] 	at scala.meta.Tree.toString$(Trees.scala:20)
[error] 	at scala.meta.Type$Name$TypeNameImpl.toString(Trees.scala:133)
[error] 	at java.lang.String.valueOf(String.java:2994)
[error] 	at java.lang.StringBuilder.append(StringBuilder.java:131)
[error] 	at scala.meta.internal.parsers.ScalametaParser.$anonfun$classDef$1(ScalametaParser.scala:2917)
[error] 	at scala.meta.internal.parsers.ScalametaParser.atPos(ScalametaParser.scala:374)
[error] 	at scala.meta.internal.parsers.ScalametaParser.classDef(ScalametaParser.scala:2910)
[error] 	at scala.meta.internal.parsers.ScalametaParser.tmplDef(ScalametaParser.scala:2878)
[error] 	at scala.meta.internal.parsers.ScalametaParser.topLevelTmplDef(ScalametaParser.scala:2870)
[error] 	at scala.meta.internal.parsers.ScalametaParser$$anonfun$topStat$1.applyOrElse(ScalametaParser.scala:3253)
[error] 	at scala.meta.internal.parsers.ScalametaParser$$anonfun$topStat$1.applyOrElse(ScalametaParser.scala:3243)
[error] 	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:34)
[error] 	at scala.meta.internal.parsers.ScalametaParser.statSeq(ScalametaParser.scala:3234)
[error] 	at scala.meta.internal.parsers.ScalametaParser.topStatSeq(ScalametaParser.scala:3242)
[error] 	at scala.meta.internal.parsers.ScalametaParser.bracelessPackageStats$1(ScalametaParser.scala:3428)
[error] 	at scala.meta.internal.parsers.ScalametaParser.$anonfun$batchSource$9(ScalametaParser.scala:3434)
[error] 	at scala.meta.internal.parsers.ScalametaParser.atPos(ScalametaParser.scala:374)
[error] 	at scala.meta.internal.parsers.ScalametaParser.$anonfun$batchSource$1(ScalametaParser.scala:3434)
[error] 	at scala.meta.internal.parsers.ScalametaParser.atPos(ScalametaParser.scala:374)
[error] 	at scala.meta.internal.parsers.ScalametaParser.autoPos(ScalametaParser.scala:380)
[error] 	at scala.meta.internal.parsers.ScalametaParser.batchSource(ScalametaParser.scala:3406)
[error] 	at scala.meta.internal.parsers.ScalametaParser.$anonfun$source$1(ScalametaParser.scala:3389)
[error] 	at scala.meta.internal.parsers.ScalametaParser.atPos(ScalametaParser.scala:374)
[error] 	at scala.meta.internal.parsers.ScalametaParser.autoPos(ScalametaParser.scala:380)
[error] 	at scala.meta.internal.parsers.ScalametaParser.source(ScalametaParser.scala:3388)
[error] 	at scala.meta.internal.parsers.ScalametaParser.entrypointSource(ScalametaParser.scala:3394)
[error] 	at scala.meta.internal.parsers.ScalametaParser.$anonfun$parseSource$2(ScalametaParser.scala:128)
[error] 	at scala.meta.internal.parsers.ScalametaParser.parseRule(ScalametaParser.scala:38)
[error] 	at scala.meta.internal.parsers.ScalametaParser.parseSource(ScalametaParser.scala:128)
[error] 	at scala.meta.parsers.Parse$.$anonfun$parseSource$1(Parse.scala:29)
[error] 	at scala.meta.internal.parsers.ScalametaParser$$anon$189.apply(ScalametaParser.scala:3446)
[error] 	at scala.meta.parsers.Api$XtensionParseDialectInput.parse(Api.scala:21)
[error] 	at scala.meta.parsers.Api$XtensionParseInputLike.parse(Api.scala:10)
[error] 	at stryker4s.mutants.findmutants.MutantFinder.parseFile(MutantFinder.scala:26)
[error] 	at stryker4s.mutants.findmutants.MutantFinder.mutantsInFile(MutantFinder.scala:15)
[error] 	at stryker4s.mutants.Mutator.findMutants(Mutator.scala:32)
[error] 	at stryker4s.mutants.Mutator.$anonfun$mutate$1(Mutator.scala:17)
[error] 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
[error] 	at scala.collection.immutable.List.foreach(List.scala:388)
[error] 	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
[error] 	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
[error] 	at scala.collection.immutable.List.map(List.scala:294)
[error] 	at stryker4s.mutants.Mutator.mutate(Mutator.scala:16)
[error] 	at stryker4s.Stryker4s.run(Stryker4s.scala:19)
[error] 	at stryker4s.run.Stryker4sRunner.run(Stryker4sRunner.scala:31)
[error] 	at stryker4s.run.Stryker4sRunner.run$(Stryker4sRunner.scala:17)
[error] 	at stryker4s.sbt.Stryker4sSbtRunner.run(Stryker4sSbtRunner.scala:17)
[error] 	at stryker4s.sbt.Stryker4sMain$.$anonfun$strykerTask$1(Stryker4sMain.scala:37)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:748)

Is this some wrong scala-meta version? I don't know how to change it.

Stryker4s config

I didn't change the config file, using defaults.

Stryker4s environment

stryker4s 0.6.1

Your Environment

software version(s)
Scala version 2.12.9 (I tried 2.12.6 too)
Build tool & version sbt 1.2.8
Operating System MacOSx 10.14.6 (Mojave)
@hugo-vrijswijk
Copy link
Member

Thanks for creating this issue! Do you have any other plugins enabled? I feel like this could be related to dependency resolution conflicts in plugins. If not, would it be possible to provide a sample repository where this issue is demonstrated?

@hugo-vrijswijk hugo-vrijswijk added the bug Something isn't working label Nov 25, 2019
@amorfis
Copy link
Author

amorfis commented Nov 25, 2019

I have many plugins, the list below:

addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill"    % "1.3.16")
addSbtPlugin("com.geirsson"                      % "sbt-scalafmt"        % "1.5.1")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-native-packager" % "1.3.6")
addSbtPlugin("com.github.gseitz"                 % "sbt-release"         % "1.0.11")
addSbtPlugin("com.mintbeans"                     % "sbt-ecr"             % "0.14.1")
addSbtPlugin("org.scoverage"                     % "sbt-scoverage"       % "1.5.1")

addCompilerPlugin("io.tryp" % "splain" % "0.4.1" cross CrossVersion.patch)
addSbtPlugin("com.updateimpact" % "updateimpact-sbt-plugin" % "2.1.3")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.0")

I can't share my repository with you, sorry, it's client's code. Maybe later I'll create some. Thank you!

@hugo-vrijswijk
Copy link
Member

The first thing I notice is sbt-scalafmt which depends on scalameta v1.7.0. That could be the issue (note that since v2.0.0 scalafmt falls under a different groupId).

By the way, I noticed you work at softwaremill. I'm replacing the http client we currently use with sttp in #299 and it is awesome 😁

@amorfis
Copy link
Author

amorfis commented Nov 26, 2019

I had no idea scalafmt changed the group id! Thanks!

It's great you use sttp, thanks! I agree it's awesome :) It's a small world, isn't it :)

@amorfis
Copy link
Author

amorfis commented Nov 27, 2019

It works with new scalafmt

@amorfis amorfis closed this as completed Nov 27, 2019
@hugo-vrijswijk
Copy link
Member

Good to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants