[Spice-devel] [PATCH spice-common] RFC: add back codegen

Christophe Fergeau cfergeau at redhat.com
Wed Mar 9 13:12:47 UTC 2016


Hey,

On Fri, Feb 26, 2016 at 06:37:59PM +0100, Marc-André Lureau wrote:
> codegen generated code depends on spice-common code (marshaller, messages etc),

The code generated by the python scripts indeed depends on
spice-common/common/messages.h and
spice-common/common/client_marshallers.h

> it makes more sense to keep the generator along this. Otherwise a newer protocol
> release will fail to build older projects (as is the case today).

More specifically, spice-gtk 0.30 and spice-server 0.12.7, which expect
the codegen bits to be in spice-protocol fail with spice-protocol.git,
and would fail with any spice-protocol release newer than the one which
was current when they were released. This basically means that any new
spice-protocol release may not be backward compatible, which is
suboptimal to say the least ;)

This patch reverts the movement of the codegen bits, which removes these
backward-compatibility issues they cause when they are in
spice-protocol, and basically allows us to move forward with making
releases. Just for that, I'd tend to ACK it.

spice-gtk 0.30/spice-server 0.12.7 are still going to be broken though,
imo we should at the very least provide patches which can be applied on
top of these so that they work with the new spice-protocol releases.


However, I think that these patches are moving us from one suboptimal
situation to a similarly suboptimal situation, just one which is less
broken release-wise. We've got a module named spice-protocol, but it
does not contain the protocol description, the protocol description is
duplicated in spice-gtk and spice-server instead. Moreover,
spice-protocol still contains this enums.h header which is
auto-generated from the same python scripts. I assume with that proposal
this is going to need to be manually sync'ed?

Longer term, I think it should be possible to autogenerate common/messages.h
and common/client_marshallers.h as well, which hopefully would avoid
the issue we currently have. I have some hackish code which generates a
correct common/client_marshallers.h file already, I haven't looked at
common/messages.h yet.
Another option might be to ship a libspice-marshaller.so with
spice-protocol, but I haven't looked how realistic that is.
Maybe there are other options, maybe there is strong disagreement with
having spice.proto/the code gen bits in spice-protocol, we can discuss
all of this now ;)

Christophe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160309/e416ca50/attachment.sig>


More information about the Spice-devel mailing list