[Spice-devel,spice-common,2/3] spice-protocol/spice/enums.h: rebuild from spice.proto

Submitted by Alon Levy on June 14, 2012, 11:03 a.m.

Details

Message ID 1339671807-29069-3-git-send-email-alevy@redhat.com
State Accepted
Commit b49c4794ee23b0e31cde1ba8c7a34a1f27f2f98f
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy June 14, 2012, 11:03 a.m.
This file was hand generated until now, resulting in the wierd situation where
it is different for spice-gtk and spice-server even though they both use the
same spice-common and spice-protocol (or at least close) versions.

This patch generates the enums.h files from spice-common. While that file is
actually in the spice-protocol submodule, it cannot be generated from
spice-protocol since it lacks access to spice.proto and spice_codegen.py. So in
affect whenvever it will differ the spice-protocol module will become dirty and
hence hopefully commited with the new enums.h.

enums.h is generated from spice.proto is a superset of that generated from spice1.proto.
---
 common/Makefile.am |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/common/Makefile.am b/common/Makefile.am
index 08c4b83..3210fc8 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -14,7 +14,7 @@  SERVER_MARSHALLERS =					\
 	$(srcdir)/generated_server_marshallers.h	\
 	$(NULL)
 
-BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
+BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
 
 noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
 libspice_common_la_SOURCES =		\
@@ -122,6 +122,9 @@  generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
 generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
 	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
 
+$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
+	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
+
 EXTRA_DIST =				\
 	$(CLIENT_MARSHALLERS)		\
 	$(SERVER_MARSHALLERS)		\

Comments

On Thu, Jun 14, 2012 at 02:03:25PM +0300, Alon Levy wrote:
> This file was hand generated until now, resulting in the wierd situation where
> it is different for spice-gtk and spice-server even though they both use the
> same spice-common and spice-protocol (or at least close) versions.
> 
> This patch generates the enums.h files from spice-common. While that file is
> actually in the spice-protocol submodule, it cannot be generated from
> spice-protocol since it lacks access to spice.proto and spice_codegen.py.

yeah, a bit ugly :-/

> So in
> affect whenvever it will differ the spice-protocol module will become dirty and
> hence hopefully commited with the new enums.h.

spice-protocol/spice-common are always dirty here even when I don't modify
them, so I wouldn't place my hopes too high on this being noticed.

> 
> enums.h is generated from spice.proto is a superset of that generated from spice1.proto.
> ---
>  common/Makefile.am |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/common/Makefile.am b/common/Makefile.am
> index 08c4b83..3210fc8 100644
> --- a/common/Makefile.am
> +++ b/common/Makefile.am
> @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =					\
>  	$(srcdir)/generated_server_marshallers.h	\
>  	$(NULL)
>  
> -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
>  
>  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
>  libspice_common_la_SOURCES =		\
> @@ -122,6 +122,9 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
>  
> +$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> +	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
> +

Is make distcheck ok with generating a file in $(top_srcdir)? Is the
enums.h file correctly dist'ed ?

Christophe
On Wed, Jun 20, 2012 at 01:18:10PM +0200, Christophe Fergeau wrote:
> On Thu, Jun 14, 2012 at 02:03:25PM +0300, Alon Levy wrote:
> > This file was hand generated until now, resulting in the wierd situation where
> > it is different for spice-gtk and spice-server even though they both use the
> > same spice-common and spice-protocol (or at least close) versions.
> > 
> > This patch generates the enums.h files from spice-common. While that file is
> > actually in the spice-protocol submodule, it cannot be generated from
> > spice-protocol since it lacks access to spice.proto and spice_codegen.py.
> 
> yeah, a bit ugly :-/
> 
> > So in
> > affect whenvever it will differ the spice-protocol module will become dirty and
> > hence hopefully commited with the new enums.h.
> 
> spice-protocol/spice-common are always dirty here even when I don't modify
> them, so I wouldn't place my hopes too high on this being noticed.
> 
> > 
> > enums.h is generated from spice.proto is a superset of that generated from spice1.proto.
> > ---
> >  common/Makefile.am |    5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/common/Makefile.am b/common/Makefile.am
> > index 08c4b83..3210fc8 100644
> > --- a/common/Makefile.am
> > +++ b/common/Makefile.am
> > @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =					\
> >  	$(srcdir)/generated_server_marshallers.h	\
> >  	$(NULL)
> >  
> > -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> > +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
> >  
> >  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
> >  libspice_common_la_SOURCES =		\
> > @@ -122,6 +122,9 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
> >  
> > +$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > +	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
> > +
> 
> Is make distcheck ok with generating a file in $(top_srcdir)? Is the
> enums.h file correctly dist'ed ?

This patch doesn't pass make distcheck, due to enums.h being read only
due to it being part of a submodule (this is just my understanding, the
fact is just that it is read only). I still need to find a proper way of
doing it.

> 
> Christophe
On Wed, Jun 20, 2012 at 02:56:58PM +0300, Alon Levy wrote:
> On Wed, Jun 20, 2012 at 01:18:10PM +0200, Christophe Fergeau wrote:
 > Is make distcheck ok with generating a file in $(top_srcdir)? Is the
> > enums.h file correctly dist'ed ?
> 
> This patch doesn't pass make distcheck, due to enums.h being read only
> due to it being part of a submodule (this is just my understanding, the
> fact is just that it is read only). I still need to find a proper way of
> doing it.

The unpacked source tree during make distcheck is read-only, only the build
directory is writable to. One possible fix would be to put the generated
file into $builddir.

Christophe
On Wed, Jun 20, 2012 at 01:18:10PM +0200, Christophe Fergeau wrote:
> On Thu, Jun 14, 2012 at 02:03:25PM +0300, Alon Levy wrote:
> > This file was hand generated until now, resulting in the wierd situation where
> > it is different for spice-gtk and spice-server even though they both use the
> > same spice-common and spice-protocol (or at least close) versions.
> > 
> > This patch generates the enums.h files from spice-common. While that file is
> > actually in the spice-protocol submodule, it cannot be generated from
> > spice-protocol since it lacks access to spice.proto and spice_codegen.py.
> 
> yeah, a bit ugly :-/

How about this: I move the rule into spice-protocol. It will check if
it's parent directory is spice-common, specifically just check for
spice.proto and spice_codegen.py, and if so it will update enums.h. That
should also fix make distcheck.

> 
> > So in
> > affect whenvever it will differ the spice-protocol module will become dirty and
> > hence hopefully commited with the new enums.h.
> 
> spice-protocol/spice-common are always dirty here even when I don't modify
> them, so I wouldn't place my hopes too high on this being noticed.

This is a seperate issue, I have it to. It is a result of the .gitignore
(that we generate from git.mk) missing some files.

> 
> > 
> > enums.h is generated from spice.proto is a superset of that generated from spice1.proto.
> > ---
> >  common/Makefile.am |    5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/common/Makefile.am b/common/Makefile.am
> > index 08c4b83..3210fc8 100644
> > --- a/common/Makefile.am
> > +++ b/common/Makefile.am
> > @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =					\
> >  	$(srcdir)/generated_server_marshallers.h	\
> >  	$(NULL)
> >  
> > -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> > +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
> >  
> >  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
> >  libspice_common_la_SOURCES =		\
> > @@ -122,6 +122,9 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
> >  
> > +$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > +	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
> > +
> 
> Is make distcheck ok with generating a file in $(top_srcdir)? Is the
> enums.h file correctly dist'ed ?
> 
> Christophe
On Wed, Jun 20, 2012 at 04:23:30PM +0300, Alon Levy wrote:
> On Wed, Jun 20, 2012 at 01:18:10PM +0200, Christophe Fergeau wrote:
> > On Thu, Jun 14, 2012 at 02:03:25PM +0300, Alon Levy wrote:
> > > This file was hand generated until now, resulting in the wierd situation where
> > > it is different for spice-gtk and spice-server even though they both use the
> > > same spice-common and spice-protocol (or at least close) versions.
> > > 
> > > This patch generates the enums.h files from spice-common. While that file is
> > > actually in the spice-protocol submodule, it cannot be generated from
> > > spice-protocol since it lacks access to spice.proto and spice_codegen.py.
> > 
> > yeah, a bit ugly :-/
> 
> How about this: I move the rule into spice-protocol. It will check if
> it's parent directory is spice-common, specifically just check for
> spice.proto and spice_codegen.py, and if so it will update enums.h. That
> should also fix make distcheck.

I think I prefer the current patch ;)

> 
> > 
> > > So in
> > > affect whenvever it will differ the spice-protocol module will become dirty and
> > > hence hopefully commited with the new enums.h.
> > 
> > spice-protocol/spice-common are always dirty here even when I don't modify
> > them, so I wouldn't place my hopes too high on this being noticed.
> 
> This is a seperate issue, I have it to. It is a result of the .gitignore
> (that we generate from git.mk) missing some files.

Yeah I know it has nothing to do with your changes, what I meant is that we
won't necessarily notice enums.h needs updating since
spice-common/spice-protocol tend to always be dirty for other reasons.

Christophe
On Wed, Jun 20, 2012 at 02:08:53PM +0200, Christophe Fergeau wrote:
> On Wed, Jun 20, 2012 at 02:56:58PM +0300, Alon Levy wrote:
> > On Wed, Jun 20, 2012 at 01:18:10PM +0200, Christophe Fergeau wrote:
>  > Is make distcheck ok with generating a file in $(top_srcdir)? Is the
> > > enums.h file correctly dist'ed ?
> > 
> > This patch doesn't pass make distcheck, due to enums.h being read only
> > due to it being part of a submodule (this is just my understanding, the
> > fact is just that it is read only). I still need to find a proper way of
> > doing it.
> 
> The unpacked source tree during make distcheck is read-only, only the build
> directory is writable to. One possible fix would be to put the generated
> file into $builddir.

I'll try that.

> 
> Christophe



> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel