awakesecurity / proto3-suite

Haskell Protobuf Implementation
https://hackage.haskell.org/package/proto3-suite
Other
79 stars 54 forks source link

compile-proto-file does not respect the `package` directive #153

Open ProofOfKeags opened 3 years ago

ProofOfKeags commented 3 years ago

Trying to compile these protobufs here: https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto#L2421

It seems that it does not recognize the package prefix that is defined here: https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto#L3

Is this a bug or a limitation of the current implementation?

ProofOfKeags commented 3 years ago

Here's how it is defined by the protobuf3 spec: https://developers.google.com/protocol-buffers/docs/proto3#packages

I suppose the question is that if I were to submit a patch, what modules would I begin looking in here?

Gabriella439 commented 3 years ago

Sorry for the late reply. This is definitely a bug in the current implementation. The main module that you would want to look at is Proto3.Suite.DotProto.Generate:

https://github.com/awakesecurity/proto3-suite/blob/master/src/Proto3/Suite/DotProto/Generate.hs