-
Notifications
You must be signed in to change notification settings - Fork 582
-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
name conflict in files generated from rpc.proto #625
Comments
Could you provide some more details about what you are trying to do? Maybe also the steps you took to get this error. |
To reproduce the issue:
This will give you a bunch of the error message cited above. |
Thanks, this has been reported in other projects already: protocolbuffers/protobuf#4654 It seems others have just renamed those fields. Not sure we can do that easily as it would break RPC clients. |
Thinking more about it, this should actually be easy to solve as the names are not really important in protobuf, as long as the ID of those properties does not change it should be easy to change it. For external RPC users we change the protobuf definitions and the corresponding code using it whenever it is necessary, but the communication between CRIU and its RPC clients should always keep working. |
I'm not a protobuf expert but this sounds reasonable to me.
I've personally opted for the "#undef {minor,major}" workaround as it suits
my needs.
Le jeu. 21 févr. 2019 à 17:42, Adrian Reber <notifications@github.com> a
écrit :
… Thinking more about it, this should actually be easy to solve as the names
are not really important in protobuf, as long as the ID of those properties
does not change it should be easy to change it.
For external RPC users we change the protobuf definitions and the
corresponding code using it whenever it is necessary, but the communication
between CRIU and its RPC clients should always keep working.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#625 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AO9skfOx1fLlDva1tl5_9RJtouzp8AoRks5vPsxhgaJpZM4bFc9_>
.
--
Gabriel Busnot
|
This changes will require code changes to everyone using our protobuf RPC definition. It will not break running programs, even if CRIU is updated, but compilation will fail. So kind of an API break without breaking ABI... (I hope I understand protobuf correctly). |
It my actually be even better than that.
If I undestand protobuff, the field names exist only in the .proto file and
the .cc and .h files generated from it.
Everything after that point should be field names agnostic and relie on
field ids only.
As a result, as long as the API user doesn't regenerate the .cc and .h
files from the updated .proto file, his code will compile just as before
and run as well.
Also, I don't understand how such usual words as minor and major can end up
as macros in a fundamental system header.
Le jeu. 21 févr. 2019 à 17:57, Adrian Reber <notifications@github.com> a
écrit :
… This changes will require code changes to everyone using our protobuf RPC
definition. It will not break running programs, even if CRIU is updated,
but compilation will fail. So kind of an API break without breaking ABI...
(I hope I understand protobuf correctly).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#625 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AO9skUxrICObMhiWBCVEgkRoBWPzrekaks5vPs_ngaJpZM4bFc9_>
.
--
Gabriel Busnot
|
Yes, that is also how I understand it. I will prepare a patch and hopefully this will be part of the next release if no one sees any other problems with this approach. |
In rpc.proto the interface to query the CRIU version number uses major and minor as keywords. This creates errors when using the RPC definitions with C++: checkpoint-restore#625 In this commit the fields are renamed from major to major_number and from minor to minor_number. For existing programs using the RPC protobuf definition this should be a transparent change. Only for programs importing the latest rpc.proto it will require code changes. Signed-off-by: Adrian Reber <areber@redhat.com>
In rpc.proto the interface to query the CRIU version number uses major and minor as keywords. This creates errors when using the RPC definitions with C++: #625 In this commit the fields are renamed from major to major_number and from minor to minor_number. For existing programs using the RPC protobuf definition this should be a transparent change. Only for programs importing the latest rpc.proto it will require code changes. Signed-off-by: Adrian Reber <areber@redhat.com>
Should we close this issue? |
Done, thanks for your work ! |
In rpc.proto the interface to query the CRIU version number uses major and minor as keywords. This creates errors when using the RPC definitions with C++: checkpoint-restore#625 In this commit the fields are renamed from major to major_number and from minor to minor_number. For existing programs using the RPC protobuf definition this should be a transparent change. Only for programs importing the latest rpc.proto it will require code changes. Signed-off-by: Adrian Reber <areber@redhat.com>
In rpc.proto the interface to query the CRIU version number uses major and minor as keywords. This creates errors when using the RPC definitions with C++: #625 In this commit the fields are renamed from major to major_number and from minor to minor_number. For existing programs using the RPC protobuf definition this should be a transparent change. Only for programs importing the latest rpc.proto it will require code changes. Signed-off-by: Adrian Reber <areber@redhat.com>
The field minor and major of the criu_version message conflict with macros defined in system header giving the following error :
Undefining these macros before including the file is not good enough to me ;)
The text was updated successfully, but these errors were encountered: