Alexander Neundorf
2018-05-15 19:45:06 UTC
Hi,
I stumbled upon a problem with protobuf files, I attached a testcase.
There is a MyBase.proto, which is "imported" by Complex.proto.
If MyBase.proto is modified, protoc is run again in MyBase.proto, but not on
Complex.proto, although it should.
You can have a look at the attached example.
The message MyData (in Complex.proto) has a member MyBase b1.
If I rename the message MyBase (in MyBase.proto) e.g. to MyBaseXYZ, then the
build fails, because Complex.pb.h was not regenerated, so it still refered to
the now not existing class MyBase.
Is there already a solution to handle this ?
I think to do it properly, there would have to be a dependency scanning for
proto files like there is for C/C++ headers.
Parsing at the proto-files at cmake time wouldn't be good enough (since editing
a proto file doesn't trigger a cmake run).
Comments ?
Alex
I stumbled upon a problem with protobuf files, I attached a testcase.
There is a MyBase.proto, which is "imported" by Complex.proto.
If MyBase.proto is modified, protoc is run again in MyBase.proto, but not on
Complex.proto, although it should.
You can have a look at the attached example.
The message MyData (in Complex.proto) has a member MyBase b1.
If I rename the message MyBase (in MyBase.proto) e.g. to MyBaseXYZ, then the
build fails, because Complex.pb.h was not regenerated, so it still refered to
the now not existing class MyBase.
Is there already a solution to handle this ?
I think to do it properly, there would have to be a dependency scanning for
proto files like there is for C/C++ headers.
Parsing at the proto-files at cmake time wouldn't be good enough (since editing
a proto file doesn't trigger a cmake run).
Comments ?
Alex