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

Version conflicts for scala-parser-combinators #1461

Closed
alexandru opened this issue Sep 30, 2021 · 7 comments
Closed

Version conflicts for scala-parser-combinators #1461

alexandru opened this issue Sep 30, 2021 · 7 comments

Comments

@alexandru
Copy link

Hello,

I'm getting this issue in sbt:

[error] java.lang.RuntimeException: found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error]
[error] 	* org.scala-lang.modules:scala-parser-combinators_2.12:2.0.0 (early-semver) is selected over {1.0.5, 1.1.2, 1.1.2, 1.1.1
[error] 	    +- com.github.sbt:sbt-native-packager:1.9.4 (sbtVersion=1.0, scalaVersion=2.12) (depends on 2.0.0)
[error] 	    +- org.scalaxb:scalaxb_2.12:1.8.2                     (depends on 1.1.1)
[error] 	    +- org.scala-sbt:zinc-compile-core_2.12:1.5.7         (depends on 1.1.2)
[error] 	    +- com.typesafe:ssl-config-core_2.12:0.4.0            (depends on 1.1.2)
[error] 	    +- com.jsuereth:pgp-library_2.12:2.0.1                (depends on 1.0.5)
[error]

Here's my entire plugins.sbt file:

addSbtPlugin("com.dwijnand"              % "sbt-dynver"          % "4.1.1")
addSbtPlugin("com.eed3si9n"              % "sbt-assembly"        % "1.1.0")
addSbtPlugin("com.eed3si9n"              % "sbt-buildinfo"       % "0.10.0")
addSbtPlugin("com.lightbend.sbt"         % "sbt-javaagent"       % "0.1.6")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"         % "0.6.0")
addSbtPlugin("com.typesafe.sbt"          % "sbt-multi-jvm"       % "0.4.0")
addSbtPlugin("com.github.sbt"            % "sbt-native-packager" % "1.9.4")
addSbtPlugin("com.typesafe.sbt"          % "sbt-twirl"           % "1.5.1")
addSbtPlugin("io.get-coursier"           % "sbt-coursier"        % "1.0.3")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"        % "0.1.20")
addSbtPlugin("io.kamon"                  % "sbt-kanela-runner"   % "2.0.10")
addSbtPlugin("io.spray"                  % "sbt-revolver"        % "0.9.1")
addSbtPlugin("org.scalameta"             % "sbt-scalafmt"        % "2.4.3")
addSbtPlugin("org.scalaxb"               % "sbt-scalaxb"         % "1.8.2")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"       % "1.9.0")
addSbtPlugin("org.wartremover"           % "sbt-wartremover"     % "2.4.16")

// Fixes IntelliJ bug — https://youtrack.jetbrains.com/issue/SCL-16345
// https://github.com/tpunder/fm-sbt-s3-resolver
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.19.0")

addDependencyTreePlugin

With such dependencies, I think shading is a good solution.

@muuki88
Copy link
Contributor

muuki88 commented Oct 1, 2021

Thanks for the comprehensive report 🤗

Indeed shading should be the way to go. I'm really surprised how many plugins rely on this lib 😅

You wouldn't have time by chance to provide a pull request 😁😘

@mr-git
Copy link
Contributor

mr-git commented Oct 1, 2021

got similar issue:

[error] 	* org.scala-lang.modules:scala-parser-combinators_2.12:2.0.0 (early-semver) is selected over 1.0.5
[error] 	    +- com.github.sbt:sbt-native-packager:1.9.4 (scalaVersion=2.12, sbtVersion=1.0) (depends on 2.0.0)
[error] 	    +- org.foundweekends:knockoff_2.12:0.8.6              (depends on 1.0.5)

in my case caused by sbt-site, sbt/sbt-site#172

@oleastre
Copy link

oleastre commented Oct 1, 2021

Problem is solved in master it seems since #1455
But there have been no release since then.

@muuki88
Copy link
Contributor

muuki88 commented Oct 7, 2021

Sorry, I missed out on releasing this. v1.9.5 is on its way

@muuki88
Copy link
Contributor

muuki88 commented Oct 7, 2021

After re-reading the history of this, I'm not sure if shading is necessary.

@mkurz wrote a very comprehensive comment

Do NOT upgrade these dependencies to 2.x or newer! sbt-native-packager is a sbt-plugin
and gets published with Scala 2.12, therefore we need to stay at the same major version
like the 2.12.x Scala compiler, otherwise we run into conflicts when using sbt 1.5+
See scala/scala#9743

which I interpret as "there's no way until, let's say sbt 2.x along with scala3, this dependency can ever be upgraded to the 2.x line". If this is correct, then shading would add no benefit, right?

@oleastre
Copy link

oleastre commented Oct 7, 2021

Shading could help by avoiding the resolution conflict, but is there a benefit updating that dependency ?

@mkurz
Copy link
Member

mkurz commented Dec 30, 2021

@muuki88 This issue can be closed, since it is fixed with vv1.9.5+.

@muuki88 muuki88 closed this as completed Dec 30, 2021
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

5 participants