After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660498 - Generated test code fails when the codegen changes
Generated test code fails when the codegen changes
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-09-29 16:53 UTC by Cosimo Cecchi
Modified: 2011-10-05 16:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.48 KB, patch)
2011-10-05 16:36 UTC, David Zeuthen (not reading bugmail)
reviewed Details | Review

Description Cosimo Cecchi 2011-09-29 16:53:57 UTC
Generated test code doesn't get regenerated when the code generator changes, causing build failures if you don't manually clean the tree before.

From an IRC conversation with David:

<davidz> Makefile.am should probably depend on the codegen target - can you check if it already does it?
<davidz> http://git.gnome.org/browse/glib/tree/gio/tests/Makefile.am#n269
<davidz> apparently it doesn't
<davidz> it should also depend on Makefile.am itself
<davidz> because the contents of the generated code may change if params passed to the codegen does
<davidz> which is actually what happened in this case
<cosimoc> okay
<davidz> given that I changed Foo to Foo_iGen
Comment 1 David Zeuthen (not reading bugmail) 2011-10-05 16:36:17 UTC
Created attachment 198354 [details] [review]
Patch

This patch does the trick for me - we regenerate either when one of the source files in gdbus-codegen(1) changes or when Makefile.am changes.
Comment 2 Colin Walters 2011-10-05 16:39:55 UTC
Review of attachment 198354 [details] [review]:

::: gio/tests/Makefile.am
@@ +269,2 @@
 if OS_UNIX
+gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile.am $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen

Should depend on Makefile, not Makefile.am.

::: gio/tests/gdbus-object-manager-example/Makefile.am
@@ +22,3 @@
 	$(NULL)
 
+$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile.am $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen

Ditto here.