0

My requirment is use Protocol Buffer on the Scala Play! REST API project and I'm having a hard time adding it. I followed the instructions in the documentation but it keeps failing. This is how it looks like: my build.sbt

scalaVersion := "2.13.10"

dependencyOverrides += "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.0"

libraryDependencies ++= Seq(
  guice,
  "org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test,
  "mysql" % "mysql-connector-java" % "8.0.26",
  "io.getquill" %% "quill-jasync-mysql" % "4.6.0",
  "com.thesamet.scalapb" %% "scalapb-runtime" % "0.11.11"
)

and project/scalapb.sbt

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.3")

And trying to compile the project I get this output:

[error] stack trace is suppressed; run last protocExecutable for the full output
[error] (protocExecutable) lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.15.6/protoc-3.15.6-osx-aarch_64.exe: not found: https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.15.6/protoc-3.15.6-osx-aarch_64.exe
[error] Total time: 0 s, completed 4 Apr 2023, 14:26:17

Please advice on how to solve this. Thank you

I've tried to clean, update and reload. I've restarted the whole project and it doesn't seem to be working. What am I doing wrong?

  • 1
    Just a hint, not an answer: the generated URL is wrong. The correct is: `https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.15.6/protoc-3.15.6-osx-x86_64.exe`. Probably it is a missconfiguration or a bug in the plugin. – zforgo Apr 04 '23 at 13:15
  • can you advise on how it's wrong? I'm following the documentation from here: https://scalapb.github.io/docs/installation – KKarpac Apr 04 '23 at 14:11

1 Answers1

4

Based on the URL in the error message, I assume you are using Apple Silicon M1 or M2 platform aarch 64 architecture.

But that architecture haven't been supported in official protoc version 3.15.6.

The first supported version is: 3.17.3 which released in July 2021.

Option 1.

Upgrage sbt-protoc to 1.0.6 or above.

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")

Option 2.

Install Rosetta to be able run x86_64 binaries on aarch64 architecture.

zforgo
  • 2,508
  • 2
  • 14
  • 22