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:58 +0000
commitc917323a39da6fc3e8d92b2fe907d0357149c9bb (patch)
tree254fd4963f6a7c0f65f5cc9aa1834158fc94b457
parentbc883e49912b8d0cdc9ea403e85f2cb3198b48ff (diff)
downloadpoky-c917323a39da6fc3e8d92b2fe907d0357149c9bb.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. (From OE-Core rev: 451363438d38bd4552d5bcec4a92332f5819a5d4) 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"
5INHIBIT_DEFAULT_DEPS = "1" 5INHIBIT_DEFAULT_DEPS = "1"
6EXCLUDE_FROM_WORLD = "1" 6EXCLUDE_FROM_WORLD = "1"
7 7
8inherit ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)} 8inherit_defer ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)}
9include test_recipe.inc 9include test_recipe.inc
10 10
11OVERLAYFS_WRITABLE_PATHS[mnt-overlay] += "/usr/share/my-application" 11OVERLAYFS_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"
110# Handle inherits of any of the image classes we need 110# Handle inherits of any of the image classes we need
111IMAGE_CLASSES ??= "" 111IMAGE_CLASSES ??= ""
112IMGCLASSES = " ${IMAGE_CLASSES}" 112IMGCLASSES = " ${IMAGE_CLASSES}"
113inherit ${IMGCLASSES} 113inherit_defer ${IMGCLASSES}
114# Set defaults to satisfy IMAGE_FEATURES check 114# Set defaults to satisfy IMAGE_FEATURES check
115IMAGE_FEATURES ?= "" 115IMAGE_FEATURES ?= ""
116IMAGE_FEATURES[type] = "list" 116IMAGE_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 \
28FILES:${PN}-doc += "${datadir}/devhelp" 28FILES:${PN}-doc += "${datadir}/devhelp"
29 29
30GNOMEBASEBUILDCLASS ??= "meson" 30GNOMEBASEBUILDCLASS ??= "meson"
31inherit ${GNOMEBASEBUILDCLASS} pkgconfig 31inherit pkgconfig
32inherit_defer ${GNOMEBASEBUILDCLASS}
32 33
33do_install:append() { 34do_install:append() {
34 rm -rf ${D}${localstatedir}/lib/scrollkeeper/* 35 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"
14IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" 14IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
15# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base 15# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
16# in the non-Linux SDK_OS case, such as mingw32 16# in the non-Linux SDK_OS case, such as mingw32
17IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" 17inherit populate_sdk_base
18IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
18IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" 19IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
19IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" 20IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
20IMGCLASSES += "image_types_wic" 21IMGCLASSES += "image_types_wic"
21IMGCLASSES += "rootfs-postcommands" 22IMGCLASSES += "rootfs-postcommands"
22IMGCLASSES += "image-postinst-intercepts" 23IMGCLASSES += "image-postinst-intercepts"
23IMGCLASSES += "overlayfs-etc" 24IMGCLASSES += "overlayfs-etc"
24inherit ${IMGCLASSES} 25inherit_defer ${IMGCLASSES}
25 26
26TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" 27TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
27TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" 28TOOLCHAIN_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 ?= "\
38 TARGET_SYS \ 38 TARGET_SYS \
39" 39"
40 40
41inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)} 41inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
42 42
43WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" 43WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
44WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks" 44WKS_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
171# image types. 171# image types.
172 172
173KERNEL_CLASSES ?= " kernel-uimage " 173KERNEL_CLASSES ?= " kernel-uimage "
174inherit ${KERNEL_CLASSES} 174inherit_defer ${KERNEL_CLASSES}
175 175
176# Old style kernels may set ${S} = ${WORKDIR}/git for example 176# Old style kernels may set ${S} = ${WORKDIR}/git for example
177# We need to move these over to STAGING_KERNEL_DIR. We can't just 177# 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() {
68 efi_populate $1 68 efi_populate $1
69} 69}
70 70
71inherit ${EFI_CLASS} 71inherit_defer ${EFI_CLASS}
72inherit ${PCBIOS_CLASS} 72inherit_defer ${PCBIOS_CLASS}
73 73
74populate_kernel() { 74populate_kernel() {
75 dest=$1 75 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}"
22 22
23LICENSE ?= "MIT" 23LICENSE ?= "MIT"
24 24
25inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')} 25inherit_defer ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
26 26
27# This automatically adds -dbg and -dev flavours of all PACKAGES 27# This automatically adds -dbg and -dev flavours of all PACKAGES
28# to the list. Their dependencies (RRECOMMENDS) are handled as usual 28# 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}"
37# List of locales to install, or "all" for all of them, or unset for none. 37# List of locales to install, or "all" for all of them, or unset for none.
38SDKIMAGE_LINGUAS ?= "all" 38SDKIMAGE_LINGUAS ?= "all"
39 39
40inherit rootfs_${IMAGE_PKGTYPE} 40inherit_defer rootfs_${IMAGE_PKGTYPE}
41 41
42SDK_DIR = "${WORKDIR}/sdk" 42SDK_DIR = "${WORKDIR}/sdk"
43SDK_OUTPUT = "${SDK_DIR}/image" 43SDK_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 () {
268# Use the following to extend the useradd with custom functions 268# Use the following to extend the useradd with custom functions
269USERADDEXTENSION ?= "" 269USERADDEXTENSION ?= ""
270 270
271inherit ${USERADDEXTENSION} 271inherit_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,"
35 35
36inherit autotools pkgconfig binconfig-disabled ptest 36inherit autotools pkgconfig binconfig-disabled ptest
37 37
38inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} 38inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
39 39
40LDFLAGS:append:riscv64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd', '', d)}" 40LDFLAGS:append:riscv64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd', '', d)}"
41 41
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 @@
4 4
5SUMMARY = "Host packages for the standalone SDK or external toolchain" 5SUMMARY = "Host packages for the standalone SDK or external toolchain"
6 6
7inherit packagegroup nativesdk 7inherit packagegroup
8inherit_defer nativesdk
8 9
9PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" 10PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
10 11
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"
43PACKAGECONFIG[crypto-libkcapi] = "--with-crypto=libkcapi,,libkcapi" 43PACKAGECONFIG[crypto-libkcapi] = "--with-crypto=libkcapi,,libkcapi"
44 44
45inherit autotools-brokensep pkgconfig manpages 45inherit autotools-brokensep pkgconfig manpages
46inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)} 46inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)}
47 47
48CLEANBROKEN = "1" 48CLEANBROKEN = "1"
49 49
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
13 13
14FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so" 14FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so"
15 15
16inherit pkgconfig features_check
16XORGBUILDCLASS ??= "autotools" 17XORGBUILDCLASS ??= "autotools"
17inherit ${XORGBUILDCLASS} pkgconfig features_check 18inherit_defer ${XORGBUILDCLASS}
18 19
19# depends on virtual/xserver 20# depends on virtual/xserver
20REQUIRED_DISTRO_FEATURES = "x11" 21REQUIRED_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"
54inherit linux-kernel-base kernel-arch manpages 54inherit linux-kernel-base kernel-arch manpages
55 55
56# needed for building the tools/perf Python bindings 56# needed for building the tools/perf Python bindings
57inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} 57inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
58inherit python3-dir 58inherit python3-dir
59export PYTHON_SITEPACKAGES_DIR 59export PYTHON_SITEPACKAGES_DIR
60 60
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 @@
1 1
2require systemtap_git.bb 2require systemtap_git.bb
3 3
4inherit native 4inherit_defer native
5 5
6addtask addto_recipe_sysroot after do_populate_sysroot before do_build 6addtask 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,
33PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod" 33PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod"
34 34
35inherit autotools gettext pkgconfig systemd 35inherit autotools gettext pkgconfig systemd
36inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)} 36inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)}
37 37
38# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=] 38# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=]
39CXXFLAGS += "-Wno-dangling-pointer" 39CXXFLAGS += "-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}" \
54 --disable-g13-test \ 54 --disable-g13-test \
55' 55'
56 56
57inherit autotools texinfo binconfig-disabled pkgconfig ${PYTHON_INHERIT} python3native multilib_header 57inherit autotools texinfo binconfig-disabled pkgconfig multilib_header
58inherit_defer ${PYTHON_INHERIT} python3native
58 59
59export PKG_CONFIG='pkg-config' 60export PKG_CONFIG='pkg-config'
60 61