telepathy-mission-control: do_compile failed (race issue)
cover telepathy-mission-control: do_compile failed (race issue)
The following changes since commit 7c85b0d6dad9410b43842a18a372ed3331c96e27:
linux-libc-headers: do_install: fix "Argument list too long" error (2013-09-13 22:28:46 -0400)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib robert/tmc
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/tmc
Robert Yang (1):
telepathy-mission-control: do_compile failed (race issue)
.../tmc-Makefile-fix-race.patch | 47 ++++++++++++++++++++ .../telepathy/telepathy-mission-control_5.15.0.bb | 5 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-connectivity/telepathy/telepathy-mission-control/tmc-Makefile-fix-race.patch
Signature · 1 line
1.7.10.4
PATCH 1/1 telepathy-mission-control: do_compile failed (race issue)
There might be an error when parallel build:
[snip]
Traceback (most recent call last):
File "/path/to/tools/glib-gtypes-generator.py", line 304, in <module>
GTypesGenerator(dom, argv[1], argv[2])()
File "/path/to/tools/glib-gtypes-generator.py", line 295, in __call__
file_set_contents(self.output + '.h', ''.join(self.header)) File "/path/to/tools/libtpcodegen.py", line 42, in file_set_contents
os.rename(filename + '.tmp', filename)
OSError: [Errno 2] No such file or directory
[snip]
This is a race issue, the _gen/gtypes.h and _gen/gtypes-body.h may write(remove/rename) _gen/gtypes.tmp at the same time, then there would be the error.
Use ".NOTPARALLEL: _gen/gtypes.h _gen/gtypes-body.h" will fix the problem.
[YOCTO #5184]
--- .../tmc-Makefile-fix-race.patch | 47 ++++++++++++++++++++ .../telepathy/telepathy-mission-control_5.15.0.bb | 5 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-connectivity/telepathy/telepathy-mission-control/tmc-Makefile-fix-race.patch
meta/recipes-connectivity/telepathy/telepathy-mission-control/tmc-Makefile-fix-race.patch new file +47 -0
@@ -0,0 +1,47 @@ +From 029fcd600707f25a73b0171497140dab264f56b7 Mon Sep 17 00:00:00 2001 +From: Robert Yang <[email protected]> +Date: Sat, 14 Sep 2013 04:26:46 -0400 +Subject: [PATCH] src/Makefile.am: let _gen/gtypes.h and _gen/gtypes-body.h run serially + +There might be an error when parallel build: + +[snip] +Traceback (most recent call last): + File "/path/to/tools/glib-gtypes-generator.py", line 304, in <module> + GTypesGenerator(dom, argv[1], argv[2])() + File "/path/to/tools/glib-gtypes-generator.py", line 295, in __call__ + file_set_contents(self.output + '.h', ''.join(self.header)) + File "/path/to/tools/libtpcodegen.py", line 42, in file_set_contents + os.rename(filename + '.tmp', filename) +OSError: [Errno 2] No such file or directory +[snip] + +This is a race issue, the _gen/gtypes.h and _gen/gtypes-body.h may +write(remove/rename) _gen/gtypes.tmp at the same time, then there would +be the error. + +Use ".NOTPARALLEL: _gen/gtypes.h _gen/gtypes-body.h" will fix the +problem. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <[email protected]> +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -293,7 +293,7 @@ _gen/gtypes.h _gen/gtypes-body.h: _gen/mcd.xml \ + $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ + $< _gen/gtypes mc + +- ++.NOTPARALLEL: _gen/gtypes.h _gen/gtypes-body.h + + # Generated files which must be generated per "class". + # (Currently the only "class" is nmc4, but the new API will need "classes" +-- +1.7.10.4 +
meta/recipes-connectivity/telepathy/telepathy-mission-control_5.15.0.bb +4 -1
@@ -6,7 +6,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \ SECTION = "libs" DEPENDS = "libtelepathy dbus-glib gconf libxslt-native" -SRC_URI = "http://telepathy.freedesktop.org/releases/telepathy-mission-control/telepathy-mission-control-${PV}.tar.gz" +SRC_URI = "http://telepathy.freedesktop.org/releases/telepathy-mission-control/telepathy-mission-control-${PV}.tar.gz \ + file://tmc-Makefile-fix-race.patch \ + " + SRC_URI[md5sum] = "0efd7d9043f6e189e8ed8111d043b52c" SRC_URI[sha256sum] = "88800d1b5f385e94b34721319ff4fe65c493632954d7229b36e57af5b4a7e1b5"
Signature · 1 line
1.7.10.4
Quoted 13 lines · Robert Yang
There might be an error when parallel build:
[snip]
Traceback (most recent call last):
File "/path/to/tools/glib-gtypes-generator.py", line 304, in <module>GTypesGenerator(dom, argv[1], argv[2])() File "/path/to/tools/glib-gtypes-generator.py", line 295, in __call__ file_set_contents(self.output + '.h', ''.join(self.header))File "/path/to/tools/libtpcodegen.py", line 42, in
file_set_contents
os.rename(filename + '.tmp', filename)
OSError: [Errno 2] No such file or directory
[snip]
Quoted 6 lines
This is a race issue, the
_gen/gtypes.hand_gen/gtypes-body.hmay write(remove/rename) _gen/gtypes.tmp at the same time, then there would be the error.Use ".NOTPARALLEL:
_gen/gtypes.h_gen/gtypes-body.h" will fix the problem.
This is going to be a game of whack-a-mole as the root cause is the bad temporary filename assignment in libtpcodegen.py. Is there an upstream bug for this?
Ross
Quoted 10 lines · Ross
Quoted 6 lines
This is a race issue, the
_gen/gtypes.hand_gen/gtypes-body.hmay write(remove/rename) _gen/gtypes.tmp at the same time, then there would be the error.Use ".NOTPARALLEL:
_gen/gtypes.h_gen/gtypes-body.h" will fix the problem.This is going to be a game of whack-a-mole as the root cause is the bad temporary filename assignment in
libtpcodegen.py. Is there an upstream bug for this?
Had a quick look - there's a trivial race in the utility code that a bit of tempfile can fix, but the more correct fix for telepathy-mission-control is to do the same fix that telepathy-glib did here:
https://bugs.freedesktop.org/show_bug.cgi?id=69446 is the upstream bug I just filed for this.
Ross
Quoted 12 lines · Ross
Quoted 10 lines · Ross
Quoted 6 lines
This is a race issue, the
_gen/gtypes.hand_gen/gtypes-body.hmay write(remove/rename) _gen/gtypes.tmp at the same time, then there would be the error.Use ".NOTPARALLEL:
_gen/gtypes.h_gen/gtypes-body.h" will fix the problem.This is going to be a game of whack-a-mole as the root cause is the bad temporary filename assignment in
libtpcodegen.py. Is there an upstream bug for this?
Quoted 6 lines
Had a quick look - there's a trivial race in the utility code that a bit of tempfile can fix, but the more correct fix for telepathy-mission-control is to do the same fix that telepathy-glib did here:
I don't think that the commit you mentioned is a correct fix, he changed:
gen/gtypes.h _gen/gtypes-body.h: _gen/stable-spec.xml
To:
gen/gtypes.h: _gen/gtypes-body.h
@:
gen/gtypes-body.h: _gen/stable-spec.xml
Now if we run "make gen/gtypes.h gen/gtypes-body.h", the gen/gtypes-body.h will only run once, this is incorrect. And this fix has been dropped in the up to date source.
// Robert
Quoted 7 lines
https://bugs.freedesktop.org/show_bug.cgi?id=69446 is the upstream bug I just filed for this.
Ross
Quoted 4 lines · Robert Yang
I don't think that the commit you mentioned is a correct fix, he changed:
gen/gtypes.h_gen/gtypes-body.h:_gen/stable-spec.xml
Quoted 8 lines
To:
gen/gtypes.h:_gen/gtypes-body.h@:
gen/gtypes-body.h:_gen/stable-spec.xmlNow if we run "make
gen/gtypes.hgen/gtypes-body.h", thegen/gtypes-body.hwill only run once, this is incorrect.
But the Python script used in the second rule generates *both* files, which is why the current rules in telepathy-mission-control are incorrect:
~/Local/mess/37/telepathy-mission-control/src
$ ls _gen/gtypes* _gen/gtypes-body.h _gen/gtypes.h
~/Local/mess/37/telepathy-mission-control/src
$ rm _gen/gtypes* -f
~/Local/mess/37/telepathy-mission-control/src
$ make _gen/gtypes.h /usr/bin/python ../tools/glib-gtypes-generator.py \ _gen/mcd.xml _gen/gtypes mc
~/Local/mess/37/telepathy-mission-control/src
$ ls _gen/gtypes* _gen/gtypes-body.h _gen/gtypes.h
The anti-pattern of:
foo bar:
this-script-generates-both-files.sh
is wrong in parallel builds.
Ross
Quoted 7 lines · Ross
Quoted 6 lines · Robert Yang
I don't think that the commit you mentioned is a correct fix, he changed:
gen/gtypes.h_gen/gtypes-body.h:_gen/stable-spec.xmlTo:
Quoted 8 lines
Quoted 6 lines
gen/gtypes.h:_gen/gtypes-body.h@:
gen/gtypes-body.h:_gen/stable-spec.xmlNow if we run "make
gen/gtypes.hgen/gtypes-body.h", thegen/gtypes-body.hwill only run once, this is incorrect.But the Python script used in the second rule generates *both* files,
Ah, yes, thanks, what's your opinion on my patch ? Is it OK or should it be re-worked ? I think that this fix is simple and easy to understand.
// Robert
Quoted 29 lines
which is why the current rules in telepathy-mission-control are incorrect:
~/Local/mess/37/telepathy-mission-control/src
$ ls _gen/gtypes* _gen/gtypes-body.h _gen/gtypes.h~/Local/mess/37/telepathy-mission-control/src
$ rm _gen/gtypes* -f~/Local/mess/37/telepathy-mission-control/src
$ make _gen/gtypes.h /usr/bin/python ../tools/glib-gtypes-generator.py \ _gen/mcd.xml _gen/gtypes mc~/Local/mess/37/telepathy-mission-control/src
$ ls _gen/gtypes* _gen/gtypes-body.h _gen/gtypes.hThe anti-pattern of:
foo bar:
this-script-generates-both-files.shis wrong in parallel builds.
Ross
Quoted 2 lines · Robert Yang
Ah, yes, thanks, what's your opinion on my patch ? Is it OK or should it be re-worked ? I think that this fix is simple and easy to understand.
It should be re-worked to use the pattern in the commit I mentioned - using .NOTPARALLEL is working around the problem that the rule dependencies are incorrect.
Ross