Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 06 18:21
    scala-steward opened #1275
  • Dec 06 18:20
    scala-steward opened #153
  • Dec 04 05:03

    mergify[bot] on master

    Update auxlib, javalib, nativel… (compare)

  • Dec 04 05:03
    mergify[bot] closed #143
  • Dec 04 04:59
    scala-steward synchronize #143
  • Dec 04 01:28

    mergify[bot] on master

    Update sbt-scalafmt to 2.4.5 (#… (compare)

  • Dec 04 01:28
    mergify[bot] closed #1274
  • Dec 04 01:21

    mergify[bot] on master

    Update sbt-scalafmt to 2.4.5 (#… (compare)

  • Dec 04 01:21
    mergify[bot] closed #230
  • Dec 04 01:13

    mergify[bot] on master

    Update sbt-scalafmt to 2.4.5 (#… (compare)

  • Dec 04 01:13
    mergify[bot] closed #139
  • Dec 04 01:11

    mergify[bot] on master

    Update sbt-scalafmt to 2.4.5 (#… (compare)

  • Dec 04 01:11
    mergify[bot] closed #233
  • Dec 04 01:11

    mergify[bot] on master

    Update sbt-scalafmt to 2.4.5 (#… (compare)

  • Dec 04 01:11
    mergify[bot] closed #152
  • Dec 04 01:09
    mergify[bot] labeled #230
  • Dec 04 01:09
    mergify[bot] assigned #230
  • Dec 04 01:09
    scala-steward opened #230
  • Dec 04 01:09
    mergify[bot] labeled #135
  • Dec 04 01:09
    mergify[bot] assigned #135
Nadav Samet
@thesamet
I'll have limited internet connectivity for the rest of September. I will read everything once I'm back and suggest to file GitHub issues for anything that requires follow up.
Rohit Ramprasad
@rrampr
Running into odd issues when using com.google.protobuf.any.Any. There are 2 overloaded pack methods that can be invoked on Any and the compiler gets confused which one to invoke
error: overloaded method pack with alternatives: [A <: scalapb.GeneratedMessage with scalapb.Message[A]](generatedMessage: A, urlPrefix: String): com.google.protobuf.any.Any <and> [A <: scalapb.GeneratedMessage with scalapb.Message[A]](generatedMessage: A): com.google.protobuf.any.Any cannot be applied to (generatedMessage: scalapb.GeneratedMessage with scalapb.Message[_]) event = Any.pack(generatedMessage = message),
Sathyaprakash Dhanabal
@happysathya

Hi, I am using Mac M1.

While using the scalapb compiler plugin I am running into trouble.

In plugin.sbt,

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.3")
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.5"

In build.sbt, I am trying to override the protoc version

PB.protocVersion := "3.17.3"

so that I can use the protoc osx-aarch_64 architecture. But I am getting the following error
"Could not find artifact com.google.protobuf:protoc:exe:osx-aarch_64:3.15.6". Not sure why it is still referring to 3.15.6

Any suggestions.

1 reply
Fredrik Wärnsberg
@frekw
In zio-grp, is there any way to intercept a client call via ZClientInterceptor such that you get to wrap the actual outgoing call? I'm trying to write an interceptor that automatically adds metrics + tracing for any zio-grpc client
Is my best bet to just grab the ClientCall.Listener from a ForwardingZClientCall and run unsafeRun from onMessage?
Fredrik Wärnsberg
@frekw
No wait that won't work
adriansnep16
@adriansnep16
hi!! I'm new to ScalaPB and I have a question....in proto3 how can i create a sealed trait containing also fields ? because as far as I documented until now oneof sealed_value doesn't allow it
Nadav Samet
@thesamet
@adriansnep16 you mean having primitive types (ints, strings) and not just messages? Scala wouldn't allow it since all the types that extend a sealed trait must be defined in the same file, and ints and strings are already defined elsewhere.
@frekw I have limited internet connectivity in the coming week, if needed feel free to file an issue on GitHub and I'll get back to it.
adriansnep16
@adriansnep16
no i mean a structure like this

message foo {
string cause = 1;
}

message bar {
string data = 1;
}

message my_trait {
string id = 1;
oneof sealed_value {
foo fooEl = 2;
bar barEl = 3;
}
}

this will fail at compile time because of "string id" which is present in "mytrait" because "oneof sealed.." doesn't allow additional fields ....and my question is if there is a possibility of modeling "my_trait" to also contain the "string id" field
Nadav Samet
@thesamet
I think that what you want is to create another message MyTraitWithId which would have two fields: string id and 'my_trait mt'
Fredrik Wärnsberg
@frekw
@thesamet will do :pray:
Karan Shah
@karanssh
Hi folks! I am trying to debug a weird issue I am running into. I have a scala grpc server, and clients in go and java. I can connect from the go, java clients fine on ubuntu where I build all of them, but when I compile them on a centOS box and try, the scala grpc server spins up, accepts connections but never responds. Any pointers on how I could debug this would be appreciated
Nadav Samet
@thesamet
Hi @Karen, scalapb uses grpc-java under the hood. It sounds like the issue is unrelated to scalapb, given that it happens when you switch operating systems of the non-scala clients. I suggest to reproduce it with an example have server and client and ask on a grpc help forum.
Karan Shah
@karanssh
Thanks @thesamet , I'll take a look!
Grant
@gavares
@thesamet - I’m working on an MR to remove the deprecation warnings from the zio2 branch. The first test TestServiceSpec.serverStreamingSuite is failing and I’m having a hard time figuring out why. The test is expecting a response stream with two eleemnts Response(“X1”), Response(“X2”) but the Stream only contains the first element. I’ve done a bit of debugging and the stream is exiting successfully. I can’t seem to figure out why the 2nd stream element is never included in the response.
I’ll keep working on it but the draft MR is here if you have any insights: scalapb/zio-grpc#311
Grant
@gavares
I did manage to fix one of the failing tests that was previously failing on the zio2 branch
Grant
@gavares
Managed to fix the failing tests. MR updated.
Raymond Te Hok
@rtehok
hi there, I am using scalapb-runtime-grpc_2.13-0.11.5.jar and it currently raises CVE errors such as CVE-2017-7860, CVE-2017-7861... does any one know why this is raised and how to fix it ?
5 replies
Linh Nguyen
@tuleism
@thesamet in case you missed it scalapb/zio-grpc#303. Let me know if it's not the way to do it!
Nadav Samet
@thesamet
@tuleism merged
Linh Nguyen
@tuleism
Thanks!
Peter Zhong
@jiujiu1123
Hi Has anyone seem errors like this?
[error] Unspecified value parameter message.
[error]             __inner = Option(__inner.fold(_root_.scalapb.LiteParser.readMessage[livongo.microservice.util.filtering.Testing.FilterTarget.Nested](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
[error]                                                                                                                                                 ^
[error] /Users/peter.zhong/Desktop/platform-libraries/microservice-util/target/scala-2.13/src_managed/test/scalapb/livongo/microservice/util/filtering/Testing/FilterTarget.scala:433:127: not enough arguments for method readMessage: (input: com.google.protobuf.CodedInputStream, message: livongo.microservice.util.filtering.Testing.FilterTarget.Nested)(implicit cmp: scalapb.GeneratedMessageCompanion[livongo.microservice.util.filtering.Testing.FilterTarget.Nested]): livongo.microservice.util.filtering.Testing.FilterTarget.Nested.
[error] Unspecified value parameter message.
[error]             __values += _root_.scalapb.LiteParser.readMessage[livongo.microservice.util.filtering.Testing.FilterTarget.Nested](_input__)
[error]
Nadav Samet
@thesamet
@jiujiu1123 I haven't seen, but can you check you are generating code using the same version of ScalaPB that you use to compile? (compilerplugin and scalapb-runtime versions need to match)
Peter Zhong
@jiujiu1123
Thanks let me verify that
Peter Zhong
@jiujiu1123
image.png
@thesamet could it be because the protoc-gen is a different minor version?
Nadav Samet
@thesamet
no, that's fine.
Looks like both compielrplugin and scalapb-runtime are on 0.10.x
Peter Zhong
@jiujiu1123
Yeah which is confusing since the versions should be matching.
Nadav Samet
@thesamet
I am not sure what the list in the screenshot represents, the compilerplugin is not a runtime dependency.
try to figure out why you patch versions are different
another possibility is that from some reason, you still have source code that generated by a different version of the compilerplugin that is configured right now. Try to perform a sbt clean, and have it regenerate.
Peter Zhong
@jiujiu1123
Let me try that. Really appreciate all the advice.
Peter Zhong
@jiujiu1123
I got it to work. Thank you so much!
Nadav Samet
@thesamet
:thumbsup:
Alexis BRENON
@AlexisBRENON
Hi. I try to use scalapb-spark, to read a dataset from Json. It seems to have a problem when a "repeated" field does not appear in the json stream...
In the "messageReads" method, the __fieldsMap.get(...) call returns Some(null)... Is it a known behavior ?
Alexis BRENON
@AlexisBRENON
For example, from this proto file:
syntax = "proto3";

package com.adyoulike.data.proto;

message MyRepeated {
  repeated string ListField = 1;
}
I can load data from this jsonl file:
{"ListField": ["foo", "bar"]}
{"ListField": []}

But this one

{"ListField": ["foo", "bar"]}
{"ListField": []}
{}

fails with

Exception in thread "main" java.lang.NullPointerException
    at com.adyoulike.data.proto.repeated.MyRepeated$.$anonfun$messageReads$4(MyRepeated.scala:84)
    at scala.Option.map(Option.scala:230)
    at com.adyoulike.data.proto.repeated.MyRepeated$.$anonfun$messageReads$1(MyRepeated.scala:84)

(that is to say the __fieldMap.get(...) line

I use an old version of spark and scalapb, but I cannot upgrade for the moment...
I'll try to workaround, using a custom type for my Seq: Option[Seq[...]]
1 reply
Alexis BRENON
@AlexisBRENON
Other question related to scalapb-spark. Is it possible to mix Encoders. I mean, I have a proto message Message. I define a case class case class Nesting(msg: Message, foo: Int). How can I provide an encoder for this case class ?
Nadav Samet
@thesamet
@AlexisBRENON can you give a code shippet on how you read the json and turn it into a case class? I couldn't tell if scalapb-json4s is involved.
1 reply
@AlexisBRENON Recent versions of sparksql-scalapb use frameless to derive encoders. See the tests for OuterCaseClass and OuterCaseClassTimestamp to see an example. For the second case class it uses frameless injections to customize the timestamp type: https://github.com/scalapb/sparksql-scalapb/blob/4017c0c2dea0e261e731547fbdee1202a2e61b16/sparksql-scalapb/src/test/scala/PersonSpec.scala#L34-L35
1 reply
Ángel Cervera Claudio
@angelcervera
Hi @thesamet I need to release a new version of osm4scala. At the moment, I'm using com.thesamet:sbt-protoc:0.99.34 and com.thesamet.scalapb:compilerplugin:0.10.2
Do you think that make sense to upgrade to latests versions? I'm looking for a changelog, but looks like it is not available, right?
Are new versions adding better performance and bug fixes or only new features (That I'm not using)?
Nadav Samet
@thesamet
Hi @angelcervera , the CHANGELOG is in https://github.com/scalapb/ScalaPB/blob/master/CHANGELOG.md . v0.11.x contains additional features, bug fixes, performance improvements, and Scala 3 support.