sbt / sbt

sbt, the interactive build tool
https://scala-sbt.org
Apache License 2.0
4.79k stars 935 forks source link

1.4.0-RC1: sbt does not load, possibly binary incompatible jars on the classpath #5816

Closed mushtaq closed 4 years ago

mushtaq commented 4 years ago

steps

We have a small project with multiple modules, some cross-building to Scala.js, and few sbt plugins.

problem

  1. cs install sbt // same effect even with the latest launcher cs install sbt:1.4.0-RC1, or with any other launcher
  2. set sbt version to 1.4.0-RC1 in the build.properties
  3. try to load the sbt shell

Java is managed by coursier on my machine using eval "$(cs java --jvm 11 --env)"

The sbt shell fails to load with the following error, preventing further testing:

[error] java.lang.NoSuchMethodError: 'void sbt.internal.server.BuildServerReporter.<init>(sbt.internal.bsp.BuildTargetIdentifier, int, sbt.internal.util.ManagedLogger, scala.Function1, xsbti.FileConverter)'
[error]     at sbt.rewarn.RewarnBuildServerReporter.<init>(RewarnBuildServerReporter.scala:17)
[error]     at sbt.rewarn.RewarnBuildServerReporter$.$anonfun$reporter$1(RewarnBuildServerReporter.scala:28)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]     at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]     at sbt.Execute.work(Execute.scala:291)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:233)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:59)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.base/java.lang.Thread.run(Thread.java:834)
[error] (Compile / compile / compilerReporter) java.lang.NoSuchMethodError: 'void sbt.internal.server.BuildServerReporter.<init>(sbt.internal.bsp.BuildTargetIdentifier, int, sbt.internal.util.ManagedLogger, scala.Function1, xsbti.FileConverter)'
[warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)
eed3si9n commented 4 years ago

Thanks for the report. It looks like the error is coming from sbt-rewarn using our internal code? Could you try after removing the plugin?

mkurz commented 4 years ago

@eed3si9n Not related to this issue, but: No tag for 1.4.0-RC1? See https://github.com/sbt/sbt/tags

mushtaq commented 4 years ago

@eed3si9n You are right! That fixed it.

Opened a ticket in sbt-warn repo: https://github.com/rtimush/sbt-rewarn/issues/9