question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use scalapb-protoc with Dotty

See original GitHub issue

I’m trying to set up a project with Dotty.

Currently my project/protoc.sbt looks like this:

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

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.8.3"

I’m using libraries compiled to Scala 2.12 by using withDottyCompat in my build.sbt, as explained in the Dotty docs:

lazy val root = project
    .in(file("."))
    .settings(
        libraryDependencies ++= scalaDeps.map(_.withDottyCompat(scalaVersion.value))
                             ++ javaDeps
    )

Unfortunately, it appears that sbt-protoc is adding runtime dependencies using %%, which makes it pick up the Dotty version (currently 0.13):

[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency:
                 com.thesamet.scalapb#scalapb-runtime_0.13;0.8.3: not found

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thesametcommented, Sep 16, 2020

Sure thing. Note that current snapshot versions of ScalaPB support Dotty 0.27, so the workaround is not necessary in that case, see for example https://oss.sonatype.org/content/repositories/snapshots/com/thesamet/scalapb/scalapb-runtime_0.27/

0reactions
thesametcommented, Jan 21, 2021

I believe this issue can be closed. ScalaPB 0.11.x is tested and released with Scala 3. Usage is documented in https://scalapb.github.io/docs/dotty

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using with Dotty - ScalaPB
There is no need to use withDottyCompat to get the runtime dependencies correctly added. To use ScalaPB with dotty, ensure you use a...
Read more >
ScalaPB/community - Gitter
I have a question about tesing setup, is there a way to have a test proto definitions that will be available in tests,...
Read more >
Nadav Samet (@thesamet) / Twitter
Nadav Samet's Tweets ... Released ScalaPB 0.11.0-M3, which is the first version of ScalaPB that comes with full compatibility with Dotty for both...
Read more >
sbt-protoc - Scaladex
x of ScalaPB will strip out the -v part (a behavior that will be deprecated later), however it does not take version numbers...
Read more >
Access protobuf field name dynamically with scala
Although it's been a long from the question date, I don't think it is answerless. Actually, I have one: Using toPMessage method, you'll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found