Skip to contentSkip to conversation

cairo: Do not try to remove nonexistent directories

PATCH In review Peter Kjellerstedt 2 participants 2 messages Jun 2, 2020 – Jun 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cairo: Do not try to remove nonexistent directories

Commit 0e1f8fa0 (bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target) changed the default PACKAGECONFIG for native and nativesdk so that it becomes empty unless "x11" is in DISTRO_FEATURES since "trace" was also removed (propbably unintentionally). This highlighted than an empty PACKAGECONFIG would lead to a build failure since /usr/bin is never created under these conditions, but the recipe still tried to remove it.

---
 meta/recipes-graphics/cairo/cairo_1.16.0.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-graphics/cairo/cairo_1.16.0.bb +4 -2
index 092c77b826..195a66b37d 100644
@@ -70,8 +70,10 @@ do_install_append () {
 	rm -rf ${D}${libdir}/cairo/cairo-sphinx*
 	rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr*
 	rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
-	rmdir -p --ignore-fail-on-non-empty ${D}${bindir}
-	rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/cairo
+	[ ! -d ${D}${bindir} ] ||
+		rmdir -p --ignore-fail-on-non-empty ${D}${bindir}
+	[ ! -d ${D}${libdir}/cairo ] ||
+		rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/cairo
 }
 
 PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"
#1 lore raw
Quoted 8 lines · Peter Kjellerstedt

Commit 0e1f8fa0 (bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target) changed the default PACKAGECONFIG for native and nativesdk so that it becomes empty unless "x11" is in DISTRO_FEATURES since "trace" was also removed (propbably unintentionally). This highlighted than an empty PACKAGECONFIG would lead to a build failure since /usr/bin is never created under these conditions, but the recipe still tried to remove it.

looking at above commit, its doing
PACKAGECONFIG_class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d

there are cases where we build firmware's with and without x11 in distro
features, now we have another set of native and nativesdk packages to build. Scratch builds from release to release are getting longer and longer, using shared state hides the problem, but first build experience is quite not as good.

Quoted 26 lines
---
  meta/recipes-graphics/cairo/cairo_1.16.0.bb | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-graphics/cairo/cairo_1.16.0.bb +4 -2
index 092c77b826..195a66b37d 100644
@@ -70,8 +70,10 @@ do_install_append () {
  	rm -rf ${D}${libdir}/cairo/cairo-sphinx*
  	rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr*
  	rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
-	rmdir -p --ignore-fail-on-non-empty ${D}${bindir}
-	rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/cairo
+	[ ! -d ${D}${bindir} ] ||
+		rmdir -p --ignore-fail-on-non-empty ${D}${bindir}
+	[ ! -d ${D}${libdir}/cairo ] ||
+		rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/cairo
  }
 
  PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"