From 0d837ffef503b8236fc27af270e2d5a1e686244e Mon Sep 17 00:00:00 2001 From: Daniel Rossier Date: Thu, 16 Jul 2026 15:41:25 +0200 Subject: [PATCH] build: inherit logging in base.bbclass; drop redundant per-recipe inherits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #298. do_attach_infrabase (like other base.bbclass shell tasks) uses bbwarn/bbfatal, but base.bbclass did not inherit logging. In recipes that don't inherit it themselves — the fetched trees qemu/avz/uboot — those helpers were undefined, so the attach guard's dirty branch exited 127 (command not found), turning a diagnostic into a silent hard failure. #298 worked around it with plain echo; the proper fix, matching upstream OE, is to inherit logging in base so the bb* shell helpers are available in every recipe. do_attach_infrabase then uses the idiomatic bbwarn/bbfatal again, and the now-redundant per-recipe 'inherit logging' lines are removed. --- build/meta-bsp/classes/bsp.bbclass | 1 - build/meta-bsp/recipes-bsp/capsule/bsp-capsules_1.0.0.bb | 1 - build/meta-bsp/recipes-bsp/linux/bsp-linux_1.0.bb | 1 - build/meta-bsp/recipes-bsp/so3/bsp-so3_1.0.0.bb | 1 - build/meta-filesystem/classes/filesystem.bbclass | 1 - build/meta-filesystem/classes/fs_verdin-imx8mp.bbclass | 1 - .../recipes-filesystem/generic/filesystem_1.0.0.bb | 1 - build/meta-linux/classes/linux.bbclass | 1 - .../recipes-rootfs/buildroot/buildroot_2024.11.bb | 1 - build/meta-uboot/recipes-uboot/uboot/uboot_2024.07.bb | 1 - build/meta-usr/classes/usr.bbclass | 1 - build/meta/classes/base.bbclass | 6 +++--- 12 files changed, 3 insertions(+), 14 deletions(-) diff --git a/build/meta-bsp/classes/bsp.bbclass b/build/meta-bsp/classes/bsp.bbclass index 83787bf9d7..be83128ca7 100644 --- a/build/meta-bsp/classes/bsp.bbclass +++ b/build/meta-bsp/classes/bsp.bbclass @@ -118,7 +118,6 @@ addtask do_render_its before do_itb # This is the uEnv.txt file related to U-boot depending on the BSP IB_UENV = "${FILE_DIRNAME}/files/uEnv_${IB_PLATFORM}.txt" -inherit logging inherit filesystem # Platform boot chain — produces the bootloader-side artefacts (flash0.img diff --git a/build/meta-bsp/recipes-bsp/capsule/bsp-capsules_1.0.0.bb b/build/meta-bsp/recipes-bsp/capsule/bsp-capsules_1.0.0.bb index 0998a75952..6617706dc6 100644 --- a/build/meta-bsp/recipes-bsp/capsule/bsp-capsules_1.0.0.bb +++ b/build/meta-bsp/recipes-bsp/capsule/bsp-capsules_1.0.0.bb @@ -11,7 +11,6 @@ PR = "r0" inherit filesystem inherit uboot -inherit logging inherit bsp # Capsules reuse the SO3 ITS templates (e.g. _capsule.its) diff --git a/build/meta-bsp/recipes-bsp/linux/bsp-linux_1.0.bb b/build/meta-bsp/recipes-bsp/linux/bsp-linux_1.0.bb index 9a0a8f9ea7..08c6d297d3 100644 --- a/build/meta-bsp/recipes-bsp/linux/bsp-linux_1.0.bb +++ b/build/meta-bsp/recipes-bsp/linux/bsp-linux_1.0.bb @@ -12,7 +12,6 @@ PR = "r0" inherit filesystem inherit linux -inherit logging inherit bsp inherit uboot inherit atf diff --git a/build/meta-bsp/recipes-bsp/so3/bsp-so3_1.0.0.bb b/build/meta-bsp/recipes-bsp/so3/bsp-so3_1.0.0.bb index ccee11f07b..4b42e7171c 100644 --- a/build/meta-bsp/recipes-bsp/so3/bsp-so3_1.0.0.bb +++ b/build/meta-bsp/recipes-bsp/so3/bsp-so3_1.0.0.bb @@ -12,7 +12,6 @@ PR = "r0" inherit filesystem inherit uboot -inherit logging inherit bsp # ITS templates live in the layer (rendered into IB_ITB_PATH by do_itb) diff --git a/build/meta-filesystem/classes/filesystem.bbclass b/build/meta-filesystem/classes/filesystem.bbclass index 019c9fb719..582c513f7c 100644 --- a/build/meta-filesystem/classes/filesystem.bbclass +++ b/build/meta-filesystem/classes/filesystem.bbclass @@ -24,7 +24,6 @@ # ################################################################### -inherit logging inherit utils inherit fs_${IB_PLATFORM} diff --git a/build/meta-filesystem/classes/fs_verdin-imx8mp.bbclass b/build/meta-filesystem/classes/fs_verdin-imx8mp.bbclass index 91a19a229a..80f274e9eb 100644 --- a/build/meta-filesystem/classes/fs_verdin-imx8mp.bbclass +++ b/build/meta-filesystem/classes/fs_verdin-imx8mp.bbclass @@ -7,7 +7,6 @@ # The caller (deploy.sh / build.sh / mount.sh / umount.sh) is expected # to have opened a sudo session beforehand. -inherit logging inherit utils IB_FILESYSTEM_PATH = "${IB_DIR}/filesystem" diff --git a/build/meta-filesystem/recipes-filesystem/generic/filesystem_1.0.0.bb b/build/meta-filesystem/recipes-filesystem/generic/filesystem_1.0.0.bb index 73cc03b72c..756e24cbbc 100644 --- a/build/meta-filesystem/recipes-filesystem/generic/filesystem_1.0.0.bb +++ b/build/meta-filesystem/recipes-filesystem/generic/filesystem_1.0.0.bb @@ -10,7 +10,6 @@ PV = "1.0.0" PR = "r0" inherit filesystem -inherit logging do_configure[noexec] = "1" do_attach_infrabase[noexec] = "1" diff --git a/build/meta-linux/classes/linux.bbclass b/build/meta-linux/classes/linux.bbclass index 1b54a27e05..5548202b44 100644 --- a/build/meta-linux/classes/linux.bbclass +++ b/build/meta-linux/classes/linux.bbclass @@ -2,7 +2,6 @@ # Class of Linux layer -inherit logging IB_LINUX_PATH = "${IB_DIR}/linux/linux" diff --git a/build/meta-rootfs/recipes-rootfs/buildroot/buildroot_2024.11.bb b/build/meta-rootfs/recipes-rootfs/buildroot/buildroot_2024.11.bb index 351242a154..da79dc379e 100644 --- a/build/meta-rootfs/recipes-rootfs/buildroot/buildroot_2024.11.bb +++ b/build/meta-rootfs/recipes-rootfs/buildroot/buildroot_2024.11.bb @@ -10,7 +10,6 @@ PV = "2024.11" OVERRIDES += ":linux" -inherit logging inherit rootfs SRC_URI = "https://buildroot.org/downloads/buildroot-2024.11.tar.gz;protocol=https" diff --git a/build/meta-uboot/recipes-uboot/uboot/uboot_2024.07.bb b/build/meta-uboot/recipes-uboot/uboot/uboot_2024.07.bb index cf1a5f968a..863ee0a788 100644 --- a/build/meta-uboot/recipes-uboot/uboot/uboot_2024.07.bb +++ b/build/meta-uboot/recipes-uboot/uboot/uboot_2024.07.bb @@ -12,7 +12,6 @@ inherit filesystem inherit uboot inherit bsp inherit atf -inherit logging SRCREV = "3f772959501c99fbe5aa0b22a36efe3478d1ae1c" SRC_URI = "git://gitlab.com/u-boot/u-boot.git;nobranch=1;protocol=https" diff --git a/build/meta-usr/classes/usr.bbclass b/build/meta-usr/classes/usr.bbclass index 4c575372f3..0bb0694ed9 100644 --- a/build/meta-usr/classes/usr.bbclass +++ b/build/meta-usr/classes/usr.bbclass @@ -1,7 +1,6 @@ # Copyright (c) 2025-2026 EDGEMTech SA inherit filesystem -inherit logging inherit rootfs # Class for managing the user space environment diff --git a/build/meta/classes/base.bbclass b/build/meta/classes/base.bbclass index 9602a7d6a1..b580471b0e 100644 --- a/build/meta/classes/base.bbclass +++ b/build/meta/classes/base.bbclass @@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT # +inherit logging inherit patch inherit utils @@ -205,10 +206,9 @@ do_attach_infrabase () { if [ -d "${IB_TARGET}" ] && [ -f "$ib_manifest" ] && [ "${IB_FORCE_ATTACH}" != "1" ]; then ib_dirty=$(cd "${IB_TARGET}" && LC_ALL=C sha256sum -c --quiet "$ib_manifest" 2>/dev/null | sed -n 's/: FAILED.*$//p') if [ -n "$ib_dirty" ]; then - echo "WARNING: Local modifications detected in ${IB_TARGET}, not captured in the ${PN} patch set:" >&2 + bbwarn "Local modifications detected in ${IB_TARGET}, not captured in the ${PN} patch set:" echo "$ib_dirty" | sed 's|^\./| |' >&2 - echo "ERROR: Refusing to re-attach ${PN} (would overwrite the files above). Run 'bitbake ${PN} -c updiff' to fold them into the patch set, or set IB_FORCE_ATTACH=1 to discard them and re-attach (prior tree is kept in ${IB_TARGET}.back)." >&2 - exit 1 + bbfatal "Refusing to re-attach ${PN} (would overwrite the files above). Run 'bitbake ${PN} -c updiff' to fold them into the patch set, or set IB_FORCE_ATTACH=1 to discard them and re-attach (prior tree is kept in ${IB_TARGET}.back)." fi fi