Support -Yexplicit-nulls compiler option
Problem
The generated code by the sbt plugin does not support compiling with the -Yexplicit-nulls compiler option
Expected behavior
Auto generated code does compile without errors when using -Yexplicit-nulls compiler option
Steps to reproduce
add this to your build.sbt, and try to compile:
ThisBuild / scalacOptions += "-Yexplicit-nulls"
even an empty .proto file causes the compilation to fail
example log when trying to compile with one empty proto file
[error] 20 | com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array(
[error] | ^
[error] | Found: com.google.protobuf.Descriptors#FileDescriptor | Null
[error] | Required: com.google.protobuf.Descriptors.FileDescriptor
[error] 21 | ))
[error] |
[error] | longer explanation available when compiling with `-explain`
[warn] 9 | lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
[warn] | ^
[warn] |`_` is deprecated for wildcard arguments of types: use `?` instead
[warn] |This construct can be rewritten automatically under -rewrite -source 3.4-migration.
That would require an adoption in upstream project
Pekko gRPC uses https://github.com/scalapb/ScalaPB under the hood to generate most of its source code. Maybe you could raise an issue there.
I'm closing this issue, as the upstream issue was marked as not planned.