[2.12] Upgrade scala-xml to latest 2.0.1#9743
Conversation
|
@SethTisue here you write:
|
|
It's a judgment call, but I think it's better not to rock the 2.12 boat. At some point the value of consistency and stability exceeds the value of bringing something like this up to date. |
|
@SethTisue I understand. However, IMHO upgrading to 2.0.1 in Scala 2.12 would make sense: val ScalaXmlVersion = "2.0.1"
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.AlwaysThe setting Now, on my machine, locally, I just published twirl (and play-ws, interplay) from its current master branch and tried to use that local snapshot(s) in Play's master branch. What happens now is, in Play, I can not even get into the sbt console: To resolve that problem, I have to put into That's why I thought it might be a good idea to just upgrade scala-xml to latest 2.0.1 in the scala compiler, because I guess quite a lot of libraries will run into problems when they upgrade their scala-xml version to 2.0.1... So that's why I think it might be a good idea to upgrade scala-xml in 2.12, to make transition to Scala 3 easier. However maybe I am missing something here. |
| case e: Elem => { | ||
| val child = e.child.map(stripGroup _) | ||
| Elem(e.prefix, e.label, e.attributes, e.scope, child : _*) | ||
| Elem(e.prefix, e.label, e.attributes, e.scope, true, child : _*) |
There was a problem hiding this comment.
An apply method was removed here: scala/scala-xml@e73ebfd#diff-077695e8c628bc073ac8cf0a66e09dc84a283366ea94dfe11d2c4b8efef66a13L31 (which passed child.isEmpty)
|
Green 👍 |
|
that does seem convincing. @lrytz wdyt? |
|
@SethTisue @lrytz Please also see #9744. |
|
@eed3si9n any opinion on this (and the other one)? do we need to be thinking about sbt's own dependencies at all, here? any concerns about the possible effect on the sbt plugin ecosystem? |
|
@SethTisue @eed3si9n Let's say we merge my two PRs here, what I would do is to upgrade sbt's Scala version to 2.12.15 afterwards (like I did here with 2.12.14: sbt/sbt#6522). When doing that, we also have to bump sbt's If sbt is on Scala 2.12.15, we could then cut sbt 1.5.6. |
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.3.0"
val scalaParsers = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2" |
I'd be against breaking (transitive) binary compatibility in a patch release. I'd be open to do that in sbt 1.6.0, but still we'd be taking some risk of compiler plugins and/or sbt plugins breaking if they used any of the dropped features of scala-xml. If we want to make it easier to cross build, why not back publish scala-xml 1.x series to Scala 3? |
|
Actually this is not really about Scala 3 (maybe I should not have mentioned that above, it's just that we are currently working on that). This is more about sbt (1.5.x) version conflict handling. The problem occurs because the scala-compiler depends on scala-xml 1.x but if an sbt-plugin bumps its libraryDependency scala-xml version to 2.x, then you will see that error I posted above. That happens with Scala 2.12 (because plugins are published with Scala 2.12), so Scala 3 does not need to be involved. |
|
scala-xml 1.x and 2.0.1 are incompatible according to Semantic Versioning. Maybe the actual changes that were dropped are seldom used and, in effect we can keep using it as if it is scala-xml 1.x. sbt's eviction error doesn't read between those nuanced lines, it would just look at the version numbers and try to enforce Semantic Versioning based on the opt-in intent expressed in the POM file of scala-xml. <properties>
<info.versionScheme>early-semver</info.versionScheme>
</properties>
Given that scala-compiler depends on scala-xml, and sbt depends on scala-compiler for |
|
@SethTisue Thinking more about this problem here, I think we might made a mistake upgrading to scala-xml 2.x and scala-parser-combinators 2.x in sbt-plugins like twirl. Upgrading them to 2.x is not necessary for Scala 3 support, since sbt-plugins are build with Scala 2.12. We should just upgrade to scala-xml 2.x and scala-parser-combinators 2.x when they are actually used as libraries, because we want to cross build against Scala 3 at some point and only the 2.x versions of these libs are published for Scala 3 already. I think what we need to do to avoid any conflicts is to downgrade to scala-xml 1.x and scala-parser-combinators 1.x if the project is a sbt-plugin. |
|
Closing. IMHO the solution is to not use 2.x versions in sbt-plugins (because they get published for Scala 2.12 anyway) |
|
We're freshly considering this now over at scala/bug#12632. |
@SethTisue WDYT? Maybe for the 2.12.15 release?