[oe-commits] [openembedded-core] 01/03: package: Add NOPACAGEDFILES variable and new QA check

git at git.openembedded.org git at git.openembedded.org
Tue Nov 19 23:12:47 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit f1afa5aa484ffa0f19bbdf658c602441e57d8f59
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Nov 19 16:34:21 2019 +0000

    package: Add NOPACAGEDFILES variable and new QA check
    
    Hash Equivalency has introduced a new mode of failure where do_package
    reruns with an empty ${D} and injects empty packages into sstate.
    
    We have no sanity checks for this currently and it causes silent corruption
    of sstate which is particularly nasty to debug.
    
    This patch adds a test in do_package that there are files to package. In
    general its unusual to have no files to package, the one bug exception being
    packagegroup recipes.
    
    The new code allows for a NOPACKAGEDFILES variable to be set to indicate
    that a recipe really doesn't have any files to be packaged.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta-selftest/recipes-test/postinst/postinst_1.0.bb              | 2 ++
 meta/classes/package.bbclass                                     | 3 +++
 meta/classes/packagegroup.bbclass                                | 2 ++
 meta/recipes-connectivity/connman/connman-conf.bb                | 2 ++
 meta/recipes-core/meta/dummy-sdk-package.inc                     | 2 ++
 meta/recipes-core/meta/meta-extsdk-toolchain.bb                  | 2 ++
 meta/recipes-core/systemd/systemd-compat-units.bb                | 1 +
 meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb | 2 ++
 meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb    | 2 ++
 meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb     | 2 ++
 10 files changed, 20 insertions(+)

diff --git a/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
index 913bfab..da25751 100644
--- a/meta-selftest/recipes-test/postinst/postinst_1.0.bb
+++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -10,6 +10,8 @@ ALLOW_EMPTY_${PN}-delayed-a = "1"
 ALLOW_EMPTY_${PN}-delayed-b = "1"
 ALLOW_EMPTY_${PN}-rootfs-failing = "1"
 
+NOPACKAGEDFILES = "1"
+
 RDEPENDS_${PN}-delayed-a = "${PN}-rootfs"
 RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a"
 
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index e0d6ff6..8348d67 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -648,6 +648,9 @@ python perform_packagecopy () {
     dest = d.getVar('D')
     dvar = d.getVar('PKGD')
 
+    if not len(os.listdir(dest) )and not d.getVar("NOPACKAGEDFILES"):
+        bb.warn("Recipe %s has no installed files, nothing to package? Set NOPACKAGEDFILES if this is correct to avoid this warning." % d.getVar("PN"))
+
     # Start by package population by taking a copy of the installed
     # files to operate on
     # Preserve sparse files and hard links
diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
index 1541c8f..82dd40d 100644
--- a/meta/classes/packagegroup.bbclass
+++ b/meta/classes/packagegroup.bbclass
@@ -18,6 +18,8 @@ LICENSE ?= "MIT"
 
 inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
 
+NOPACKAGEDFILES = "1"
+
 # This automatically adds -dbg and -dev flavours of all PACKAGES
 # to the list. Their dependencies (RRECOMMENDS) are handled as usual
 # by package_depchains in a following step.
diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index 9a519ec..68a32aa 100644
--- a/meta/recipes-connectivity/connman/connman-conf.bb
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -18,6 +18,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 FILES_${PN} = "${localstatedir}/* ${datadir}/*"
 
+NOPACKAGEDFILES = "1"
+
 do_install() {
     #Configure Wired network interface in case of qemu* machines
     if test -e ${WORKDIR}/wired.config &&
diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc
index 4d65370..ec081ca 100644
--- a/meta/recipes-core/meta/dummy-sdk-package.inc
+++ b/meta/recipes-core/meta/dummy-sdk-package.inc
@@ -17,6 +17,8 @@ ALLOW_EMPTY_${PN} = "1"
 
 PR[vardeps] += "DUMMYPROVIDES"
 
+NOPACKAGEDFILES = "1"
+
 python populate_packages_prepend() {
     p = d.getVar("PN")
     d.appendVar("RPROVIDES_%s" % p, "${DUMMYPROVIDES}")
diff --git a/meta/recipes-core/meta/meta-extsdk-toolchain.bb b/meta/recipes-core/meta/meta-extsdk-toolchain.bb
index 235d6ec..3fab7d3 100644
--- a/meta/recipes-core/meta/meta-extsdk-toolchain.bb
+++ b/meta/recipes-core/meta/meta-extsdk-toolchain.bb
@@ -4,6 +4,8 @@ LICENSE = "MIT"
 
 DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
 
+NOPACKAGEDFILES = "1"
+
 do_populate_sysroot[deptask] = "do_populate_sysroot"
 
 # NOTE: There is logic specific to this recipe in setscene_depvalid()
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
index faa428b..cd62cad 100644
--- a/meta/recipes-core/systemd/systemd-compat-units.bb
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -11,6 +11,7 @@ S = "${WORKDIR}"
 inherit features_check
 
 ALLOW_EMPTY_${PN} = "1"
+NOPACKAGEDFILES = "1"
 
 REQUIRED_DISTRO_FEATURES = "systemd"
 
diff --git a/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
index 65348c3..1689659 100644
--- a/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
+++ b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
@@ -18,3 +18,5 @@ do_install() {
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"
+
+NOPACKAGEDFILES = "1"
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
index 5420b7d..428ab0d 100644
--- a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
@@ -14,6 +14,8 @@ CONFFILES_${PN} = "${sysconfdir}/X11/xorg.conf"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 ALLOW_EMPTY_${PN} = "1"
 
+NOPACKAGEDFILES = "1"
+
 do_install () {
 	if test -s ${WORKDIR}/xorg.conf; then
 		install -d ${D}/${sysconfdir}/X11
diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
index 460e05a..fd6467d 100644
--- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
+++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
@@ -7,6 +7,8 @@ inherit pkgconfig
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
+NOPACKAGEDFILES = "1"
+
 S = "${WORKDIR}"
 
 do_configure[depends] += "virtual/kernel:do_shared_workdir openssl-native:do_populate_sysroot"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list