-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
[0.11.x] Activate Scala 3 when using the Akka stack #498
Conversation
Seems we ran into a show stopper here when using the outdated akka-grpc 2.1.x dependencies:
The generated code does not explicitly define the type of the implicits, which is needed for Scala 3. This was fixed in pekko-grpc already but akka-grpc only fixed that in version 2.3.0 which already is licenced under the BSL. Conclusion: With the last Open Source version of akka-grpc, which is 2.1.x, it is impossible to provide Scala 3 artifacts for play-grpc. So I will put this on hold for now. We could in theory pull in the BSL licenced akka-grpc artifacts which already come with native Scala 3 support and everything should work, including the ALPN problem, just to make tests pass. We could mark them as |
Hi, I am interested in that. My company uses Akka in many projects and we have acquired the BSL last year and don't intend to migrate to Pekko in the near future*. In particular As I understand 0.12.x and beyond will use Pekko and 0.11.x will be the version/branch for Akka support. In this scenario your proposal of pulling in akka-grpc 2.3.x as If I can assist in any way, let me know 🙂 ~ Felix *I'm not necessarily against migrating to Pekko but these migrations tend to be a massive headache if you have a big existing codebase. |
0ef3dc8
to
505413c
Compare
505413c
to
573e16f
Compare
@felixbr Are you still interested in this PR? |
@mkurz I'm still interested, yes |
@felixbr I maybe take a look on this monday. |
@felixbr @muuki88 if you are still interested, I released 0.11.1-M1 which you can give a try. It provides Scala 3 artifacts, built with newer akka libraries that are BSL licensed. However, these dependencies marked as That means in libraryDependencies += "com.typesafe.play" %% "play-grpc-generators" % "0.11.1-M1"
libraryDependencies += "com.lightbend.akka.grpc" %% "akka-grpc-codegen" % "2.3.4" // or newer and in libraryDependencies += "com.typesafe.play" %% "play-grpc-runtime" % "0.11.1-M1"
libraryDependencies += "com.typesafe.akka" %% "akka-discovery" % "2.7.0" // or newer
libraryDependencies += "com.typesafe.akka" %% ... // see below and all other |
Thank you for that effort! I'll try and make time in the next two weeks to give our Scala 3 migration another push with those artifacts and report back. If the migration works out well, we might tackle Pekko next. We do have a license for Akka but if using it puts unnecessary strain on open-source maintainers like you in the long run, we should do our part to alleviate that. |
I'm trying out 0.11.1-M1 for play-grpc with Scala 3 and it seems to resolve but I cannot really test it as there are other issues with Play still:
After some digging it seems that some Play 2.9 modules for Scala 3 still depend on Scala 2.13 modules even though there's Scala 3 versions available. For example After excluding those 2.13 dependencies manually it compiled but when trying to start the server akka complains that many modules are version 2.6.21 even though I've explicitly added all akka-dependencies as 2.8.5. The eviction probably doesn't work because those 2.6.21 dependencies are also 2.13 instead of 3 for some reason. My guess is one of the Play or Akka plugins adds those 2.6.21 dependencies with Scala 2.13 hardcoded. I'm not going to investigate further at this point. It is clear that Akka and Play will no longer work together in the future and adding Scala 3 makes it even worse. The only way forward is to move everything to Pekko and Play 3.x but at that point I'd rather just rewrite our services using typelevel libraries. In any case, thank you for your time and effort 🙂 |
@felixbr Did you set See |
|
@felixbr Great! I will release stable |
The updated version with Scala 3 has been live in production for more than 2 hours and everything looks stable. I think releasing and documenting As I said before, I don't really want us to be an additional burden on open-source maintainers, so migrating to Pekko (or typelevel) is not out of the picture in the mid- to long-term. Still, this release buys us a bit more time and made a Scala 3 migration possible which is great! Thanks again 🙂 |
@felixbr Just to let you know I did release 0.11.1 last week, see release notes: https://github.com/playframework/play-grpc/releases/tag/0.11.1 |
A bit more tricky than on
main
branch because following dependencies do not provide Scala 3 artifacts: