GNOME Bugzilla – Bug 688132
code generation during build has a race due to unintended concurrency
Last modified: 2013-01-02 09:37:30 UTC
make[2]: Entering directory `/home/desrt/jhbuild/checkout/empathy/extensions' GEN _gen/all.xml GEN _gen/misc.xml GEN _gen/cli-misc.h GEN _gen/svc-misc.h GEN _gen/cli-misc-body.h GEN _gen/svc-misc.c GEN _gen/register-dbus-glib-marshallers-body.h GEN _gen/enums.h GEN _gen/gtypes.h GEN _gen/gtypes-body.h GEN _gen/interfaces.h GEN _gen/interfaces-body.h GEN extensions.html make[2]: Leaving directory `/home/desrt/jhbuild/checkout/empathy/extensions' make[1]: Leaving directory `/home/desrt/jhbuild/checkout/empathy' Traceback (most recent call last):
+ Trace 231162
end_headers, not_implemented_func, allow_havoc)()
file_set_contents(self.basename + '.h', '\n'.join(self.__header))
os.rename(filename + '.tmp', filename)
make[2]: *** [_gen/svc-misc.h] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Reading the Makefile.am: _gen/svc-misc.c _gen/svc-misc.h: _gen/misc.xml \ $(tools_dir)/glib-ginterface-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc-misc \ --signal-marshal-prefix=_emp_ext \ --include='<telepathy-glib/telepathy-glib.h>' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ --allow-unstable \ $< Emp_Svc_ and nodist_libemp_extensions_la_SOURCES = \ _gen/register-dbus-glib-marshallers-body.h \ _gen/enums.h \ _gen/gtypes.h \ _gen/gtypes-body.h \ _gen/interfaces.h \ _gen/interfaces-body.h \ _gen/cli-misc.h \ _gen/cli-misc-body.h \ _gen/svc-misc.h \ _gen/svc-misc.c It's pretty clear that svc-misc.h and svc-misc.c are both attempting to be generated, separately, using the same rule (ie: the same thing is being done twice). In parallel builds, one instance of this has a chance of stepping on the other, renaming the .tmp file out from under it. This leads to the error above. The fix is probably something along the lines of changing one of the files (.h?) to be a straight dependency on the other file (.c?) so that the codegen only runs once.
I've hit this race a total of three times now... it's not really all that thin, it seems... at least on my machine.
Created attachment 230324 [details] [review] Make parallel builds work
Created attachment 230328 [details] [review] Make parallel builds work Add some comments and explanation for good measure.
From #empathy on irc.gnome.org: <desrt> rishi: i bet that fixes it, indeed <sjoerd> rishi: looks great, go for it ;)
Same bug with at least one more file... make[2]: *** [_gen/cli-misc.h] Error 1
Created attachment 232328 [details] [review] extensions: fix parallel build Based on a similar fix from Debarshi Ray: f1ab42c0c5332e47b33ecf905afd7fd6c2a344e8
Comment on attachment 232328 [details] [review] extensions: fix parallel build I don't have a system to test it, but looks fine to me. Maybe add a comment as sjoerd wanted last time.
Attachment 232328 [details] pushed as aadf937 - extensions: fix parallel build