apache / pekko-grpc

Apache Pekko gRPC
https://pekko.apache.org/
Apache License 2.0
39 stars 17 forks source link

No Scala 2.13 support for pekko-grpc-scalapb-protoc-plugin #325

Closed hippiefahrzeug closed 3 months ago

hippiefahrzeug commented 3 months ago

My apologies if I'm in the wrong place, but I'm trying to move our project's Akka-based gRPC integration to Pekko, and it's failing because of:

[error]   not found: /Users/alvi/.ivy2/local/org.apache.pekko/pekko-grpc-scalapb-protoc-plugin_2.13/1.0.2/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/pekko/pekko-grpc-scalapb-protoc-plugin_2.13/1.0.2/pekko-grpc-scalapb-protoc-plugin_2.13-1.0.2.pom
[error]   not found: https://maven.pkg.github.com/nezasa/_/org/apache/pekko/pekko-grpc-scalapb-protoc-plugin_2.13/1.0.2/pekko-grpc-scalapb-protoc-plugin_2.13-1.0.2.pom
[error]   not found: https://repository.apache.org/content/repositories/releases/org/apache/pekko/pekko-grpc-scalapb-protoc-plugin_2.13/1.0.2/pekko-grpc-scalapb-protoc-plugin_2.13-1.0.2.pom

Indeed, it looks like for all the other modules, we have a Scala 2.13 version, except for this one. Would it be possible to get this build up there somewhere? I wasn't able to find any repository so far.

Thank you very much!

Roiocam commented 3 months ago

Don't know why, we only release scala 2.12 for plugins.

https://github.com/apache/pekko-grpc/blob/61e10972b8adfb6f66ff94035204460233632c1e/project/Dependencies.scala#L25

Roiocam commented 3 months ago

Quick investigation found that pekko-grpc-sbt-plugin relies on upstream: https://mvnrepository.com/artifact/com.thesamet/sbt-protoc_2.12 _1.0

They will only release plug-ins for scala 2.12.

I am not sure that scalapb-protoc-plugin related with pekko-grpc-sbt-plugin or not.

hippiefahrzeug commented 3 months ago

thank you very much for your quick investigation! 🙏 I wasn't directly aware of that either, ich just when I kick off the build...

lazy val ngModel = (project in file("modules/grpc-model"))
  .configs(Common.Configs.all: _*)
  .enablePlugins(ScalafmtPlugin)
  .settings(Common.settings)
  .settings(
    libraryDependencies ++= Seq(
      "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
    ),
    libraryDependencies ++= Common.pekkoGrpcDependencies,
    libraryDependencies ++= Common.ngTestDependencies,
    PB.protocVersion := "3.17.3",
    Compile / PB.targets := Seq(
      scalapb.gen(
        lenses = false,
        flatPackage = true
      ) -> (Compile / sourceManaged).value
    )
  )

with:

  val pekkoGrpcVersion = "1.0.2"
  val pekkoGrpcDependencies = Seq(
    "org.apache.pekko" %% "pekko-grpc-runtime" % pekkoVersion,
    "org.apache.pekko" %% "pekko-grpc-runtime" % Common.pekkoVersion,
    "org.apache.pekko" %% "pekko-grpc-codegen" % Common.pekkoVersion,
    "org.apache.pekko" %% "pekko-grpc-scalapb-protoc-plugin" % Common.pekkoVersion,
  )

... I get the aforementioned error.

raboof commented 3 months ago

Is this an open source project? It's not super clear why you're adding pekko-grpc-scalapb-protoc-plugin as a dependency here: normally you'd use the Pekko gRPC sbt plugin, pekko-grpc-scalapb-protoc-plugin is more typically used with Maven or Gradle IIRC (though I might be misremembering).

I'm not sure how this comes into play in a migration scenario, as Akka also only publishes a 2.12 version of the corresponding artifact (https://repo1.maven.org/maven2/com/lightbend/akka/grpc/)

pjfanning commented 3 months ago
raboof commented 3 months ago
  • sbt plugins are typically only built with scala 2.12
  • if you use an sbt plugin, sbt will look for the scala 2.12 version of it
  • if you publish an sbt plugin with sbt, it will only publish a scala 2.12 version

these are all true statements, but pekko-grpc-scalapb-protoc-plugin is a protoc plugin, not an sbt plugin :)

hippiefahrzeug commented 3 months ago

Thanks a lot for all the answers!

@raboof, you raise a very good point regarding pekko-grpc-scalapb-protoc-plugin. I've removed this from my dependencies, and I'm not 100% sure myself how that sneaked in there. I've removed it now, and at least with regard to dependencies, it's working.