From patchwork Wed Jan 3 14:58:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 37328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 804C1C3DA6E for ; Wed, 3 Jan 2024 14:59:15 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.groups.io with SMTP id smtpd.web11.19164.1704293945920821953 for ; Wed, 03 Jan 2024 06:59:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=KM+GQpTe; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-336788cb261so9457316f8f.3 for ; Wed, 03 Jan 2024 06:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1704293944; x=1704898744; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yd0Oeh0nkWB1h/mQPj7x/olfTgzYLiXlJIPPg3RgkeQ=; b=KM+GQpTeYe7tLRgz71S1lwGE6iiTon1LH30inBx6KhtnVWpW4fHPnnSY3dk5Zt+Qrh e6qRqRBphrvMu8AkT1d7J67tmAZPLqaKrEKH7WBweB0z7aG4MjDW+GN80l5jM4uo2y5A /xZTRA9j0B5qvFaiqNFYpQSJYka0ypvEPQ3JI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704293944; x=1704898744; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yd0Oeh0nkWB1h/mQPj7x/olfTgzYLiXlJIPPg3RgkeQ=; b=ixT2Nu3o7JV6vEwf8PJ7BVrFJkNJWCxGsssoT1fZDL2B2prcUYcNgBticMGKSZx3Bc Yp5YQLTPaa1hJklw4QiKpoYM64/s6517Tv9rUWnLzY9ZqEjw6c1ZQlCkLKHkGd+ZugGn mub0C2IMkE0zGL4u8tdCOe0cJigcUGV+e+v72BCkQjdL08XwGntDv5Muu/jq6bBFiWP/ LbXmmg2CGc0vFKZRyMQu4PW+ogz63XHx8nRXkB7ZGFpBO90y1xuUDe4ddjs9QiPseuxg HYpdiC0EbJQ9Bjm90jafda6YrQC+jYggcLJj8LRH1siCc+cLyOW68blJx1gIJ0DWkgP9 nDlw== X-Gm-Message-State: AOJu0Yw2VsQBAZJ9hCK2MouTFG9AMd881qkbMJ3e+WzLh/dzGyAI2Vqf 44W7SjsdOjY1EKqxzfxIPUPmehWFnDsFFeEKL0na7MNRBSo= X-Google-Smtp-Source: AGHT+IHZoScxm0MAAB1Y1+uCgC329rJ5ri5TBsETn8DVBozcU08At8JET2Wu6RHyt5Htg08Q8TysYg== X-Received: by 2002:a5d:5988:0:b0:337:1d49:c03 with SMTP id n8-20020a5d5988000000b003371d490c03mr4958667wri.106.1704293944183; Wed, 03 Jan 2024 06:59:04 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:a0e2:8719:e940:13c9]) by smtp.gmail.com with ESMTPSA id t18-20020a5d4612000000b003367bb8898dsm30992081wrq.66.2024.01.03.06.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 06:59:03 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/4] allarch: Fix allarch corner case Date: Wed, 3 Jan 2024 14:58:59 +0000 Message-Id: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 03 Jan 2024 14:59:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193288 Most of the allarch code is conditional and only set if the recipe remains marked as allarch. The qemu wrapper handling is not handled in the same way however and is unconditional. Move the code to some slightly uglier inline python to allow it to be conditional and match the way the rest of the code works. Signed-off-by: Richard Purdie --- meta/classes-recipe/allarch.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/allarch.bbclass b/meta/classes-recipe/allarch.bbclass index 9138f40ed84..e429b924370 100644 --- a/meta/classes-recipe/allarch.bbclass +++ b/meta/classes-recipe/allarch.bbclass @@ -63,9 +63,9 @@ python () { d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS") d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS") d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs") + + d.setVar("qemu_wrapper_cmdline", "def qemu_wrapper_cmdline(data, rootfs_path, library_paths):\n return 'false'") elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d): bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE")) } -def qemu_wrapper_cmdline(data, rootfs_path, library_paths): - return 'false' From patchwork Wed Jan 3 14:59:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 37327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F5B3C47077 for ; Wed, 3 Jan 2024 14:59:15 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.groups.io with SMTP id smtpd.web11.19165.1704293946543822486 for ; Wed, 03 Jan 2024 06:59:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Je9Yxsaj; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-336990fb8fbso8274006f8f.1 for ; Wed, 03 Jan 2024 06:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1704293944; x=1704898744; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8wl0OdlDDOItrqDTJHKzgWdYVE2GOFvo91gpUy1efj4=; b=Je9YxsajSM7XR4EPCwMbj6Rcj6o1G30KOy4jgi+gTlAE04QhnV80nvW6TF34pPs8vf TvYPRZehgtOQ2G5FZ4i0FtLRHPZKKmmRcFck/W7r/TdD1YKomvTuI+JRNHPxNupHRMYH 1s87/dHViQiPYfqKctHusemGHTKvFv+4jMleM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704293944; x=1704898744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8wl0OdlDDOItrqDTJHKzgWdYVE2GOFvo91gpUy1efj4=; b=pZICU9W3QeGBY1qmce8MYhG4cU6EkhpQHju0yZyNq6jbJYLWLcBASwak7Bftzpjwwa arBe+bu36Dv/go8FpGN1BXgFajClgpxd6zIK6YMZrx6dkh+dRrTUTlII0DoqxGWY7rUX qelfQVUEFv320QssPzAxCmVOZYJV6CjBQckcrdpvwxThYenD+t6TBnVk2K0cfEBcisyn p3WM2VIZVf2dBX1IXJuBQLL0uN82ID2xIFX2jk0dA+5rbToYPGWZAyMcvk4qct8dotxL LNNQ7iVMXygLvKqkXA3DZ2lOCceN6fZz2RUB4io0gXJ8CqxIAvpO9WX0QppmVic//KGZ SEsw== X-Gm-Message-State: AOJu0YynJklzIi9Zz6ch2N/YKtNRsceYjHVWKyq+e01N9gE238P09NpR PDxM0q0zmOLGr5YMz761GoXizj96p9tjY++Bu3Qd61BMxsc= X-Google-Smtp-Source: AGHT+IGOxdvEHAsizfO2YMu/DZEl+6Kyx4C8PwpSCG7TRhaPElNovYLBmgxekDMhdNZz4MI5VX8XzQ== X-Received: by 2002:adf:ee0b:0:b0:337:3a52:9aca with SMTP id y11-20020adfee0b000000b003373a529acamr2657770wrn.136.1704293944761; Wed, 03 Jan 2024 06:59:04 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:a0e2:8719:e940:13c9]) by smtp.gmail.com with ESMTPSA id t18-20020a5d4612000000b003367bb8898dsm30992081wrq.66.2024.01.03.06.59.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 06:59:04 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/4] rootfs: Fix MULTILIB_RE_ALLOW to be inherit order independent Date: Wed, 3 Jan 2024 14:59:00 +0000 Message-Id: <20240103145902.2124110-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> References: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 03 Jan 2024 14:59:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193289 This variable is only used by the ipk backend with multilibs. In order to make it work correctly regardless of inherit order, change the string to be space delimeted, set using += and add in the regex '|' sperator at the end of processing. Signed-off-by: Richard Purdie --- meta/classes-recipe/image.bbclass | 2 +- meta/classes-recipe/rootfs_ipk.bbclass | 2 +- meta/lib/oe/package_manager/ipk/rootfs.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 7231fad940d..6bdddc0134c 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -609,7 +609,7 @@ python create_symlinks() { bb.note("Skipping symlink, source does not exist: %s -> %s" % (dst, src)) } -MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|" +MULTILIBRE_ALLOW_REP += "${base_bindir} ${base_sbindir} ${bindir} ${sbindir} ${libexecdir} ${sysconfdir} ${nonarch_base_libdir}/udev /lib/modules/[^/]*/modules.*" MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib" diff --git a/meta/classes-recipe/rootfs_ipk.bbclass b/meta/classes-recipe/rootfs_ipk.bbclass index a48ad07dfc8..87fff53a588 100644 --- a/meta/classes-recipe/rootfs_ipk.bbclass +++ b/meta/classes-recipe/rootfs_ipk.bbclass @@ -29,7 +29,7 @@ OPKG_POSTPROCESS_COMMANDS = "" OPKGLIBDIR ??= "${localstatedir}/lib" -MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg" +MULTILIBRE_ALLOW_REP += "${OPKGLIBDIR}/opkg /usr/lib/opkg" python () { diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py b/meta/lib/oe/package_manager/ipk/rootfs.py index 1f74f7e39a9..ba93eb62ea8 100644 --- a/meta/lib/oe/package_manager/ipk/rootfs.py +++ b/meta/lib/oe/package_manager/ipk/rootfs.py @@ -165,7 +165,7 @@ class PkgRootfs(DpkgOpkgRootfs): """ def _multilib_sanity_test(self, dirs): - allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP") + allow_replace = "|".join((self.d.getVar("MULTILIBRE_ALLOW_REP") or "").split()) if allow_replace is None: allow_replace = "" From patchwork Wed Jan 3 14:59:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 37325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91EC1C47073 for ; Wed, 3 Jan 2024 14:59:15 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web10.19136.1704293947533254123 for ; Wed, 03 Jan 2024 06:59:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cv3Z5HVv; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40d3352b525so115219065e9.1 for ; Wed, 03 Jan 2024 06:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1704293946; x=1704898746; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=bCw1wEoC/sfK3+Dtl5SFHGTFTTMSUmiz6eair/qQqJI=; b=cv3Z5HVvG0tsHyB5p+0+Ji68AznNlSt/8fiTB4Hk5P8kwzKj5lG+fix7ujqXIJe8br sm2fTG7xchWzogwcaNnbxLxOwkgNe+/KmG6myBP8imarjOWEUw1RwposBPF/lX4VSEQZ C5pnk1sLSFVbnVMUCkRygm0bqWPeB9TihajaA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704293946; x=1704898746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bCw1wEoC/sfK3+Dtl5SFHGTFTTMSUmiz6eair/qQqJI=; b=Tczy6yOVp3LYc8cJhJs+kPfxtq9RO8oKA+YMR8n0pYUzdscIw8z3GR3rA9qxkAJmb9 czi5bLLNDR5p2xJsMLH5S3FrrnMSfeePwOz6qdID3fby+3YJ78Tx+yss9tU6uZlWPh29 C2vjJHoQvGi/EkKs57MkGAFvXDyIMSnO1OngxTu1YGAFhIsojQ0s1XLWopoo6Q5xt8aB 6LCjnKj6M6e5+AsKj1M2iXHr/r1gERIpb9neFU2PXeal3/Js5s8E4NDLIaiwgUfwB8Zx nMZsqh5g2IUoIJizHx3+z4pdEBrxRjjWz6KG1lF6UG97hjPbBZy9bw1HZbSa9kYt1mGu /EaA== X-Gm-Message-State: AOJu0YzLhgGamSMQ1dDse1XBIpz2Y1k7wWf1J1vrsiMlblf2cgPxkt1V au+PGuQJEtcEpQhHpbFX6TCMxJ8VADfENo7j5qkNY/vABbA= X-Google-Smtp-Source: AGHT+IGhN0dAIyekOBA9NeJJ2WbqEwYpDH/wpwZz/j07kpvFoB5nJtD6tE22td5UpwDFGMX0hlFQTQ== X-Received: by 2002:a05:600c:cc4:b0:40d:8d12:25fb with SMTP id fk4-20020a05600c0cc400b0040d8d1225fbmr1103783wmb.5.1704293945586; Wed, 03 Jan 2024 06:59:05 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:a0e2:8719:e940:13c9]) by smtp.gmail.com with ESMTPSA id t18-20020a5d4612000000b003367bb8898dsm30992081wrq.66.2024.01.03.06.59.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 06:59:05 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/4] rootfs-postcommands: Try and improve ordering constraints Date: Wed, 3 Jan 2024 14:59:01 +0000 Message-Id: <20240103145902.2124110-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> References: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 03 Jan 2024 14:59:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193290 The current code is in race to see who can set things last. This isn't scalable or sustainable and problemtic in the face of inherit ordering changes. Move the ordering issue into the actual code execution, which isn't ideal but the best of several bad options and at least lets us drop the anonymous python. Signed-off-by: Richard Purdie --- meta/classes-recipe/rootfs-postcommands.bbclass | 13 ++++--------- meta/lib/oe/rootfs.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass index 29ee74932a3..163c7f41b11 100644 --- a/meta/classes-recipe/rootfs-postcommands.bbclass +++ b/meta/classes-recipe/rootfs-postcommands.bbclass @@ -55,19 +55,14 @@ inherit image-artifact-names # deterministic. Package installs are not deterministic, causing the ordering # of entries to change between builds. In case that this isn't desired, # the command can be overridden. +SORT_PASSWD_POSTPROCESS_COMMAND ??= "tidy_shadowutils_files" +ROOTFS_POSTPROCESS_COMMAND += '${SORT_PASSWD_POSTPROCESS_COMMAND}' + # # Note that useradd-staticids.bbclass has to be used to ensure that # the numeric IDs of dynamically created entries remain stable. # -# We want this to run as late as possible, in particular after -# systemd_sysusers_create and set_user_group. Using :append is not -# enough for that, set_user_group is added that way and would end -# up running after us. -SORT_PASSWD_POSTPROCESS_COMMAND ??= "tidy_shadowutils_files" -python () { - d.appendVar('ROOTFS_POSTPROCESS_COMMAND', ' ${SORT_PASSWD_POSTPROCESS_COMMAND}') - d.appendVar('ROOTFS_POSTPROCESS_COMMAND', ' rootfs_reproducible') -} +ROOTFS_POSTPROCESS_COMMAND += 'rootfs_reproducible' # Resolve the ID as described in the sysusers.d(5) manual: ID can be a numeric # uid, a couple uid:gid or uid:groupname or it is '-' meaning leaving it diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 1a48ed10b3f..fb73318ca61 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -194,6 +194,18 @@ class Rootfs(object, metaclass=ABCMeta): post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND") rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND') + def make_last(command, commands): + commands = commands.split() + if command in commands: + commands.remove(command) + commands.append(command) + return "".join(commands) + + # We want this to run as late as possible, in particular after + # systemd_sysusers_create and set_user_group. Using :append is not enough + make_last("tidy_shadowutils_files", post_process_cmds) + make_last("rootfs_reproducible", post_process_cmds) + execute_pre_post_process(self.d, pre_process_cmds) if self.progress_reporter: From patchwork Wed Jan 3 14:59:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 37326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FFECC4707B for ; Wed, 3 Jan 2024 14:59:15 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.web10.19137.1704293947965177722 for ; Wed, 03 Jan 2024 06:59:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ikWalsYT; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40d87df95ddso26425425e9.0 for ; Wed, 03 Jan 2024 06:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1704293946; x=1704898746; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=x75EaXrjPfK8hd7DeKGciPlMXjT5CA65ckh+rvJZe+0=; b=ikWalsYTLJaabMLMykE1FSmAj4oVq33wdtb1Nr5ds1lpMwhmJKlWxsPpl5Z2r8hIIq wLIa/n6c0S7fDwkZfSR98RoIoTiCWjOjwb2EmvaKfrEFE1bAVzFiGCz4VScpBlDrjkKZ gCAGYZectfmgaW4gitQB1oOPurNjJ++tXW1bE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704293946; x=1704898746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x75EaXrjPfK8hd7DeKGciPlMXjT5CA65ckh+rvJZe+0=; b=XJhFKtcnx3jGS5bLRJ8IwsYhNFotynsziJoKdYh6Ns3abIhEBoSXLxfvsAk4qdXmyG vxXurb6M4JjYljFg+W3chTDw5S3jXJG1+abmzMFGcwQWeUo9WIsCvx6d7WK+Mzgak/nG R/1ZTQabz7eVzYg34FrljcDVAGwQH2Z7I5Tfa2dJgV3M7e1K0o7A0jNmO8Ya5Iq99lsf K4z2kbr2KB8hNi6hbt14yxtrqumY8NNzf8FN/SBiJneEuv+9rvAuZ2Rh66EQDDkMuITI ubhfbSSudlBXV5BYYKRlYWeppbdaDlt7XFhPITGJfQobf41iThI2/gLwDZIinbCFm5bs hlcQ== X-Gm-Message-State: AOJu0Yxv3JSpsfys4WjnqSOOkxbhaAqV4qxO4HyCKpKLV9g+jf726zP8 O4aZRzL2IAeoqa2xSAnwtWDb5WbQ7aeggBxWjyHY8NsG54s= X-Google-Smtp-Source: AGHT+IH9CgiGnivSLIYs5Bo0E3pEk3vZEyUKw4w1OkH/o6iYC/xAV5S4FuuagFo1kcL49tsXR/FQog== X-Received: by 2002:a7b:c84b:0:b0:40c:da89:75ec with SMTP id c11-20020a7bc84b000000b0040cda8975ecmr5388874wml.344.1704293946239; Wed, 03 Jan 2024 06:59:06 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:a0e2:8719:e940:13c9]) by smtp.gmail.com with ESMTPSA id t18-20020a5d4612000000b003367bb8898dsm30992081wrq.66.2024.01.03.06.59.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 06:59:05 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/4] classes/recipes: Switch to use inherit_defer Date: Wed, 3 Jan 2024 14:59:02 +0000 Message-Id: <20240103145902.2124110-4-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> References: <20240103145902.2124110-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 03 Jan 2024 14:59:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193291 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 --- meta-selftest/recipes-test/overlayfs-user/overlayfs-user.bb | 2 +- meta/classes-recipe/baremetal-image.bbclass | 2 +- meta/classes-recipe/gnomebase.bbclass | 2 +- meta/classes-recipe/image.bbclass | 5 +++-- meta/classes-recipe/image_types_wic.bbclass | 2 +- meta/classes-recipe/kernel.bbclass | 2 +- meta/classes-recipe/live-vm-common.bbclass | 4 ++-- meta/classes-recipe/packagegroup.bbclass | 2 +- meta/classes-recipe/populate_sdk_base.bbclass | 2 +- meta/classes/useradd.bbclass | 2 +- meta/recipes-core/libxml/libxml2_2.11.5.bb | 2 +- .../packagegroups/nativesdk-packagegroup-sdk-host.bb | 3 ++- meta/recipes-devtools/btrfs-tools/btrfs-tools_6.5.3.bb | 2 +- meta/recipes-graphics/xorg-driver/xorg-driver-common.inc | 2 +- meta/recipes-kernel/perf/perf.bb | 2 +- meta/recipes-kernel/systemtap/systemtap-native_git.bb | 2 +- meta/recipes-kernel/systemtap/systemtap_git.bb | 2 +- meta/recipes-support/gpgme/gpgme_1.23.2.bb | 3 ++- 18 files changed, 23 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 50cba9514bf..88c8998cf9e 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 70791f999ac..b9a584351a1 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 a12e9f31a95..09abb039909 100644 --- a/meta/classes-recipe/gnomebase.bbclass +++ b/meta/classes-recipe/gnomebase.bbclass @@ -28,7 +28,7 @@ FILES:${PN} += "${datadir}/application-registry \ FILES:${PN}-doc += "${datadir}/devhelp" GNOMEBASEBUILDCLASS ??= "meson" -inherit ${GNOMEBASEBUILDCLASS} pkgconfig +inherit_defer ${GNOMEBASEBUILDCLASS} pkgconfig do_install:append() { rm -rf ${D}${localstatedir}/lib/scrollkeeper/* diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 6bdddc0134c..28be6c63623 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 669606da75a..00620fdc9d1 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 9ff37f5c38c..a76aaee5bac 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 b619f3a4be0..d90cc67ebc3 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 c2db6649045..cf6fc354a81 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 8fadfef9422..81896d808f5 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 0997b3da7a5..cb809b5dd74 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 319833f053e..44336c25e1c 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 11e31dcba3b..c1d3c250605 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 873d5e7a14b..6455efd1bca 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 8b3f19426bc..f3744922c0c 100644 --- a/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc +++ b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc @@ -14,7 +14,7 @@ SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}${XORG_DRIVER_COMPRESSOR FILES:${PN} += " ${libdir}/xorg/modules/drivers/*.so" XORGBUILDCLASS ??= "autotools" -inherit ${XORGBUILDCLASS} pkgconfig features_check +inherit_defer ${XORGBUILDCLASS} pkgconfig features_check # 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 32882afdf4e..4f26813de02 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 19cc1cf0f0a..2690b259c8b 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 0a1349e1280..68f5c764282 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 b29c182f365..d8807b3af26 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'