slick-pg icon indicating copy to clipboard operation
slick-pg copied to clipboard

Recent update has left an impossible upgrade conflict with akka

Open jdrphillips opened this issue 2 years ago • 6 comments

This is not necessarily slick-pgs responsibility to address, I am detailing it here as it was slick-pg's update that revealed the problem.

If you have the following installed dependencies:

slick-pg: 0.20.4 (previous)
akka-stream: 2.6.19 (latest)
slick: 3.3.3 (previous)

And you upgrade slick-pg to 0.21.0 (latest) you get the following incompatibility:

[error] 	* org.scala-lang.modules:scala-parser-combinators_2.13:2.1.1 (early-semver) is selected over 1.1.2
[error] 	    +- com.github.tminglei:slick-pg_jts_2.13:0.21.0       (depends on 2.1.1)
[error] 	    +- com.github.tminglei:slick-pg_core_2.13:0.21.0      (depends on 2.1.1)
[error] 	    +- com.github.tminglei:slick-pg_2.13:0.21.0           (depends on 2.1.1)
[error] 	    +- com.typesafe:ssl-config-core_2.13:0.4.3            (depends on 1.1.2)

This is because akka-stream keeps you at an old ssl-config-core version until you have upgraded to scala 3. This then includes an old version of scala-parser-combinators, causing the conflict.

The inability to update slick-pg also prevents you updating to slick 3.4.0 (latest):

[error] 	* com.typesafe.slick:slick_2.13:3.4.0 (pvp) is selected over {3.3.3}
[error] 	    +- com.lovejunk:persist:5161e92                       (depends on 3.4.0)
[error] 	    +- com.github.tminglei:slick-pg_jts_2.13:0.20.4       (depends on 3.3.3)
[error] 	    +- com.github.tminglei:slick-pg_core_2.13:0.20.4      (depends on 3.3.3)
[error] 	    +- com.github.tminglei:slick-pg_2.13:0.20.4           (depends on 3.3.3)
[error] 

This means for example that when work begins on slick for scala 3, users of akka-stream and slick-pg will be unable to upgrade in good time to a cross compatible version, making the ultimate migration to scala 3 much more difficult than it needs to be.

As it stands, dropping use of this library is our easiest and safest path forward, which I really do not want to do

jdrphillips avatar Sep 05 '22 13:09 jdrphillips

I'm facing the issue regarding scala-parser-combinators version conflict as well. fwiw, I found this open issue on Akka project: https://github.com/akka/akka/issues/31485.

fcv avatar Sep 06 '22 07:09 fcv

Yep looks like they (akka) aren't going to fix the issue on their end.

jdrphillips avatar Sep 06 '22 07:09 jdrphillips

I have created this issue https://github.com/lightbend/ssl-config/issues/353 in the hope that akka would consider upgrading to ssl-config 0.4.4 with an upgraded scala-parser-combinators dependency.

We will see

jdrphillips avatar Sep 06 '22 09:09 jdrphillips

I would recommend downgrading to scala-parser-combinators to 1.1.2. I can't upgrade because akka/twitter are still on the old version.

If we take a look at the releases notes for 2.x https://github.com/scala/scala-parser-combinators/releases/tag/v2.0.0 https://github.com/scala/scala-parser-combinators/releases/tag/v2.1.0 https://github.com/scala/scala-parser-combinators/releases/tag/v2.1.1

there is nothing relevant worth pulling the update version

This is probably why twitter is sticking with the older version https://github.com/twitter/util/blob/53a1981dde3014241075b34162ecd8a20c24da71/build.sbt#L402-L411

MasseGuillaume avatar Sep 11 '22 20:09 MasseGuillaume

Support downgrading to 1.1.2 as well.

Tvaroh avatar Sep 26 '22 09:09 Tvaroh

Created a PR #587

Tvaroh avatar Sep 26 '22 09:09 Tvaroh

Any updates on this? I just stumbled upon this as well, running scala 2.13.10

[error]   * org.scala-lang.modules:scala-parser-combinators_2.13:2.1.1 (early-semver) is selected over 1.1.2
[error]       +- com.github.tminglei:slick-pg_core_2.13:0.21.0      (depends on 2.1.1)
[error]       +- com.github.tminglei:slick-pg_2.13:0.21.0           (depends on 2.1.1)
[error]       +- com.typesafe:ssl-config-core_2.13:0.4.3            (depends on 1.1.2)

domdorn avatar Dec 02 '22 11:12 domdorn

I guess the only option is forking and publishing it under another organization.

Tvaroh avatar Dec 02 '22 12:12 Tvaroh

@tminglei what is stopping you from merging PR #587 ? A fork is not in the interest of anybody.. imho the code in build.sbt should be like

def mainDependencies(scalaVersion: String) = {
  val extractedLibs = CrossVersion.partialVersion(scalaVersion) match {
    case Some((3, _))  =>
      Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1")
    case Some((2, scalaMajor)) if scalaMajor >= 11 =>
      Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2")
    case _ =>
      Seq()
  }

domdorn avatar Dec 02 '22 22:12 domdorn

@domdorn well, I was just waiting for the build failure to be resolved by someone else.

Now I'll stop waiting, and move it forward.

tminglei avatar Dec 04 '22 15:12 tminglei

thanks a lot!

domdorn avatar Dec 04 '22 22:12 domdorn

Thank you! When we can expect new release?

mikla avatar Dec 06 '22 20:12 mikla

@mikla released to v0.21.1

tminglei avatar Dec 08 '22 23:12 tminglei