summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-03-02 14:06:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:13:17 -0800
commit6f6a2b5ff7ec23bd3782f0c3521f3576101cbc9d (patch)
treee026eff2a1ec6fd24fad1acf03b1d19ba516a912 /meta/recipes-graphics
parentba2eb6237497494e3ec0296485ded61b024c5ba7 (diff)
downloadopenembedded-core-6f6a2b5ff7ec23bd3782f0c3521f3576101cbc9d.tar.gz
xcb-proto: solve python cache collision
Because I didn't really want python3-native to be at the bottom of the entire X11 stack this recipe jumps through a small hoop to use the host Python to run some modules it installs into the sysroot. The Makefile compiles the Python module, which is good as the cache file is recorded in the sstate manifest so when the package is removed from the sysroot all of it is removed. However in an enviroment where the sstate is shared between multiple hosts it is possible that a different Python is used and this will generate a new cache when the code is executed, which is not recorded in the manifest. Eventually you'll end up with ownerless cache files in a sysroot which conflict with the same file coming from a sstate upgrade. Solve this with a SSTATE_INST_POSTRM which is ran when sstate is removed to ensure that there are no Python cache files left behind. [ YOCTO #11809 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r--meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
index 712ab6c59a..25a8373e0b 100644
--- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
@@ -34,3 +34,20 @@ RDEPENDS_${PN}-dev = ""
RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
BBCLASSEXTEND = "native nativesdk"
+
+# Need to do this dance because we're forcing the use of host Python above and
+# if xcb-proto is built with Py3.5 and then re-used from sstate on a host with
+# Py3.6 the second build will write new cache files into the sysroot which won't
+# be listed in the manifest so won't be deleted, resulting in an error on
+# rebuilds. Solve this by deleting the entire cache directory when this package
+# is removed from the sysroot.
+SSTATEPOSTINSTFUNCS += "xcb_sstate_postinst"
+xcb_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ cat <<EOF >${SSTATE_INST_POSTRM}
+#!/bin/sh
+rm -rf ${libdir}/xcb-proto/xcbgen/__pycache__
+EOF
+ fi
+}