Skip to contentSkip to conversation

ostree: Fix DISTRO_FEATURES with ptest but w/o xattr

PATCH New Alex Kiernan 1 participant 5 messages Dec 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ostree: Fix DISTRO_FEATURES with ptest but w/o xattr

Fix the test for PTEST_ENABLED so it only fires when it's actually enabled, as opposed to everytime. This allows the tautological test for native to be removed as PTEST_ENABLED isn't set there.

---

 meta-oe/recipes-extended/ostree/ostree_2019.5.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/ostree/ostree_2019.5.bb +2 -2
index b3b34a15e694..b2bfaaf0514b 100644
@@ -182,8 +182,8 @@ SYSTEMD_SERVICE_${PN}-switchroot = "ostree-prepare-root.service"
 BBCLASSEXTEND = "native"
 
 python __anonymous() {
-    if not bb.data.inherits_class('native', d) and bb.utils.contains('PTEST_ENABLED', '1', 'True', 'False', d):
-        if not bb.utils.contains_any('BBFILE_COLLECTIONS', 'meta-python', 'True', 'False', d):
+    if bb.utils.contains('PTEST_ENABLED', '1', 'True', '', d):
+        if not bb.utils.contains_any('BBFILE_COLLECTIONS', 'meta-python', 'True', '', d):
             raise bb.parse.SkipRecipe('ptest requires meta-python to be present.')
         elif not bb.utils.contains_any('PACKAGECONFIG', 'soup curl', 'True', 'False', d):
             raise bb.parse.SkipRecipe('ptest requires soup enabled in PACKAGECONFIG.')
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/5 ostree: Drop tests for soup/xattr with ptest

When ptest is enabled, both soup (for trivial-httpd) and xattr must be enabled for all tests to pass. Rather than forcing everyone to enable these, just document this and remove the tests since a subset of the tests are still useful.

---

 meta-oe/recipes-extended/ostree/ostree_2019.5.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-extended/ostree/ostree_2019.5.bb +2 -4
index b2bfaaf0514b..ac1e49048098 100644
@@ -42,6 +42,8 @@ inherit autotools bash-completion gobject-introspection gtk-doc pkgconfig ptest-
 
 # Package configuration - match ostree defaults, but without rofiles-fuse
 # otherwise we introduce a dependendency on meta-filesystems
+#
+# If running with ptest, both soup (for trivial-httpd) and xattr are required
 PACKAGECONFIG ??= " \
     ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd libmount', '', d)} \
@@ -185,8 +187,4 @@ python __anonymous() {
     if bb.utils.contains('PTEST_ENABLED', '1', 'True', '', d):
         if not bb.utils.contains_any('BBFILE_COLLECTIONS', 'meta-python', 'True', '', d):
             raise bb.parse.SkipRecipe('ptest requires meta-python to be present.')
-        elif not bb.utils.contains_any('PACKAGECONFIG', 'soup curl', 'True', 'False', d):
-            raise bb.parse.SkipRecipe('ptest requires soup enabled in PACKAGECONFIG.')
-        elif not oe.utils.any_distro_features(d, "xattr"):
-            raise bb.parse.SkipRecipe('ptest requires xattr enabled in DISTRO_FEATURES.')
 }
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/5 ostree: Change PACKAGECONFIG to use manpages

In reply to Alex Kiernan

Change PACKAGECONFIG to use manpages and inherit same so we build mandb correctly when api-documentation is enabled.

---

 meta-oe/recipes-extended/ostree/ostree_2019.5.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/ostree/ostree_2019.5.bb +2 -2
index ac1e49048098..efbbeb6a500d 100644
@@ -38,7 +38,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)"
 
 S = "${WORKDIR}/git"
 
-inherit autotools bash-completion gobject-introspection gtk-doc pkgconfig ptest-gnome systemd
+inherit autotools bash-completion gobject-introspection gtk-doc manpages pkgconfig ptest-gnome systemd
 
 # Package configuration - match ostree defaults, but without rofiles-fuse
 # otherwise we introduce a dependendency on meta-filesystems
@@ -63,7 +63,7 @@ PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
 PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls"
 PACKAGECONFIG[libarchive] = "--with-libarchive, --without-libarchive, libarchive"
 PACKAGECONFIG[libmount] = "--with-libmount, --without-libmount, util-linux"
-PACKAGECONFIG[man] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[manpages] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
 PACKAGECONFIG[mkinitcpio] = "--with-mkinitcpio, --without-mkinitcpio"
 PACKAGECONFIG[no-http2] = "--disable-http2, --enable-http2"
 PACKAGECONFIG[openssl] = "--with-crypto=openssl, , openssl"
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/5 ostree: Add PACKAGECONFIG for builtin-grub2-mkconfig

In reply to Alex Kiernan

---

 meta-oe/recipes-extended/ostree/ostree_2019.5.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-oe/recipes-extended/ostree/ostree_2019.5.bb +3 -1
index efbbeb6a500d..7c1ed9c6b7a2 100644
@@ -54,10 +54,12 @@ PACKAGECONFIG ??= " \
 # soup or curl - https://github.com/ostreedev/ostree/issues/1897
 PACKAGECONFIG_class-native ??= " \
     ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
+    builtin-grub2-mkconfig \
     soup \
 "
 
 PACKAGECONFIG[avahi] = "--with-avahi, --without-avahi, avahi"
+PACKAGECONFIG[builtin-grub2-mkconfig] = "--with-builtin-grub2-mkconfig, --without-builtin-grub2-mkconfig"
 PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl"
 PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
 PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls"
@@ -86,7 +88,6 @@ EXTRA_OEMAKE = " \
 "
 
 EXTRA_OECONF_class-native = " \
-    --with-builtin-grub2-mkconfig \
     --enable-wrpseudo-compat \
     --disable-otmpfile \
 "
@@ -124,6 +125,7 @@ FILES_${PN} = " \
     ${libdir}/${BPN}/ostree-remount \
     ${libdir}/girepository-1.0 \
     ${libdir}/lib*${SOLIBS} \
+    ${libdir}/ostree/ostree-grub-generator \
     ${libdir}/tmpfiles.d/ostree-tmpfiles.conf \
     ${sysconfdir}/ostree/remotes.d \
     ${systemd_unitdir}/system-generators/ostree-system-generator \
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/5 ostree: Backport build/test fixes from upstream

In reply to Alex Kiernan

Pick upstream fixes:

77b27c07df2b Avoid race condition when building outside of source tree 16bb294384bb tests/repo-finder: Run realpath() on /tmp de8e0765a4a5 Makefile: declare ostree_boot_SCRIPTS and append values

---

 ...tion-when-building-outside-of-source.patch | 33 ++++++++++
 ...-ostree_boot_SCRIPTS-and-append-valu.patch | 60 +++++++++++++++++++
 ...ests-repo-finder-Run-realpath-on-tmp.patch | 44 ++++++++++++++
 .../recipes-extended/ostree/ostree_2019.5.bb  |  3 +
 4 files changed, 140 insertions(+)
 create mode 100644 meta-oe/recipes-extended/ostree/ostree/0001-Avoid-race-condition-when-building-outside-of-source.patch
 create mode 100644 meta-oe/recipes-extended/ostree/ostree/0001-Makefile-declare-ostree_boot_SCRIPTS-and-append-valu.patch
 create mode 100644 meta-oe/recipes-extended/ostree/ostree/0001-tests-repo-finder-Run-realpath-on-tmp.patch
meta-oe/recipes-extended/ostree/ostree/0001-Avoid-race-condition-when-building-outside-of-source.patch new file +33 -0
new file mode 100644
index 000000000000..c926965de560
@@ -0,0 +1,33 @@
+From 77b27c07df2bdff86945766a4728b6012062535c Mon Sep 17 00:00:00 2001
+From: Stefan Agner <[email protected]>
+Date: Tue, 26 Nov 2019 09:20:30 +0100
+Subject: [PATCH] Avoid race condition when building outside of source tree
+
+When building outside of source tree it can happen that src/ostree/
+does not exist (yet) when bison is called. This leads to an build
+error like so:
+  bison: src/ostree/parse-datetime.c: cannot open: No such file or directory
+
+Make sure that src/ostree/ exists when parse-datetime.c is built.
+
+Signed-off-by: Alex Kiernan <[email protected]>
+Upstream-Status: Backport
+---
+ Makefile-ostree.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile-ostree.am b/Makefile-ostree.am
+index 76f39cad4b74..f861afe42168 100644
+--- a/Makefile-ostree.am
++++ b/Makefile-ostree.am
+@@ -123,6 +123,7 @@ ostree_SOURCES += src/ostree/ot-remote-builtin-add-cookie.c \
+ endif
+ 
+ src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile
++	mkdir -p src/ostree/
+ 	$(AM_V_GEN) $(YACC) $< -o $@
+ 
+ EXTRA_DIST += src/ostree/parse-datetime.y
+-- 
+2.17.1
+
meta-oe/recipes-extended/ostree/ostree/0001-Makefile-declare-ostree_boot_SCRIPTS-and-append-valu.patch new file +60 -0

60 lines not on this page · raw message

meta-oe/recipes-extended/ostree/ostree/0001-tests-repo-finder-Run-realpath-on-tmp.patch new file +44 -0

44 lines not on this page · raw message

meta-oe/recipes-extended/ostree/ostree_2019.5.bb +3 -0
index 7c1ed9c6b7a2..4f437f348025 100644
@@ -31,6 +31,9 @@ SRC_URI = " \
     file://0002-tests-core-Assume-C.UTF-8-if-locale-isn-t-found.patch \
     file://0003-tests-Avoid-musl-failure-with-cp-a.patch \
     file://0001-build-create-tests-directory-for-split-builds.patch \
+    file://0001-Makefile-declare-ostree_boot_SCRIPTS-and-append-valu.patch \
+    file://0001-Avoid-race-condition-when-building-outside-of-source.patch \
+    file://0001-tests-repo-finder-Run-realpath-on-tmp.patch \
 "
 SRCREV = "980ca07b03b3aa7e0012729dd6c84b0878775d93"
 
Signature · 1 line
2.17.1