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

[1.5.x] Scala 2.12.17 + Scala 2.13.10 + scala-xml 2.1.0 #548

Merged
merged 8 commits into from
Dec 23, 2022

Conversation

mkurz
Copy link
Member

@mkurz mkurz commented Sep 22, 2022

This is probably needed if we want to upgrade the current Play 2.8.x branch with Scala 2.12.17

@guizmaii
Copy link

guizmaii commented Oct 14, 2022

We need this change in Caliban. See ghostdogpr/caliban#1472

error] stack trace is suppressed; run last play / update for the full output
[error] (play / update) found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error]
[error] 	* org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over 1.2.0
[error] 	    +- org.scala-lang:scala-compiler:2.12.17              (depends on 2.1.0)
[error] 	    +- com.typesafe.play:twirl-api_2.12:1.5.1             (depends on 1.2.0)
[error]
[error]
[error] this can be overridden using libraryDependencySchemes or evictionErrorLevel

Why is your PR a draft @mkurz?

@mkurz
Copy link
Member Author

mkurz commented Oct 14, 2022

Because as long as there is no sbt 1.8 this pull request alone doesn't help. If I would merge that and release with a Play 2.8.x minor version lots of apps will break currently... If we have sbt 1.8 we could at least tell people to upgrade sbt in our release notes.
I saw you just opened sbt/sbt#7050 (comment) let's see if it makes it into sbt 1.7.x but I doubt it.

@mkurz
Copy link
Member Author

mkurz commented Oct 14, 2022

@guizmaii You can work around the error meanwhile, see here. scala-xml 1 and 2 are compatible AFAIK, so that should not make a difference. I recommend to also put that in your build.sbt not just project/plugins.sbt.

@guizmaii
Copy link

@mkurz Thanks! 🙂

@ckipp01
Copy link

ckipp01 commented Nov 11, 2022

Just a heads up, now that sbt 1.8.0 is released. Is the plan to get this merged in and released?

@ennru
Copy link
Contributor

ennru commented Dec 16, 2022

A dependencyUpdates on plugins with this PR currently says

[info]   com.dwijnand:sbt-dynver               : 4.0.0              -> 4.1.1
[info]   com.typesafe.play:interplay           : 2.1.6   -> 2.1.10             -> 3.0.7
[info]   com.typesafe:sbt-mima-plugin          : 0.6.4              -> 0.9.2   -> 1.1.1
[info]   de.heikoseeberger:sbt-header          : 5.3.0   -> 5.3.1   -> 5.9.0
[info]   org.scala-js:sbt-scalajs              : 1.11.0             -> 1.12.0
[info]   org.scala-lang:scala-library:provided : 2.12.12 -> 2.12.17 -> 2.13.10
[info]   org.scalameta:sbt-scalafmt            : 2.2.1              -> 2.5.0

@ennru
Copy link
Contributor

ennru commented Dec 19, 2022

This PR started before Travis was replaced with GH workflows. Needs a rebase.

@mkurz
Copy link
Member Author

mkurz commented Dec 19, 2022

@ennru This pr is against the 1.5.x branch, on which we never set up Github actions (yet): https://github.com/playframework/twirl/tree/1.5.x/.github/workflows (Probably we thought we would not release new 1.5.x versions or postponed GHA until its necessary for that branch).
From the main branch we already cut some milestone releases: https://github.com/playframework/twirl/releases/tag/1.6.0-M7 - maybe that helps for you use case as well? On the main branch we already have support for Scala 3, but also dropped Java 8. Is that what you are looking for?

@ennru
Copy link
Contributor

ennru commented Dec 19, 2022

Thanks, @mkurz. I thought I had seen milestones, but than there was this PR... I believe we're good.

@mkurz
Copy link
Member Author

mkurz commented Dec 19, 2022

@ennru I just tagged 1.6.0-RC1 which should be available on maven central soon.
I think we can move on to releasing 1.6.0 soon if no one comes up with more issues (afaik people already use and tested the milestone releases, so we should be safe)
Please also let me know if that RC works for you, thanks!

@mkurz
Copy link
Member Author

mkurz commented Dec 19, 2022

@ennru Ah and also be aware that the groupId changed from com.typesafe.sbt to com.typesafe.play

@mkurz
Copy link
Member Author

mkurz commented Dec 19, 2022

The 1.5.x branch is quite outdated and still supports sbt 0.13.x so I had to apply some workarounds so we are able to pull in scala-xml 2.1.x (which causes problems with scala-js...), but I am almost there... Will push and merge later

@mkurz
Copy link
Member Author

mkurz commented Dec 20, 2022

Pulling in scala-xml 2.x requires scala-js 1.x, but that isn't available for sbt 0.x anymore, so I had to find a workaround. I pushed all the changes that I think are necessary and good to go, published a snapshot and try to make use of it in playframework/playframework#11590, let's see
EDIT: Oh and we need to change the groupId to com.typesafe.play because we don't have access to the xxx.sbt one.

@mkurz mkurz changed the title [1.5.x] Scala 2.12.17 + Scala 2.13.9 + scala-xml 2.1.0 [1.5.x] Scala 2.12.17 + Scala 2.13.10 + scala-xml 2.1.0 Dec 20, 2022
@mkurz
Copy link
Member Author

mkurz commented Dec 23, 2022

So I can't really test this in playframework/playframework#11590 right now because we are stuck there for other reasons (see its comments).
Anyway, I tested this pull request locally by running all the tests + scripted tests with the scripts I updated in the scripts/ folder (ran them with Java 8 + Java 11). So I think we are pretty good to go.
The only real change, besides upgrading to scala-xml 2.x is that the twirl-api now depends on scala.js 0.6 for Scala 2.10 (like before) but the Scala 2.12 and 2.13 artifacts now depend on scala.js 1.12.0... I hope this will not break anything, but IMHO this is the only way... The tests at least pass.

So the dependency tree looked like this before:

...
[info] com.typesafe.play:twirl-api_sjs0.6_2.10:1.5.x [S]
[info]   +-org.scala-js:scalajs-library_2.10:0.6.33 [S]
...

Now it looks like this

[info] com.typesafe.play:twirl-api_sjs1_2.12:1.5.x [S]
[info]   +-org.scala-js:scalajs-library_2.12:1.12.0 [S]
[info]   | +-org.scala-js:scalajs-javalib:1.12.0
[info]   | 
[info]   +-org.scala-lang.modules:scala-xml_sjs1_2.12:2.1.0 [S]
[info]     +-org.scala-js:scalajs-library_2.12:1.12.0 [S]
[info]     | +-org.scala-js:scalajs-javalib:1.12.0
[info]     | 
[info]     +-org.scala-js:scalajs-library_2.12:1.9.0 (evicted by: 1.12.0)

Given I tested this thoroughly I will merge and release 1.5.2 since it was requested by some users 😉
Function wise nothing changed from 1.5.1, so you can still stay on 1.5.1.

@mkurz mkurz marked this pull request as ready for review December 23, 2022 16:18
@mkurz
Copy link
Member Author

mkurz commented Dec 23, 2022

Oh and btw: I don't wanted to spend to much time with the 1.5.x branch anymore, so I didn't even bother to setup GitHub actions anymore, that's why I ran tests + will do the releases on my machine. In case we have to cut more 1.5.x releases I will take time to set up the GHA...

@mkurz mkurz merged commit 583a3c5 into playframework:1.5.x Dec 23, 2022
@mkurz mkurz deleted the scala_upgrades1.5.x branch December 23, 2022 16:19
@mkurz
Copy link
Member Author

mkurz commented Dec 27, 2022

twirl 1.5.2, with dependency to scala-xml 2.x is now released: https://github.com/playframework/twirl/releases/tag/1.5.2
Be aware the groupId changed, scala-steward is aware of that already and should visit your repo soon: https://github.com/scala-steward-org/scala-steward/blob/0b4779236bc17ad0465fe958af219093881bcab8/modules/core/src/main/resources/artifact-migrations.v2.conf#L128-L132

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

Successfully merging this pull request may close these issues.

4 participants