diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-31 13:27:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-18 10:15:58 +0000 |
commit | c917323a39da6fc3e8d92b2fe907d0357149c9bb (patch) | |
tree | 254fd4963f6a7c0f65f5cc9aa1834158fc94b457 | |
parent | bc883e49912b8d0cdc9ea403e85f2cb3198b48ff (diff) | |
download | poky-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>
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" | |||
5 | INHIBIT_DEFAULT_DEPS = "1" | 5 | INHIBIT_DEFAULT_DEPS = "1" |
6 | EXCLUDE_FROM_WORLD = "1" | 6 | EXCLUDE_FROM_WORLD = "1" |
7 | 7 | ||
8 | inherit ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)} | 8 | inherit_defer ${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs", "", d)} |
9 | include test_recipe.inc | 9 | include test_recipe.inc |
10 | 10 | ||
11 | OVERLAYFS_WRITABLE_PATHS[mnt-overlay] += "/usr/share/my-application" | 11 | 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" | |||
110 | # Handle inherits of any of the image classes we need | 110 | # Handle inherits of any of the image classes we need |
111 | IMAGE_CLASSES ??= "" | 111 | IMAGE_CLASSES ??= "" |
112 | IMGCLASSES = " ${IMAGE_CLASSES}" | 112 | IMGCLASSES = " ${IMAGE_CLASSES}" |
113 | inherit ${IMGCLASSES} | 113 | inherit_defer ${IMGCLASSES} |
114 | # Set defaults to satisfy IMAGE_FEATURES check | 114 | # Set defaults to satisfy IMAGE_FEATURES check |
115 | IMAGE_FEATURES ?= "" | 115 | IMAGE_FEATURES ?= "" |
116 | IMAGE_FEATURES[type] = "list" | 116 | 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 \ | |||
28 | FILES:${PN}-doc += "${datadir}/devhelp" | 28 | FILES:${PN}-doc += "${datadir}/devhelp" |
29 | 29 | ||
30 | GNOMEBASEBUILDCLASS ??= "meson" | 30 | GNOMEBASEBUILDCLASS ??= "meson" |
31 | inherit ${GNOMEBASEBUILDCLASS} pkgconfig | 31 | inherit pkgconfig |
32 | inherit_defer ${GNOMEBASEBUILDCLASS} | ||
32 | 33 | ||
33 | do_install:append() { | 34 | do_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" | |||
14 | IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" | 14 | IMGCLASSES = "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 |
17 | IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" | 17 | inherit populate_sdk_base |
18 | IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" | ||
18 | IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" | 19 | IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" |
19 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" | 20 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" |
20 | IMGCLASSES += "image_types_wic" | 21 | IMGCLASSES += "image_types_wic" |
21 | IMGCLASSES += "rootfs-postcommands" | 22 | IMGCLASSES += "rootfs-postcommands" |
22 | IMGCLASSES += "image-postinst-intercepts" | 23 | IMGCLASSES += "image-postinst-intercepts" |
23 | IMGCLASSES += "overlayfs-etc" | 24 | IMGCLASSES += "overlayfs-etc" |
24 | inherit ${IMGCLASSES} | 25 | inherit_defer ${IMGCLASSES} |
25 | 26 | ||
26 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" | 27 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" |
27 | TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" | 28 | 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 ?= "\ | |||
38 | TARGET_SYS \ | 38 | TARGET_SYS \ |
39 | " | 39 | " |
40 | 40 | ||
41 | inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)} | 41 | inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)} |
42 | 42 | ||
43 | WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" | 43 | WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" |
44 | WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks" | 44 | 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 | |||
171 | # image types. | 171 | # image types. |
172 | 172 | ||
173 | KERNEL_CLASSES ?= " kernel-uimage " | 173 | KERNEL_CLASSES ?= " kernel-uimage " |
174 | inherit ${KERNEL_CLASSES} | 174 | inherit_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 | ||
71 | inherit ${EFI_CLASS} | 71 | inherit_defer ${EFI_CLASS} |
72 | inherit ${PCBIOS_CLASS} | 72 | inherit_defer ${PCBIOS_CLASS} |
73 | 73 | ||
74 | populate_kernel() { | 74 | populate_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 | ||
23 | LICENSE ?= "MIT" | 23 | LICENSE ?= "MIT" |
24 | 24 | ||
25 | inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')} | 25 | inherit_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. |
38 | SDKIMAGE_LINGUAS ?= "all" | 38 | SDKIMAGE_LINGUAS ?= "all" |
39 | 39 | ||
40 | inherit rootfs_${IMAGE_PKGTYPE} | 40 | inherit_defer rootfs_${IMAGE_PKGTYPE} |
41 | 41 | ||
42 | SDK_DIR = "${WORKDIR}/sdk" | 42 | SDK_DIR = "${WORKDIR}/sdk" |
43 | SDK_OUTPUT = "${SDK_DIR}/image" | 43 | 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 () { | |||
268 | # Use the following to extend the useradd with custom functions | 268 | # Use the following to extend the useradd with custom functions |
269 | USERADDEXTENSION ?= "" | 269 | USERADDEXTENSION ?= "" |
270 | 270 | ||
271 | inherit ${USERADDEXTENSION} | 271 | 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," | |||
35 | 35 | ||
36 | inherit autotools pkgconfig binconfig-disabled ptest | 36 | inherit autotools pkgconfig binconfig-disabled ptest |
37 | 37 | ||
38 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} | 38 | inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} |
39 | 39 | ||
40 | LDFLAGS:append:riscv64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd', '', d)}" | 40 | LDFLAGS: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 | ||
5 | SUMMARY = "Host packages for the standalone SDK or external toolchain" | 5 | SUMMARY = "Host packages for the standalone SDK or external toolchain" |
6 | 6 | ||
7 | inherit packagegroup nativesdk | 7 | inherit packagegroup |
8 | inherit_defer nativesdk | ||
8 | 9 | ||
9 | PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" | 10 | PACKAGEGROUP_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" | |||
43 | PACKAGECONFIG[crypto-libkcapi] = "--with-crypto=libkcapi,,libkcapi" | 43 | PACKAGECONFIG[crypto-libkcapi] = "--with-crypto=libkcapi,,libkcapi" |
44 | 44 | ||
45 | inherit autotools-brokensep pkgconfig manpages | 45 | inherit autotools-brokensep pkgconfig manpages |
46 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)} | 46 | inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)} |
47 | 47 | ||
48 | CLEANBROKEN = "1" | 48 | CLEANBROKEN = "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 | ||
14 | FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so" | 14 | FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so" |
15 | 15 | ||
16 | inherit pkgconfig features_check | ||
16 | XORGBUILDCLASS ??= "autotools" | 17 | XORGBUILDCLASS ??= "autotools" |
17 | inherit ${XORGBUILDCLASS} pkgconfig features_check | 18 | inherit_defer ${XORGBUILDCLASS} |
18 | 19 | ||
19 | # depends on virtual/xserver | 20 | # depends on virtual/xserver |
20 | REQUIRED_DISTRO_FEATURES = "x11" | 21 | 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" | |||
54 | inherit linux-kernel-base kernel-arch manpages | 54 | inherit 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 |
57 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} | 57 | inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} |
58 | inherit python3-dir | 58 | inherit python3-dir |
59 | export PYTHON_SITEPACKAGES_DIR | 59 | export 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 | ||
2 | require systemtap_git.bb | 2 | require systemtap_git.bb |
3 | 3 | ||
4 | inherit native | 4 | inherit_defer native |
5 | 5 | ||
6 | addtask addto_recipe_sysroot after do_populate_sysroot before do_build | 6 | 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, | |||
33 | PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod" | 33 | PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod" |
34 | 34 | ||
35 | inherit autotools gettext pkgconfig systemd | 35 | inherit autotools gettext pkgconfig systemd |
36 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)} | 36 | inherit_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=] |
39 | CXXFLAGS += "-Wno-dangling-pointer" | 39 | 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}" \ | |||
54 | --disable-g13-test \ | 54 | --disable-g13-test \ |
55 | ' | 55 | ' |
56 | 56 | ||
57 | inherit autotools texinfo binconfig-disabled pkgconfig ${PYTHON_INHERIT} python3native multilib_header | 57 | inherit autotools texinfo binconfig-disabled pkgconfig multilib_header |
58 | inherit_defer ${PYTHON_INHERIT} python3native | ||
58 | 59 | ||
59 | export PKG_CONFIG='pkg-config' | 60 | export PKG_CONFIG='pkg-config' |
60 | 61 | ||