proto3-suite icon indicating copy to clipboard operation
proto3-suite copied to clipboard

gRPC "option" expression support

Open tim2CF opened this issue 5 years ago • 3 comments

Looks like atm option gRPC expression is not supported. Example:

[nix-shell:/app]# compile-proto-file --proto proto/lnd.proto > Lnd.hs --out src
Error: failed to compile "proto/lnd.proto":

CompileParseError "/app/proto/lnd.proto" (line 47, column 34):
unexpected "="
expecting "."

Here is link to actual line in protobuf document: https://github.com/lightningnetwork/lnd/blob/949a5c5a04a1d2ab239be5732fd1c6796f51e344/lnrpc/rpc.proto#L45

If proto3-suite does not support this feature (or it can't be fixed), maybe you can help me find a library which supports it. Thanks!

tim2CF avatar Nov 28 '19 14:11 tim2CF

@tim2CF: proto3-suite currently does not support it

To provide some context here, one of the things we learned in the course of open sourcing this project is thatproto3-suite is doing something that is "architecturally" incorrect. Specifically, proto3-suite is parsing the .proto file itself, when protocol buffers was designed so that the protoc tool would parse that for you and pass in the parsed result to a plugin via a binary format (which is supported by the Haskell protocol-buffers package).

If we were to switch this to support being used as a protoc plugin then it would fix parsing issues like the one you mentioned, although at the moment we're not currently working on it.

Gabriella439 avatar Dec 10 '19 21:12 Gabriella439

thanks!

tim2CF avatar Dec 11 '19 23:12 tim2CF

@tim2CF: You're welcome! 🙂

Gabriella439 avatar Dec 12 '19 00:12 Gabriella439