quick-protobuf icon indicating copy to clipboard operation
quick-protobuf copied to clipboard

pb-rs only checks for message/enum definitions one level up

Open therealprof opened this issue 5 years ago • 6 comments

I noticed that pb-rs fails to compile a number of .proto schema files due to it only looking for message and enum definitions one level up. Other compilers do not seem to have a problem when the messages are further away than one level of their user.

This can be experienced e.g. with https://raw.githubusercontent.com/BroadbandForum/usp/master/specification/usp-msg.proto

The reported error is:

pb-rs ./usp-msg.proto
pb-rs fatal error
  - Could not find message or enum ParameterError

As a workaround one could move all reported messages right next to their user but since other compilers do not take offence this would be a rather awkward workaround.

therealprof avatar Dec 12 '18 14:12 therealprof

I'm having the same issue.

ice1000 avatar Dec 20 '18 07:12 ice1000

Same

ericmcbride avatar Jun 25 '19 20:06 ericmcbride

same

r-wheeler avatar Jun 25 '19 20:06 r-wheeler

same

awaited-hare avatar May 05 '20 03:05 awaited-hare

Still running into this. I tried playing around with fixing it here in https://github.com/tafia/quick-protobuf/blob/master/pb-rs/src/types.rs#L2201 but no luck in the little time I had

nicolaslara avatar Jun 01 '22 07:06 nicolaslara

I have the problem of it not recognizing any of the include paths I have specified, this works perfectly regularly with all other protobuf compilers and with rust-protobuf

See https://github.com/HiceS/mirabuf for example of files that don't work with the compiler

  • Example (Fails on Info Import) : pb-rs --hashrown -I . --output_directory ./libs/rust assembly.proto
  • Example (success) : pb-rs --hashrown -I . --output_directory ./libs/rust types.proto

Even specifying the Include directory with relative and with absolute paths cannot find the first import, only works on the files with no imports.

As a side note it looks like the public tag on the import function is not officially recognized ?

  • example import public "types.proto"

HiceS avatar Jul 20 '22 07:07 HiceS