ghostscript: fix parallel build issue
cover ghostscript: fix parallel build issue
From: Kang Kai <[email protected]>
Hi Saul,
This commit is for Yocto #1202: ghostscript do_compile fail on autobuilder for crownbay-noemgd and qemux86-64.
As you told, I use 'cp -f' instead of cp. But I didn't have environment to test, just check that build log is fine.
So Jiajun could you please help to test? Thank you!
Regards,
The following changes since commit 860a41bae6b863a289b06a9684d9cf6c58a307bd:
arch-ia32.inc: Fix up TUNE_ARCH variable conflicts (2011-07-26 22:39:59 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/gs
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/gs
Kang Kai (1):
ghostscript: fix parallel build issue
.../ghostscript-9.02-parallel-make.patch | 17 +++++++++++++++++ .../ghostscript/ghostscript_9.02.bb | 3 ++- 2 files changed, 19 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch
Signature · 1 line
1.7.5.1.300.gc565c
PATCH 1/1 ghostscript: fix parallel build issue
From: Kang Kai <[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue. Add patch to fix it.
Fixes [Yocto #1202]
--- .../ghostscript-9.02-parallel-make.patch | 17 +++++++++++++++++ .../ghostscript/ghostscript_9.02.bb | 3 ++- 2 files changed, 19 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +17 -0
@@ -0,0 +1,17 @@ +When parallel make it will fail with multi copy, see +http://bugzilla.pokylinux.org/show_bug.cgi?id=1202 + +Upstream-Status: Pending + +Signed-off-by: Kang Kai <[email protected]> +--- ghostscript-9.02/base/unixhead.mak.orig 2011-07-27 17:06:17.749456100 +0800 ++++ ghostscript-9.02/base/unixhead.mak 2011-07-27 17:06:37.449456100 +0800 +@@ -54,7 +54,7 @@ + + # Define generic commands. + +-CP_=cp ++CP_=cp -f + RM_=rm -f + RMN_=rm -f +
meta/recipes-extended/ghostscript/ghostscript_9.02.bb +2 -1
@@ -15,7 +15,7 @@ SECTION = "console/utils" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://LICENSE;md5=d151214b3131251dfc9d858593acbd24" -PR = "r3" +PR = "r4" DEPENDS = "${PN}-native tiff jpeg fontconfig cups" DEPENDS_virtclass-native = ""
@@ -27,6 +27,7 @@ SRC_URI = "${SRC_URI_BASE} \ file://ghostscript-9.02-genarch.patch \ file://objarch.h \ file://soobjarch.h \ + file://ghostscript-9.02-parallel-make.patch \ " SRC_URI_virtclass-native = "${SRC_URI_BASE}"
Signature · 1 line
1.7.5.1.300.gc565c
Richard Purdie
AppliedQuoted 8 lines · Kang Kai
From: Kang Kai <[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue. Add patch to fix it.
Fixes [Yocto #1202]
Signed-off-by Kang Kai <[email protected]>
Merged to master, thanks.
Richard
Quoted 30 lines · Kang Kai
From: Kang Kai <[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue. Add patch to fix it.
Fixes [Yocto #1202]
Signed-off-by Kang Kai <[email protected]>--- .../ghostscript-9.02-parallel-make.patch | 17 +++++++++++++++++ .../ghostscript/ghostscript_9.02.bb | 3 ++- 2 files changed, 19 insertions(+), 1 deletions(-) create mode 100644meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-mak e.patch
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch new file mode 100644
index 0000000..76d1676
---/dev/null
+++
b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch @@ -0,0 +1,17 @@meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +4
-0+When parallel make it will fail with multi copy, see +http://bugzilla.pokylinux.org/show_bug.cgi?id=1202 + +Upstream-Status: Pending
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch line 14
Quoted 10 lines
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +10
-0+ +Signed-off-by: Kang Kai <[email protected]> +--- ghostscript-9.02/base/unixhead.mak.orig 2011-07-27 17:06:17.749456100 +0800 ++++ ghostscript-9.02/base/unixhead.mak 2011-07-27 17:06:37.449456100 +0800 +@@ -54,7 +54,7 @@ + + # Define generic commands. + +-CP_=cp ++CP_=cp -f
It means it will first delete the target if it exists. Did you check if this is correct behavior ?
Signature · 1 line
Khem Raj
Quoted 36 lines · Khem Raj
Quoted 35 lines · Kang Kai
From: Kang Kai<[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue. Add patch to fix it.
Fixes [Yocto #1202]
Signed-off-by Kang Kai<[email protected]>--- .../ghostscript-9.02-parallel-make.patch | 17 +++++++++++++++++ .../ghostscript/ghostscript_9.02.bb | 3 ++- 2 files changed, 19 insertions(+), 1 deletions(-)create mode 100644
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-mak e.patchdiff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch new file mode 100644
index 0000000..76d1676
---/dev/null
+++
b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch @@ -0,0 +1,17 @@meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +9
-0+When parallel make it will fail with multi copy, see +http://bugzilla.pokylinux.org/show_bug.cgi?id=1202 + +Upstream-Status: Pending + +Signed-off-by: Kang Kai<[email protected]> +--- ghostscript-9.02/base/unixhead.mak.orig 2011-07-27 17:06:17.749456100 +0800 ++++ ghostscript-9.02/base/unixhead.mak 2011-07-27 17:06:37.449456100 +0800 +@@ -54,7 +54,7 @@
Quoted 9 lines
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch line 14
Quoted 5 lines
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +5
-0+ + # Define generic commands. + +-CP_=cp ++CP_=cp -fIt means it will first delete the target if it exists. Did you check if this is correct behavior ?
Khem,
As far as I know the file is that is being copied to is the same file and the CP is only used in that case, the 2 files are copied to the same location due to the Parallel make.
Sau!
Quoted 55 lines · Saul Wold
Quoted 45 lines · Khem Raj
Quoted 44 lines · Kang Kai
From: Kang Kai<[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue.
Add patch to fix it.Fixes [Yocto #1202]
Signed-off-by Kang Kai<[email protected]>--- .../ghostscript-9.02-parallel-make.patch | 17 +++++++++++++++++ .../ghostscript/ghostscript_9.02.bb | 3 ++- 2 files changed, 19 insertions(+), 1 deletions(-)create mode 100644
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m
ake.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m
ake.patch new file mode 100644
index 0000000..76d1676
---/dev/null
+++
b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch @@ -0,0 +1,17 @@
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +7
-0+When parallel make it will fail with multi copy, see +http://bugzilla.pokylinux.org/show_bug.cgi?id=1202 + +Upstream-Status: Pending + +Signed-off-by: Kang Kai<[email protected]> +--- ghostscript-9.02/base/unixhead.mak.orig 2011-07-2717:06:17.749456100
+0800 ++++ ghostscript-9.02/base/unixhead.mak 2011-07-27
17:06:37.449456100
+0800 +@@ -54,7 +54,7 @@
+Quoted 9 lines
Quoted 4 lines
+ # Define generic commands.
+
+-CP_=cp
++CP_=cp -fIt means it will first delete the target if it exists. Did you check if this
is correct behavior ?
Quoted 5 lines
Khem,
As far as I know the file is that is being copied to is the same file and the CP is only used in that case, the 2 files are copied to the same location due to the Parallel make.
Er, that sounds like we're just changing the race around. Now we could get an incomplete file?
Signature · 2 lines
Tom Rini Mentor Graphics Corporation
Quoted 56 lines · Tom Rini
Quoted 55 lines · Saul Wold
Quoted 54 lines · Khem Raj
Quoted 43 lines · Kang Kai
From: Kang Kai<[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue.
Add patch to fix it.Fixes [Yocto #1202]
Signed-off-by Kang Kai<[email protected]>--- .../ghostscript-9.02-parallel-make.patch | 17 +++++++++++++++++ .../ghostscript/ghostscript_9.02.bb | 3 ++- 2 files changed, 19 insertions(+), 1 deletions(-)create mode 100644
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m
ake.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m
ake.patch new file mode 100644
index 0000000..76d1676
---/dev/null
+++
b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch @@ -0,0 +1,17 @@
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +7
-0+When parallel make it will fail with multi copy, see +http://bugzilla.pokylinux.org/show_bug.cgi?id=1202 + +Upstream-Status: Pending + +Signed-off-by: Kang Kai<[email protected]> +--- ghostscript-9.02/base/unixhead.mak.orig 2011-07-2717:06:17.749456100
+0800 ++++ ghostscript-9.02/base/unixhead.mak 2011-07-27
17:06:37.449456100
+0800 +@@ -54,7 +54,7 @@meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch line 14
Quoted 5 lines
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +5
-0+ + # Define generic commands. + +-CP_=cp ++CP_=cp -fIt means it will first delete the target if it exists. Did you check if this
is correct behavior ?
Quoted 8 lines
Quoted 5 lines
Khem,
As far as I know the file is that is being copied to is the same file and the CP is only used in that case, the 2 files are copied to the same location due to the Parallel make.
Er, that sounds like we're just changing the race around. Now we could get an incomplete file?
I don't think you would get an incomplete file, but using "cp -f" just makes the race less likely rather than eliminating it. You can still get:
cp 1 cp 2
open(foo) = -EACCESS
unlink(foo)
open(foo) = 0 open(foo) = -EACCESS exit(1) write() exit(0)
if the two copies of cp end up running at the same time.
It seems pretty clear that the right fix is to figure out why this race is happening in the first place and adjust the make rules to avoid it, rather than trying to paper over it by making the conflict harmless. If that's hard/impossible for any reason then "cp -n" might possibly be acceptable since then the copy of cp that loses the race will just do nothing harmlessly. I don't think -n is POSIX though so this is definitely a less-good workaround.
p.
Quoted 57 lines · Saul Wold
Quoted 47 lines · Khem Raj
Quoted 45 lines · Kang Kai
From: Kang Kai<[email protected]>
ghostscript fails some time on autobuilder, it seems a parallel build issue.
Add patch to fix it.Fixes [Yocto #1202]
Signed-off-by Kang Kai<[email protected]>---
.../ghostscript-9.02-parallel-make.patch | 17
+++++++++++++++++
.../ghostscript/ghostscript_9.02.bb | 3 ++-2 files changed, 19 insertions(+), 1 deletions(-)create mode 100644
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-mak e.patch
diff --git
a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch
b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch new file mode 100644
index 0000000..76d1676
---/dev/null
+++b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-m ake.patch @@ -0,0 +1,17 @@
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-parallel-make.patch new file +7
-0+When parallel make it will fail with multi copy, see +http://bugzilla.pokylinux.org/show_bug.cgi?id=1202 + +Upstream-Status: Pending + +Signed-off-by: Kang Kai<[email protected]> +--- ghostscript-9.02/base/unixhead.mak.orig 2011-07-2717:06:17.749456100
+0800 ++++ ghostscript-9.02/base/unixhead.mak 2011-07-27 17:06:37.449456100
+0800 +@@ -54,7 +54,7 @@
+Quoted 9 lines
Quoted 4 lines
+ # Define generic commands.
+
+-CP_=cp
++CP_=cp -fIt means it will first delete the target if it exists. Did you check if this
is correct behavior ?
Quoted 5 lines
Khem,
As far as I know the file is that is being copied to is the same file and the CP is only used in that case, the 2 files are copied to the same location due to the Parallel make.
if thats the case then probably checking for existence of file before copying it over
might be one approach