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

sbt-native-packager using 2.x of scala-xml which is incompatible with scala 2.12 and sbt #1517

Closed
griffhun opened this issue Aug 26, 2022 · 3 comments
Labels
project General project issues windows

Comments

@griffhun
Copy link

Expected behaviour

sbt-native-packager should work with scala 2.12 because it is a scala plugin.

        // 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 https://github.com/scala/scala/pull/9743
        "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2", // Do not upgrade beyond 1.x
        "org.scala-lang.modules" %% "scala-xml" % "2.1.0" <-- this should be below 2.x

Actual behaviour

case _ =>
Seq(
// 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 https://github.com/scala/scala/pull/9743
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2", // Do not upgrade beyond 1.x
"org.scala-lang.modules" %% "scala-xml" % "2.1.0"
)
}
}

After updating our project to sbt.native.packager 1.9.10 or 1.9.11 from 1.9.9:

[error] 	* org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over 1.2.0
[error] 	    +- com.github.sbt:sbt-native-packager:1.9.11 (sbtVersion=1.0, scalaVersion=2.12) (depends on 2.1.0)
[error] 	    +- com.typesafe.play:twirl-api_2.12:1.5.1             (depends on 1.2.0)

If I try update scala-xml dependency for twirl project:

[error] 	* org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over 1.0.6
[error] 	    +- com.typesafe.play:twirl-api_2.12:1.6.0-M6+37-1c63ce71+20220826-1058-SNAPSHOT (depends on 2.1.0)
[error] 	    +- org.scala-lang:scala-compiler:2.12.16              (depends on 1.0.6)

Which suggests me it's not working with scala 2.12.

Information

  • What sbt-native-packager are you using 1.9.9 <- works well, updating to 1.9.10 or 1.9.11 complains
  • What sbt version 1.7.1
  • What is your build system MacOS and Ubuntu
  • What package are you building docker
  • What version has your build tool: Docker version 20.10.17
  • What is your target system Ubuntu 22.04
@guizmaii
Copy link
Contributor

guizmaii commented Aug 26, 2022

The issue is more with scala-compiler than sbt-native-packager I think.
The issue will be fixed with the next version of Scala 2.12: scala/bug#12632

@Christewart
Copy link

@mkurz
Copy link
Member

mkurz commented Sep 26, 2022

Scala 2.12.17 is out and has scala-xml upgraded: scala/scala#10108
The next sbt release will upgrade to Scala 2.12.17 as well: sbt/sbt#7021

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

No branches or pull requests

5 participants