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 723616 - gio/tests: fix race when generating code
gio/tests: fix race when generating code
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-02-04 16:06 UTC by Ross Burton
Modified: 2014-02-17 10:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio/tests: fix race when generating code (2.19 KB, patch)
2014-02-04 16:06 UTC, Ross Burton
committed Details | Review

Description Ross Burton 2014-02-04 16:06:13 UTC
There is a race condition in the makefile that can result in build failures like this in parallel builds:

| ./gdbus-test-codegen-generated.h:7:0: error: unterminated #ifndef
|  #ifndef __GDBUS_TEST_CODEGEN_GENERATED_H__

This is because a rule like this:

x.c x.h: prerequisites
	@commands

doesn't consider x.c and x.h together. Instead, it expands to two rules, one to
generate x.c and one to generate x.h, which happen to run the same commands.  In
the worst case they execute in parallel, overwriting each other's output.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Comment 1 Ross Burton 2014-02-04 16:06:16 UTC
Created attachment 268078 [details] [review]
gio/tests: fix race when generating code
Comment 2 Dan Winship 2014-02-15 16:17:58 UTC
Comment on attachment 268078 [details] [review]
gio/tests: fix race when generating code

looks good

>+gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
>+	@: # Generated as side-effect of .h

you might not even need the last line