summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-31 13:27:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-18 10:15:32 +0000
commit451363438d38bd4552d5bcec4a92332f5819a5d4 (patch)
tree68fe42e2dfe5d3cd1fe8996b775bfc89cf8909f2
parent0ffff2c1f80a9b79b133d787764bab164d9abd70 (diff)
downloadopenembedded-core-contrib-451363438d38bd4552d5bcec4a92332f5819a5d4.tar.gz
classes/recipes: Switch to use inherit_defer
Now that bitbake supports the use of inherit_defer, switch all conditional (variable based) inherits to use this instead. This leads to more a more deterministic user experience since there is no longer an immediate expansion and later changes to the variables in question (e.g. a bbappend) are accounted for. This patch tries to ensure the behaviour before/after remains as unchanged as it reasonably can, e.g. by always inherting populate_sdk_base. native and nativesdk continue to need to be inherited last, hence being used with inherit_defer in a handful of very specific cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb2
-rw-r--r--meta/classes-recipe/baremetal-image.bbclass2
-rw-r--r--meta/classes-recipe/gnomebase.bbclass3
-rw-r--r--meta/classes-recipe/image.bbclass5
-rw-r--r--meta/classes-recipe/image_types_wic.bbclass2
-rw-r--r--meta/classes-recipe/kernel.bbclass2
-rw-r--r--meta/classes-recipe/live-vm-common.bbclass4
-rw-r--r--meta/classes-recipe/packagegroup.bbclass2
-rw-r--r--meta/classes-recipe/populate_sdk_base.bbclass2
-rw-r--r--meta/classes/useradd.bbclass2
-rw-r--r--meta/recipes-core/libxml/libxml2_2.11.5.bb2
-rw-r--r--meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb3
-rw-r--r--meta/recipes-devtools/btrfs-tools/btrfs-tools_6.5.3.bb2
-rw-r--r--meta/recipes-graphics/xorg-driver/xorg-driver-common.inc3
-rw-r--r--meta/recipes-kernel/perf/perf.bb2
-rw-r--r--meta/recipes-kernel/systemtap/systemtap-native_git.bb2
-rw-r--r--meta/recipes-kernel/systemtap/systemtap_git.bb2
-rw-r--r--meta/recipes-support/gpgme/gpgme_1.23.2.bb3
18 files changed, 25 insertions, 20 deletions
diff --git a/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb b/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb
index 50cba9514b..88c8998cf9 100644
--- a/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb
+++ b/meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb
@@ -5,7 +5,7 @@ LICENSE = "MIT"
INHIBIT_DEFAULT_DEPS = "1"
EXCLUDE_FROM_WORLD = "1"
-inherit ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)}
+inherit_defer ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)}
include test_recipe.inc
OVERLAYFS_WRITABLE_PATHS[mnt-overlay] += "/usr/share/my-application"
diff --git a/meta/classes-recipe/baremetal-image.bbclass b/meta/classes-recipe/baremetal-image.bbclass
index 70791f999a..b9a584351a 100644
--- a/meta/classes-recipe/baremetal-image.bbclass
+++ b/meta/classes-recipe/baremetal-image.bbclass
@@ -110,7 +110,7 @@ CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
# Handle inherits of any of the image classes we need
IMAGE_CLASSES ??= ""
IMGCLASSES = " ${IMAGE_CLASSES}"
-inherit ${IMGCLASSES}
+inherit_defer ${IMGCLASSES}
# Set defaults to satisfy IMAGE_FEATURES check
IMAGE_FEATURES ?= ""
IMAGE_FEATURES[type] = "list"
diff --git a/meta/classes-recipe/gnomebase.bbclass b/meta/classes-recipe/gnomebase.bbclass
index a12e9f31a9..74073321b8 100644
--- a/meta/classes-recipe/gnomebase.bbclass
+++ b/meta/classes-recipe/gnomebase.bbclass
@@ -28,7 +28,8 @@ FILES:${PN} += "${datadir}/application-registry \
FILES:${PN}-doc += "${datadir}/devhelp"
GNOMEBASEBUILDCLASS ??= "meson"
-inherit ${GNOMEBASEBUILDCLASS} pkgconfig
+inherit pkgconfig
+inherit_defer ${GNOMEBASEBUILDCLASS}
do_install:append() {
rm -rf ${D}${localstatedir}/lib/scrollkeeper/*
diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 6bdddc0134..28be6c6362 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -14,14 +14,15 @@ ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts"
IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
# in the non-Linux SDK_OS case, such as mingw32
-IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
+inherit populate_sdk_base
+IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
IMGCLASSES += "image_types_wic"
IMGCLASSES += "rootfs-postcommands"
IMGCLASSES += "image-postinst-intercepts"
IMGCLASSES += "overlayfs-etc"
-inherit ${IMGCLASSES}
+inherit_defer ${IMGCLASSES}
TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass
index 669606da75..00620fdc9d 100644
--- a/meta/classes-recipe/image_types_wic.bbclass
+++ b/meta/classes-recipe/image_types_wic.bbclass
@@ -38,7 +38,7 @@ WICVARS ?= "\
TARGET_SYS \
"
-inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
+inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 9ff37f5c38..a76aaee5ba 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -171,7 +171,7 @@ set -e
# image types.
KERNEL_CLASSES ?= " kernel-uimage "
-inherit ${KERNEL_CLASSES}
+inherit_defer ${KERNEL_CLASSES}
# Old style kernels may set ${S} = ${WORKDIR}/git for example
# We need to move these over to STAGING_KERNEL_DIR. We can't just
diff --git a/meta/classes-recipe/live-vm-common.bbclass b/meta/classes-recipe/live-vm-common.bbclass
index b619f3a4be..d90cc67ebc 100644
--- a/meta/classes-recipe/live-vm-common.bbclass
+++ b/meta/classes-recipe/live-vm-common.bbclass
@@ -68,8 +68,8 @@ efi_hddimg_populate() {
efi_populate $1
}
-inherit ${EFI_CLASS}
-inherit ${PCBIOS_CLASS}
+inherit_defer ${EFI_CLASS}
+inherit_defer ${PCBIOS_CLASS}
populate_kernel() {
dest=$1
diff --git a/meta/classes-recipe/packagegroup.bbclass b/meta/classes-recipe/packagegroup.bbclass
index c2db664904..cf6fc354a8 100644
--- a/meta/classes-recipe/packagegroup.bbclass
+++ b/meta/classes-recipe/packagegroup.bbclass
@@ -22,7 +22,7 @@ PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
LICENSE ?= "MIT"
-inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
+inherit_defer ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
# This automatically adds -dbg and -dev flavours of all PACKAGES
# to the list. Their dependencies (RRECOMMENDS) are handled as usual
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index 8fadfef942..81896d808f 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -37,7 +37,7 @@ SDK_PACKAGE_ARCHS += "sdk-provides-dummy-${SDKPKGSUFFIX}"
# List of locales to install, or "all" for all of them, or unset for none.
SDKIMAGE_LINGUAS ?= "all"
-inherit rootfs_${IMAGE_PKGTYPE}
+inherit_defer rootfs_${IMAGE_PKGTYPE}
SDK_DIR = "${WORKDIR}/sdk"
SDK_OUTPUT = "${SDK_DIR}/image"
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 0997b3da7a..cb809b5dd7 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -268,4 +268,4 @@ fakeroot python populate_packages:prepend () {
# Use the following to extend the useradd with custom functions
USERADDEXTENSION ?= ""
-inherit ${USERADDEXTENSION}
+inherit_defer ${USERADDEXTENSION}
diff --git a/meta/recipes-core/libxml/libxml2_2.11.5.bb b/meta/recipes-core/libxml/libxml2_2.11.5.bb
index 319833f053..44336c25e1 100644
--- a/meta/recipes-core/libxml/libxml2_2.11.5.bb
+++ b/meta/recipes-core/libxml/libxml2_2.11.5.bb
@@ -35,7 +35,7 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
inherit autotools pkgconfig binconfig-disabled ptest
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
+inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
LDFLAGS:append:riscv64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd', '', d)}"
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 11e31dcba3..c1d3c25060 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -4,7 +4,8 @@
SUMMARY = "Host packages for the standalone SDK or external toolchain"
-inherit packagegroup nativesdk
+inherit packagegroup
+inherit_defer nativesdk
PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.5.3.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.5.3.bb
index 873d5e7a14..6455efd1bc 100644
--- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.5.3.bb
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.5.3.bb
@@ -43,7 +43,7 @@ PACKAGECONFIG[crypto-libsodium] = "--with-crypto=libsodium,,libsodium"
PACKAGECONFIG[crypto-libkcapi] = "--with-crypto=libkcapi,,libkcapi"
inherit autotools-brokensep pkgconfig manpages
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)}
+inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)}
CLEANBROKEN = "1"
diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
index 8b3f19426b..c61cdd05b3 100644
--- a/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
+++ b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
@@ -13,8 +13,9 @@ SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}${XORG_DRIVER_COMPRESSOR
FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so"
+inherit pkgconfig features_check
XORGBUILDCLASS ??= "autotools"
-inherit ${XORGBUILDCLASS} pkgconfig features_check
+inherit_defer ${XORGBUILDCLASS}
# depends on virtual/xserver
REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 32882afdf4..4f26813de0 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -54,7 +54,7 @@ PROVIDES = "virtual/perf"
inherit linux-kernel-base kernel-arch manpages
# needed for building the tools/perf Python bindings
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
+inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
inherit python3-dir
export PYTHON_SITEPACKAGES_DIR
diff --git a/meta/recipes-kernel/systemtap/systemtap-native_git.bb b/meta/recipes-kernel/systemtap/systemtap-native_git.bb
index 19cc1cf0f0..2690b259c8 100644
--- a/meta/recipes-kernel/systemtap/systemtap-native_git.bb
+++ b/meta/recipes-kernel/systemtap/systemtap-native_git.bb
@@ -1,6 +1,6 @@
require systemtap_git.bb
-inherit native
+inherit_defer native
addtask addto_recipe_sysroot after do_populate_sysroot before do_build
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb
index 0a1349e128..68f5c76428 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.bb
+++ b/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -33,7 +33,7 @@ PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,
PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod"
inherit autotools gettext pkgconfig systemd
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)}
+inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)}
# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=]
CXXFLAGS += "-Wno-dangling-pointer"
diff --git a/meta/recipes-support/gpgme/gpgme_1.23.2.bb b/meta/recipes-support/gpgme/gpgme_1.23.2.bb
index b29c182f36..d8807b3af2 100644
--- a/meta/recipes-support/gpgme/gpgme_1.23.2.bb
+++ b/meta/recipes-support/gpgme/gpgme_1.23.2.bb
@@ -54,7 +54,8 @@ EXTRA_OECONF += '--enable-languages="${LANGUAGES}" \
--disable-g13-test \
'
-inherit autotools texinfo binconfig-disabled pkgconfig ${PYTHON_INHERIT} python3native multilib_header
+inherit autotools texinfo binconfig-disabled pkgconfig multilib_header
+inherit_defer ${PYTHON_INHERIT} python3native
export PKG_CONFIG='pkg-config'