From patchwork Sat May 10 08:43:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62717 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 40FF9C3ABCB for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6806.1746866645824886136 for ; Sat, 10 May 2025 01:44:06 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5772C153B for ; Sat, 10 May 2025 01:43:54 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E4DDB3F5A1 for ; Sat, 10 May 2025 01:44:04 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 01/23] buildtools-tarball: fix default_cases assignment Date: Sat, 10 May 2025 09:43:34 +0100 Message-ID: <20250510084400.269726-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216249 This is meant to be a list of strings not a single string. For example, this is overwriting the default in OESDKTestContextExecutor which is: default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cases')] Signed-off-by: Ross Burton --- meta/recipes-core/meta/buildtools-tarball.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-core/meta/buildtools-tarball.bb b/meta/recipes-core/meta/buildtools-tarball.bb index 8e78169e237..6fa6d93a3d3 100644 --- a/meta/recipes-core/meta/buildtools-tarball.bb +++ b/meta/recipes-core/meta/buildtools-tarball.bb @@ -135,7 +135,7 @@ python do_testsdk() { testsdk = oeqa.sdk.testsdk.TestSDK() cases_path = os.path.join(os.path.abspath(os.path.dirname(oeqa.sdk.testsdk.__file__)), d.getVar("TESTSDK_CASES")) - testsdk.context_executor_class.default_cases = cases_path + testsdk.context_executor_class.default_cases = [cases_path,] testsdk.run(d) } From patchwork Sat May 10 08:43:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62730 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 9B533C3ABDB for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6807.1746866646363725752 for ; Sat, 10 May 2025 01:44:06 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F22741595 for ; Sat, 10 May 2025 01:43:54 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 966803F5A1 for ; Sat, 10 May 2025 01:44:05 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 02/23] testsdk: allow user to specify which tests to run Date: Sat, 10 May 2025 09:43:35 +0100 Message-ID: <20250510084400.269726-2-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216250 Following the usage of TEST_SUITES in testimage, add TESTSDK_SUITES to specify the list of tests to execute. By default the variable is empty, which means to run all discovered tests. This makes it easier to work on a single test without having to run all of the tests. Signed-off-by: Ross Burton --- meta/classes-recipe/testsdk.bbclass | 3 +++ meta/lib/oeqa/sdk/testsdk.py | 3 ++- meta/lib/oeqa/sdkext/testsdk.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/testsdk.bbclass b/meta/classes-recipe/testsdk.bbclass index fd82e6ef41d..59d2834c992 100644 --- a/meta/classes-recipe/testsdk.bbclass +++ b/meta/classes-recipe/testsdk.bbclass @@ -14,6 +14,9 @@ # # where "" is an image like core-image-sato. +# List of test modules to run, or run all that can be found if unset +TESTSDK_SUITES ?= "" + TESTSDK_CLASS_NAME ?= "oeqa.sdk.testsdk.TestSDK" TESTSDKEXT_CLASS_NAME ?= "oeqa.sdkext.testsdk.TestSDKExt" diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py index 518b09febb6..52b702b6a28 100644 --- a/meta/lib/oeqa/sdk/testsdk.py +++ b/meta/lib/oeqa/sdk/testsdk.py @@ -114,7 +114,8 @@ class TestSDK(TestSDKBase): host_pkg_manifest=host_pkg_manifest, **context_args) try: - tc.loadTests(self.context_executor_class.default_cases) + modules = (d.getVar("TESTSDK_SUITES") or "").split() + tc.loadTests(self.context_executor_class.default_cases, modules) except Exception as e: import traceback bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) diff --git a/meta/lib/oeqa/sdkext/testsdk.py b/meta/lib/oeqa/sdkext/testsdk.py index 9d5a99d900f..6dc23065a4a 100644 --- a/meta/lib/oeqa/sdkext/testsdk.py +++ b/meta/lib/oeqa/sdkext/testsdk.py @@ -82,7 +82,8 @@ class TestSDKExt(TestSDKBase): host_pkg_manifest=host_pkg_manifest) try: - tc.loadTests(OESDKExtTestContextExecutor.default_cases) + modules = (d.getVar("TESTSDK_SUITES") or "").split() + tc.loadTests(OESDKExtTestContextExecutor.default_cases, modules) except Exception as e: import traceback bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) From patchwork Sat May 10 08:43:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62732 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 BDD12C3ABDC for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6618.1746866646901756161 for ; Sat, 10 May 2025 01:44:07 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 99B51153B for ; Sat, 10 May 2025 01:43:55 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3E4663F5A1 for ; Sat, 10 May 2025 01:44:06 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 03/23] oe/sdk: fix empty SDK manifests Date: Sat, 10 May 2025 09:43:36 +0100 Message-ID: <20250510084400.269726-3-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216251 The SDK manifests are generated by listing the sstate was that used, but it hardcodes that the sstate data filenames end in .tgz. This has not been the case since sstate switched to Zstd[1] in 2021, which meant that all of the tests which checked for packages existing were being skipped as the manifests were empty. For example, see a representative core-image-sato eSDK test run[2]: RESULTS - cmake.CMakeTest.test_assimp: SKIPPED (0.00s) RESULTS - gtk3.GTK3Test.test_galculator: SKIPPED (0.00s) RESULTS - kmod.KernelModuleTest.test_cryptodev: SKIPPED (0.00s) RESULTS - maturin.MaturinDevelopTest.test_maturin_develop: SKIPPED (0.00s) RESULTS - maturin.MaturinTest.test_maturin_list_python: SKIPPED (0.00s) RESULTS - meson.MesonTest.test_epoxy: SKIPPED (0.00s) RESULTS - perl.PerlTest.test_perl: SKIPPED (0.00s) RESULTS - python.Python3Test.test_python3: SKIPPED (0.00s) All of those tests should have been ran. Solve this by generalising the filename check so that it doesn't care what specfic compression algorithm is used. [1] oe-core 0710e98f40e ("sstate: Switch to ZStandard compressor support") [2] https://autobuilder.yoctoproject.org/valkyrie/#/builders/16/builds/1517/steps/15/logs/stdio Signed-off-by: Ross Burton --- meta/lib/oe/sdk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py index 11759aba489..9fe0fbb752d 100644 --- a/meta/lib/oe/sdk.py +++ b/meta/lib/oe/sdk.py @@ -148,7 +148,8 @@ def get_extra_sdkinfo(sstate_dir): extra_info['filesizes'] = {} for root, _, files in os.walk(sstate_dir): for fn in files: - if fn.endswith('.tgz'): + # Note that this makes an assumption about the sstate filenames + if '.tar.' in fn and not fn.endswith('.siginfo'): fsize = int(math.ceil(float(os.path.getsize(os.path.join(root, fn))) / 1024)) task = fn.rsplit(':',1)[1].split('_',1)[1].split(',')[0] origtotal = extra_info['tasksizes'].get(task, 0) From patchwork Sat May 10 08:43:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62727 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 B2623C3ABDA for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6619.1746866647576159237 for ; Sat, 10 May 2025 01:44:07 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B7F4153B for ; Sat, 10 May 2025 01:43:56 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D9FB13F5A1 for ; Sat, 10 May 2025 01:44:06 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 04/23] oeqa/sdk/context: fix multilib handling bug in hasTargetPackage Date: Sat, 10 May 2025 09:43:37 +0100 Message-ID: <20250510084400.269726-4-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216252 hasTargetPackage has some logic to automatically multilibify package names if needed (for example, so that gtk+3 becomes lib32-gtk+3). Due to a logic bug if multilib was True but there were no multilibs configured then this prepended "-" to the package name, which won't exist. This resulted in tests being skipped as the dependent packages are not installed. Solve this by only prepending to the package name if requested and if a multilib environment has been detected. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/sdk/context.py b/meta/lib/oeqa/sdk/context.py index d968cfa2be9..d4fdd832070 100644 --- a/meta/lib/oeqa/sdk/context.py +++ b/meta/lib/oeqa/sdk/context.py @@ -47,7 +47,7 @@ class OESDKTestContext(OETestContext): return self._hasPackage(self.host_pkg_manifest, pkg, regex=regex) def hasTargetPackage(self, pkg, multilib=False, regex=False): - if multilib: + if multilib and self.multilib: pkg = self.multilib + '-' + pkg return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex) From patchwork Sat May 10 08:43:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62718 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 51474C3ABD2 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6808.1746866648478773331 for ; Sat, 10 May 2025 01:44:08 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F06AF153B for ; Sat, 10 May 2025 01:43:56 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8A9123F5A1 for ; Sat, 10 May 2025 01:44:07 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 05/23] oeqa/sdkext/context: align hasHostPackage with parent class Date: Sat, 10 May 2025 09:43:38 +0100 Message-ID: <20250510084400.269726-5-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216253 This subclass overrides hasHostPackage() but back in 2018[1] the parent class's method gained a regex argument. [1] oe-core 595e9922cdb ("oeqa/sdk: fixes related to hasPackage semantics") Signed-off-by: Ross Burton --- meta/lib/oeqa/sdkext/context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/sdkext/context.py b/meta/lib/oeqa/sdkext/context.py index 2ac2bf6ff73..2da57e2ccff 100644 --- a/meta/lib/oeqa/sdkext/context.py +++ b/meta/lib/oeqa/sdkext/context.py @@ -12,11 +12,11 @@ class OESDKExtTestContext(OESDKTestContext): # FIXME - We really need to do better mapping of names here, this at # least allows some tests to run - def hasHostPackage(self, pkg): + def hasHostPackage(self, pkg, regex=False): # We force a toolchain to be installed into the eSDK even if its minimal if pkg.startswith("packagegroup-cross-canadian-"): return True - return self._hasPackage(self.host_pkg_manifest, pkg) + return self._hasPackage(self.host_pkg_manifest, pkg, regex) class OESDKExtTestContextExecutor(OESDKTestContextExecutor): _context_class = OESDKExtTestContext From patchwork Sat May 10 08:43:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62728 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 974C2C3ABD9 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6809.1746866648885446440 for ; Sat, 10 May 2025 01:44:09 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9906C1595 for ; Sat, 10 May 2025 01:43:57 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3C7F73F5A1 for ; Sat, 10 May 2025 01:44:08 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 06/23] oeqa/sdk: add simple test that the manifests are not empty Date: Sat, 10 May 2025 09:43:39 +0100 Message-ID: <20250510084400.269726-6-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216254 Simple test to sanity check that the generated SDK manifest was parsed correctly and isn't empty. This test is complicated by the fact that minimal eSDKs without a toolchain do in fact have an empty manifest, so also check for that. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/manifest.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 meta/lib/oeqa/sdk/cases/manifest.py diff --git a/meta/lib/oeqa/sdk/cases/manifest.py b/meta/lib/oeqa/sdk/cases/manifest.py new file mode 100644 index 00000000000..ee59a5f3386 --- /dev/null +++ b/meta/lib/oeqa/sdk/cases/manifest.py @@ -0,0 +1,26 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +from oeqa.sdk.case import OESDKTestCase +from oeqa.sdkext.context import OESDKExtTestContext + + +class ManifestTest(OESDKTestCase): + def test_manifests(self): + """ + Verify that the host and target manifests are not empty, unless this is + a minimal eSDK without toolchain in which case they should be empty. + """ + if ( + isinstance(self.tc, OESDKExtTestContext) + and self.td.get("SDK_EXT_TYPE") == "minimal" + and self.td.get("SDK_INCLUDE_TOOLCHAIN") == "0" + ): + self.assertEqual(self.tc.target_pkg_manifest, {}) + self.assertEqual(self.tc.host_pkg_manifest, {}) + else: + self.assertNotEqual(self.tc.target_pkg_manifest, {}) + self.assertNotEqual(self.tc.host_pkg_manifest, {}) From patchwork Sat May 10 08:43:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62726 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 971E1C3ABD5 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6620.1746866649536105295 for ; Sat, 10 May 2025 01:44:09 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 40A7F153B for ; Sat, 10 May 2025 01:43:58 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D93503F5A1 for ; Sat, 10 May 2025 01:44:08 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 07/23] oeqa/selftest/sdk: add test to verify the manifests are generated correctly Date: Sat, 10 May 2025 09:43:40 +0100 Message-ID: <20250510084400.269726-7-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216255 Add a test that builds a SDK with specific packages in the host and target sections, and verifies that they're listed in the manifest. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/sdk.py | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/sdk.py diff --git a/meta/lib/oeqa/selftest/cases/sdk.py b/meta/lib/oeqa/selftest/cases/sdk.py new file mode 100644 index 00000000000..39713650295 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/sdk.py @@ -0,0 +1,39 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +import os.path + +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake, get_bb_vars + +class SDKTests(OESelftestTestCase): + + def load_manifest(self, filename): + manifest = {} + with open(filename) as f: + for line in f: + name, arch, version = line.split(maxsplit=3) + manifest[name] = (version, arch) + return manifest + + def test_sdk_manifests(self): + image = "core-image-minimal" + + self.write_config(""" +TOOLCHAIN_HOST_TASK:append = " nativesdk-selftest-hello" +IMAGE_INSTALL:append = " selftest-hello" +""") + + bitbake(f"{image} -c populate_sdk") + vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAIN_OUTPUTNAME'], image) + + path = os.path.join(vars["SDK_DEPLOY"], vars["TOOLCHAIN_OUTPUTNAME"] + ".host.manifest") + self.assertNotEqual(os.path.getsize(path), 0, msg="Host manifest is empty") + self.assertIn("nativesdk-selftest-hello", self.load_manifest(path)) + + path = os.path.join(vars["SDK_DEPLOY"], vars["TOOLCHAIN_OUTPUTNAME"] + ".target.manifest") + self.assertNotEqual(os.path.getsize(path), 0, msg="Target manifest is empty") + self.assertIn("selftest-hello", self.load_manifest(path)) From patchwork Sat May 10 08:43:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62723 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 8B7D3C3ABD7 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6810.1746866650201018326 for ; Sat, 10 May 2025 01:44:10 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC7B0153B for ; Sat, 10 May 2025 01:43:58 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 80F523F5A1 for ; Sat, 10 May 2025 01:44:09 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 08/23] oeqa/sdk: add helpers to check for and install packages Date: Sat, 10 May 2025 09:43:41 +0100 Message-ID: <20250510084400.269726-8-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216256 The existing tests simply look at the manifest to determine if a test should be ran or not based on dependencies. Whilst this works for Traditional SDKs, it fails for Extensible SDKs if they've been built in minimal mode, where the manifest will be empty. However, minimal eSDKs might well have available sstate to install the missing dependencies. Add a pair of helper functions to ensure that a package is available, or skip the test. This handles nativesdk- vs -native (SDK vs eSDK) and will try to sdk-install missing dependencies into an eSDK if they're not already installed. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/case.py | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py index 46a3789f572..1fd3b3b5695 100644 --- a/meta/lib/oeqa/sdk/case.py +++ b/meta/lib/oeqa/sdk/case.py @@ -7,8 +7,10 @@ import os import subprocess import shutil +import unittest from oeqa.core.case import OETestCase +from oeqa.sdkext.context import OESDKExtTestContext class OESDKTestCase(OETestCase): def _run(self, cmd): @@ -16,6 +18,62 @@ class OESDKTestCase(OETestCase): (self.tc.sdk_env, cmd), shell=True, executable="/bin/bash", stderr=subprocess.STDOUT, universal_newlines=True) + def ensure_host_package(self, *packages, recipe=None): + """ + Check that the host variation of one of the packages listed is available + in the SDK (nativesdk-foo for SDK, foo-native for eSDK). The package is + a list for the case where debian-renaming may have occured, and the + manifest could contain 'foo' or 'libfoo'. + + If testing an eSDK and the package is not found, then try to install the + specified recipe to install it from sstate. + """ + + # In a SDK the manifest is correct. In an eSDK the manifest may be + # correct (type=full) or not include packages that exist in sstate but + # not installed yet (minimal) so we should try to install the recipe. + for package in packages: + if isinstance(self.tc, OESDKExtTestContext): + package = package + "-native" + else: + package = "nativesdk-" + package + + if self.tc.hasHostPackage(package): + break + else: + if isinstance(self.tc, OESDKExtTestContext): + recipe = (recipe or packages[0]) + "-native" + print("Trying to install %s..." % recipe) + self._run('devtool sdk-install %s' % recipe) + else: + raise unittest.SkipTest("Test %s needs one of %s" % (self.id(), ", ".join(packages))) + + def ensure_target_package(self, *packages, multilib=False, recipe=None): + """ + Check that at least one of the packages listed is available in the SDK, + adding the multilib prefix if required. The target package is a list for + the case where debian-renaming may have occured, and the manifest could + contain 'foo' or 'libfoo'. + + If testing an eSDK and the package is not found, then try to install the + specified recipe to install it from sstate. + """ + + # In a SDK the manifest is correct. In an eSDK the manifest may be + # correct (type=full) or not include packages that exist in sstate but + # not installed yet (minimal) so we should try to install the recipe. + for package in packages: + if self.tc.hasTargetPackage(package, multilib=multilib): + break + else: + if isinstance(self.tc, OESDKExtTestContext): + recipe = recipe or packages[0] + print("Trying to install %s..." % recipe) + self._run('devtool sdk-install %s' % recipe) + else: + raise unittest.SkipTest("Test %s needs one of %s" % (self.id(), ", ".join(packages))) + + def fetch(self, workdir, dl_dir, url, archive=None): if not archive: from urllib.parse import urlparse From patchwork Sat May 10 08:43:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62731 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 8BB43C3ABD8 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6811.1746866651053816665 for ; Sat, 10 May 2025 01:44:11 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8466E153B for ; Sat, 10 May 2025 01:43:59 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 28ED63F5A1 for ; Sat, 10 May 2025 01:44:10 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 09/23] oeqa/sdk: use ensure_*_package helpers Date: Sat, 10 May 2025 09:43:42 +0100 Message-ID: <20250510084400.269726-9-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216257 Clean up lots of dependency checking code by using the new helpers. This means that a lot of tests that were previously skipped inside the eSDK testing on the autobuilder are now executed, and fail. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/cmake.py | 4 +--- meta/lib/oeqa/sdk/cases/gtk3.py | 8 ++------ meta/lib/oeqa/sdk/cases/kmod.py | 10 ++-------- meta/lib/oeqa/sdk/cases/maturin.py | 13 +++---------- meta/lib/oeqa/sdk/cases/meson.py | 4 +--- meta/lib/oeqa/sdk/cases/perl.py | 5 +---- meta/lib/oeqa/sdk/cases/python.py | 5 +---- 7 files changed, 11 insertions(+), 38 deletions(-) diff --git a/meta/lib/oeqa/sdk/cases/cmake.py b/meta/lib/oeqa/sdk/cases/cmake.py index cb0944ee995..070682ef084 100644 --- a/meta/lib/oeqa/sdk/cases/cmake.py +++ b/meta/lib/oeqa/sdk/cases/cmake.py @@ -23,9 +23,7 @@ class CMakeTest(OESDKTestCase): if libc in [ 'newlib' ]: raise unittest.SkipTest("CMakeTest class: SDK doesn't contain a supported C library") - if not (self.tc.hasHostPackage("nativesdk-cmake") or - self.tc.hasHostPackage("cmake-native")): - raise unittest.SkipTest("CMakeTest: needs cmake") + self.ensure_host_package("cmake") def test_assimp(self): with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir: diff --git a/meta/lib/oeqa/sdk/cases/gtk3.py b/meta/lib/oeqa/sdk/cases/gtk3.py index 8f60d5e7da7..1d953eecf1d 100644 --- a/meta/lib/oeqa/sdk/cases/gtk3.py +++ b/meta/lib/oeqa/sdk/cases/gtk3.py @@ -22,12 +22,8 @@ class GTK3Test(OESDKTestCase): if libc in [ 'newlib' ]: raise unittest.SkipTest("GTK3Test class: SDK doesn't contain a supported C library") - if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \ - self.tc.hasTargetPackage("libgtk-3.0", multilib=True)): - raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3") - if not (self.tc.hasHostPackage("nativesdk-gettext-dev") or - self.tc.hasHostPackage("gettext-native")): - raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext") + self.ensure_host_package(recipe="intltool") + self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3") def test_galculator(self): with tempfile.TemporaryDirectory(prefix="galculator", dir=self.tc.sdk_dir) as testdir: diff --git a/meta/lib/oeqa/sdk/cases/kmod.py b/meta/lib/oeqa/sdk/cases/kmod.py index 9e8fdbcd403..af9fcf5150d 100644 --- a/meta/lib/oeqa/sdk/cases/kmod.py +++ b/meta/lib/oeqa/sdk/cases/kmod.py @@ -7,7 +7,6 @@ import os import subprocess import tempfile -import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.utils.subprocesstweak import errors_have_output @@ -17,16 +16,11 @@ class KernelModuleTest(OESDKTestCase): """ Test that out-of-tree kernel modules build. """ - - def setUp(self): - if not self.tc.hasTargetPackage("kernel-devsrc"): - raise unittest.SkipTest("KernelModuleTest needs kernel-devsrc") - + def test_cryptodev(self): + self.ensure_target_package("kernel-devsrc") # These targets need to be built before kernel modules can be built. self._run("make -j -C $OECORE_TARGET_SYSROOT/usr/src/kernel prepare scripts") - - def test_cryptodev(self): with tempfile.TemporaryDirectory(prefix="cryptodev", dir=self.tc.sdk_dir) as testdir: git_url = "https://github.com/cryptodev-linux/cryptodev-linux" # This is a knnown-good commit post-1.13 that builds with kernel 6.7+ diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py index 20f6b553d0b..42394c7a973 100644 --- a/meta/lib/oeqa/sdk/cases/maturin.py +++ b/meta/lib/oeqa/sdk/cases/maturin.py @@ -16,11 +16,7 @@ errors_have_output() class MaturinTest(OESDKTestCase): def setUp(self): - if not ( - self.tc.hasHostPackage("nativesdk-python3-maturin") - or self.tc.hasHostPackage("python3-maturin-native") - ): - raise unittest.SkipTest("No python3-maturin package in the SDK") + self.ensure_host_package("python3-maturin") def test_maturin_list_python(self): py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'") @@ -49,11 +45,8 @@ class MaturinDevelopTest(OESDKTestCase): def setUp(self): machine = self.td.get("MACHINE") - if not ( - self.tc.hasHostPackage("nativesdk-python3-maturin") - or self.tc.hasHostPackage("python3-maturin-native") - ): - raise unittest.SkipTest("No python3-maturin package in the SDK") + self.ensure_host_package("python3-maturin") + if not ( self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine) ): diff --git a/meta/lib/oeqa/sdk/cases/meson.py b/meta/lib/oeqa/sdk/cases/meson.py index 1edf78720ac..6f773544e3d 100644 --- a/meta/lib/oeqa/sdk/cases/meson.py +++ b/meta/lib/oeqa/sdk/cases/meson.py @@ -22,9 +22,7 @@ class MesonTest(OESDKTestCase): if libc in [ 'newlib' ]: raise unittest.SkipTest("MesonTest class: SDK doesn't contain a supported C library") - if not (self.tc.hasHostPackage("nativesdk-meson") or - self.tc.hasHostPackage("meson-native")): - raise unittest.SkipTest("MesonTest: needs meson") + self.ensure_host_package("meson") def test_epoxy(self): with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir: diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py index 8eab4442e85..a72bd2461a6 100644 --- a/meta/lib/oeqa/sdk/cases/perl.py +++ b/meta/lib/oeqa/sdk/cases/perl.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: MIT # -import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.utils.subprocesstweak import errors_have_output @@ -12,9 +11,7 @@ errors_have_output() class PerlTest(OESDKTestCase): def setUp(self): - if not (self.tc.hasHostPackage("nativesdk-perl") or - self.tc.hasHostPackage("perl-native")): - raise unittest.SkipTest("No perl package in the SDK") + self.ensure_host_package("perl") def test_perl(self): cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py index 51284949f50..b990cd889ad 100644 --- a/meta/lib/oeqa/sdk/cases/python.py +++ b/meta/lib/oeqa/sdk/cases/python.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: MIT # -import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.utils.subprocesstweak import errors_have_output @@ -12,9 +11,7 @@ errors_have_output() class Python3Test(OESDKTestCase): def setUp(self): - if not (self.tc.hasHostPackage("nativesdk-python3-core") or - self.tc.hasHostPackage("python3-core-native")): - raise unittest.SkipTest("No python3 package in the SDK") + self.ensure_host_package("python3-core", recipe="python3") def test_python3(self): cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" From patchwork Sat May 10 08:43:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62724 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 7A6EAC3ABD6 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6621.1746866651564143697 for ; Sat, 10 May 2025 01:44:11 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 350591595 for ; Sat, 10 May 2025 01:44:00 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C490B3F5A1 for ; Sat, 10 May 2025 01:44:10 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 10/23] oeqa/sdk/kmod: skip test in eSDKs Date: Sat, 10 May 2025 09:43:43 +0100 Message-ID: <20250510084400.269726-10-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216258 At the moment we can't run this test inside an eSDK as it needs the kernel-devsrc recipe to be present. Skip the test until this has been resolved. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/kmod.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/lib/oeqa/sdk/cases/kmod.py b/meta/lib/oeqa/sdk/cases/kmod.py index af9fcf5150d..0aa6f702e44 100644 --- a/meta/lib/oeqa/sdk/cases/kmod.py +++ b/meta/lib/oeqa/sdk/cases/kmod.py @@ -9,6 +9,7 @@ import subprocess import tempfile from oeqa.sdk.case import OESDKTestCase +from oeqa.sdkext.context import OESDKExtTestContext from oeqa.utils.subprocesstweak import errors_have_output errors_have_output() @@ -17,6 +18,9 @@ class KernelModuleTest(OESDKTestCase): Test that out-of-tree kernel modules build. """ def test_cryptodev(self): + if isinstance(self.tc, OESDKExtTestContext): + self.skipTest(f"{self.id()} does not support eSDK (https://bugzilla.yoctoproject.org/show_bug.cgi?id=15850)") + self.ensure_target_package("kernel-devsrc") # These targets need to be built before kernel modules can be built. self._run("make -j -C $OECORE_TARGET_SYSROOT/usr/src/kernel prepare scripts") From patchwork Sat May 10 08:43:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62725 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 71752C3ABCF for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6813.1746866652255095509 for ; Sat, 10 May 2025 01:44:12 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D0A60153B for ; Sat, 10 May 2025 01:44:00 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 754C13F5A1 for ; Sat, 10 May 2025 01:44:11 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 11/23] oeqa/sdk/meson: generalise test case Date: Sat, 10 May 2025 09:43:44 +0100 Message-ID: <20250510084400.269726-11-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216259 Refactor this test case so the generic "build a meson project" code is separated out and can be reused. Also currently meson inside eSDKs only works with fully populated eSDKs, but our testing uses minimal eSDKS, so skip the test if the eSDK is a minimal build. A bug has been filed to resolve this. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/meson.py | 51 +++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/meta/lib/oeqa/sdk/cases/meson.py b/meta/lib/oeqa/sdk/cases/meson.py index 6f773544e3d..4fb101f9f73 100644 --- a/meta/lib/oeqa/sdk/cases/meson.py +++ b/meta/lib/oeqa/sdk/cases/meson.py @@ -10,37 +10,54 @@ import tempfile import unittest from oeqa.sdk.case import OESDKTestCase +from oeqa.sdkext.context import OESDKExtTestContext from oeqa.utils.subprocesstweak import errors_have_output errors_have_output() -class MesonTest(OESDKTestCase): - """ - Test that Meson builds correctly. - """ +class MesonTestBase(OESDKTestCase): def setUp(self): libc = self.td.get("TCLIBC") if libc in [ 'newlib' ]: raise unittest.SkipTest("MesonTest class: SDK doesn't contain a supported C library") + if isinstance(self.tc, OESDKExtTestContext): + self.skipTest(f"{self.id()} does not support eSDK (https://bugzilla.yoctoproject.org/show_bug.cgi?id=15854)") + self.ensure_host_package("meson") + self.ensure_host_package("pkgconfig") + + def build_meson(self, sourcedir, builddir, installdir=None, options=""): + """ + Given a source tree in sourcedir, configure it to build in builddir with + the specified options, and if installdir is set also install. + """ + log = self._run(f"meson setup --warnlevel 1 {builddir} {sourcedir} {options}") + + # Check that Meson thinks we're doing a cross build and not a native + self.assertIn("Build type: cross build", log) + + self._run(f"meson compile -C {builddir} -v") + + if installdir: + self._run(f"meson install -C {builddir} --destdir {installdir}") + +class MesonTest(MesonTestBase): + """ + Test that Meson builds correctly. + """ def test_epoxy(self): with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir: tarball = self.fetch(testdir, self.td["DL_DIR"], "https://github.com/anholt/libepoxy/releases/download/1.5.3/libepoxy-1.5.3.tar.xz") - dirs = {} - dirs["source"] = os.path.join(testdir, "libepoxy-1.5.3") - dirs["build"] = os.path.join(testdir, "build") - dirs["install"] = os.path.join(testdir, "install") + sourcedir = os.path.join(testdir, "libepoxy-1.5.3") + builddir = os.path.join(testdir, "build") + installdir = os.path.join(testdir, "install") subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) - self.assertTrue(os.path.isdir(dirs["source"])) - os.makedirs(dirs["build"]) + self.assertTrue(os.path.isdir(sourcedir)) - log = self._run("meson --warnlevel 1 -Degl=no -Dglx=no -Dx11=false {build} {source}".format(**dirs)) - # Check that Meson thinks we're doing a cross build and not a native - self.assertIn("Build type: cross build", log) - self._run("ninja -C {build} -v".format(**dirs)) - self._run("DESTDIR={install} ninja -C {build} -v install".format(**dirs)) - - self.check_elf(os.path.join(dirs["install"], "usr", "local", "lib", "libepoxy.so")) + os.makedirs(builddir) + self.build_meson(sourcedir, builddir, installdir, "-Degl=no -Dglx=no -Dx11=false") + self.assertTrue(os.path.isdir(installdir)) + self.check_elf(os.path.join(installdir, "usr", "local", "lib", "libepoxy.so")) From patchwork Sat May 10 08:43:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62721 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 636E0C3ABD4 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6622.1746866652789275179 for ; Sat, 10 May 2025 01:44:12 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8103D153B for ; Sat, 10 May 2025 01:44:01 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1C9CA3F5A1 for ; Sat, 10 May 2025 01:44:11 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 12/23] core-image-sato: fix SDK dependency on glib Date: Sat, 10 May 2025 09:43:45 +0100 Message-ID: <20250510084400.269726-12-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216260 Adding nativesdk-glib-2.0 to the SDK isn't actually very useful as that is just the library and not the ancillery tools (since [1]). Switch the dependency to glib-2.0-utils so that the host-side tools are available in SDKs. [1] oe-core b649cf5c09a ("glib-2.0: add dependencies to fix ptest failures") Signed-off-by: Ross Burton --- meta/recipes-sato/images/core-image-sato.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb index 9200ae54401..5ff35d772c1 100644 --- a/meta/recipes-sato/images/core-image-sato.bb +++ b/meta/recipes-sato/images/core-image-sato.bb @@ -10,8 +10,8 @@ LICENSE = "MIT" inherit core-image -TOOLCHAIN_HOST_TASK:append = " nativesdk-intltool nativesdk-glib-2.0" -TOOLCHAIN_HOST_TASK:remove:task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0" +TOOLCHAIN_HOST_TASK:append = " nativesdk-intltool nativesdk-glib-2.0-utils" +TOOLCHAIN_HOST_TASK:remove:task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0-utils" QB_MEM = '${@bb.utils.contains("DISTRO_FEATURES", "opengl", "-m 512", "-m 256", d)}' QB_MEM:qemuarmv5 = "-m 256" From patchwork Sat May 10 08:43:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62722 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 61EB6C3ABD3 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6814.1746866653505545286 for ; Sat, 10 May 2025 01:44:13 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2978A153B for ; Sat, 10 May 2025 01:44:02 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C18703F5A1 for ; Sat, 10 May 2025 01:44:12 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 13/23] oeqa/sdk/gtk3: build libhandy instead of galculator Date: Sat, 10 May 2025 09:43:46 +0100 Message-ID: <20250510084400.269726-13-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216261 galculator hasn't been touched for a decade now[1] and fails to compile under GCC 15. Switch to building libhandy, which is the GTK+3 precursor to libadwaita in the Gnome stack. Whilst this is in low-maintainence mode, will be updated if it breaks. [1] https://github.com/galculator/galculator/ Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/gtk3.py | 46 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/meta/lib/oeqa/sdk/cases/gtk3.py b/meta/lib/oeqa/sdk/cases/gtk3.py index 1d953eecf1d..cdaf50ed384 100644 --- a/meta/lib/oeqa/sdk/cases/gtk3.py +++ b/meta/lib/oeqa/sdk/cases/gtk3.py @@ -7,40 +7,34 @@ import os import subprocess import tempfile -import unittest -from oeqa.sdk.case import OESDKTestCase +from oeqa.sdk.cases.meson import MesonTestBase + from oeqa.utils.subprocesstweak import errors_have_output errors_have_output() -class GTK3Test(OESDKTestCase): +class GTK3Test(MesonTestBase): + + def setUp(self): + super().setUp() + self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3") + self.ensure_host_package("glib-2.0-utils", "libglib-2.0-utils", recipe="glib-2.0") + """ Test that autotools and GTK+ 3 compiles correctly. """ - def setUp(self): - libc = self.td.get("TCLIBC") - if libc in [ 'newlib' ]: - raise unittest.SkipTest("GTK3Test class: SDK doesn't contain a supported C library") + def test_libhandy(self): + with tempfile.TemporaryDirectory(prefix="libhandy", dir=self.tc.sdk_dir) as testdir: + tarball = self.fetch(testdir, self.td["DL_DIR"], "https://download.gnome.org/sources/libhandy/1.8/libhandy-1.8.3.tar.xz") - self.ensure_host_package(recipe="intltool") - self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3") - - def test_galculator(self): - with tempfile.TemporaryDirectory(prefix="galculator", dir=self.tc.sdk_dir) as testdir: - tarball = self.fetch(testdir, self.td["DL_DIR"], "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2") - - dirs = {} - dirs["source"] = os.path.join(testdir, "galculator-2.1.4") - dirs["build"] = os.path.join(testdir, "build") - dirs["install"] = os.path.join(testdir, "install") + sourcedir = os.path.join(testdir, "libhandy-1.8.3") + builddir = os.path.join(testdir, "build") + installdir = os.path.join(testdir, "install") subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) - self.assertTrue(os.path.isdir(dirs["source"])) - os.makedirs(dirs["build"]) + self.assertTrue(os.path.isdir(sourcedir)) + os.makedirs(builddir) - self._run("cd {source} && sed -i -e '/s_preferences.*prefs;/d' src/main.c && autoreconf -i -f -I $OECORE_TARGET_SYSROOT/usr/share/aclocal -I m4".format(**dirs)) - self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs)) - self._run("cd {build} && make -j".format(**dirs)) - self._run("cd {build} && make install DESTDIR={install}".format(**dirs)) - - self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "galculator")) + self.build_meson(sourcedir, builddir, installdir, "-Dglade_catalog=disabled -Dintrospection=disabled -Dvapi=false") + self.assertTrue(os.path.isdir(installdir)) + self.check_elf(os.path.join(installdir, "usr", "local", "lib", "libhandy-1.so")) From patchwork Sat May 10 08:43:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62716 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 5142FC3ABCC for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6623.1746866654069239822 for ; Sat, 10 May 2025 01:44:14 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5242153B for ; Sat, 10 May 2025 01:44:02 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 69D563F5A1 for ; Sat, 10 May 2025 01:44:13 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 14/23] oeqa/sdk/meson: add check that meson has detected the target correctly Date: Sat, 10 May 2025 09:43:47 +0100 Message-ID: <20250510084400.269726-14-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216262 Use 'meson introspect' to dump JSON describing the build configuration and validate that the target architectures and cross-compiler is correctly set. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/meson.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta/lib/oeqa/sdk/cases/meson.py b/meta/lib/oeqa/sdk/cases/meson.py index 4fb101f9f73..a809ca3a537 100644 --- a/meta/lib/oeqa/sdk/cases/meson.py +++ b/meta/lib/oeqa/sdk/cases/meson.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT # +import json import os import subprocess import tempfile @@ -36,6 +37,14 @@ class MesonTestBase(OESDKTestCase): # Check that Meson thinks we're doing a cross build and not a native self.assertIn("Build type: cross build", log) + # Check that the cross-compiler used is the one we set. + data = json.loads(self._run(f"meson introspect --compilers {builddir}")) + self.assertIn(self.td.get("CC").split()[0], data["host"]["c"]["exelist"]) + + # Check that the target architectures was set correctly. + data = json.loads(self._run(f"meson introspect --machines {builddir}")) + self.assertEqual(data["host"]["cpu"], self.td["HOST_ARCH"]) + self._run(f"meson compile -C {builddir} -v") if installdir: From patchwork Sat May 10 08:43:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62720 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 4310BC3ABCE for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6624.1746866654707624167 for ; Sat, 10 May 2025 01:44:14 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6CC26153B for ; Sat, 10 May 2025 01:44:03 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 117363F5A1 for ; Sat, 10 May 2025 01:44:13 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 15/23] oeqa/sdk/maturin: be less picky in the list_python test Date: Sat, 10 May 2025 09:43:48 +0100 Message-ID: <20250510084400.269726-15-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216263 The test assumed that maturin would only find a single Python binary, in /usr/bin/python3*. However in eSDKs with buildtools a Python is shipped with the SDK, so the test failed. Generalise the test so that it runs python3 and obtains its path and version, and then verifies that path and and version are found by Maturin. This means we're not assuming a single Python, or the paths, or that the Python is CPython. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/maturin.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py index 42394c7a973..83d13c4ec59 100644 --- a/meta/lib/oeqa/sdk/cases/maturin.py +++ b/meta/lib/oeqa/sdk/cases/maturin.py @@ -19,17 +19,15 @@ class MaturinTest(OESDKTestCase): self.ensure_host_package("python3-maturin") def test_maturin_list_python(self): - py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'") - py_minor = self._run("python3 -c 'import sys; print(sys.version_info.minor)'") - python_version = "%s.%s" % (py_major.strip(), py_minor.strip()) - cmd = "maturin list-python" - output = self._run(cmd) - self.assertRegex(output, r"^ From patchwork Sat May 10 08:43:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62719 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 42129C3ABC3 for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6626.1746866655344310973 for ; Sat, 10 May 2025 01:44:15 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 147AA153B for ; Sat, 10 May 2025 01:44:04 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AD1E83F5A1 for ; Sat, 10 May 2025 01:44:14 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 16/23] oeqa/sdk/maturin: no need for a setupClass, merge code into test Date: Sat, 10 May 2025 09:43:49 +0100 Message-ID: <20250510084400.269726-16-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216264 There's no need to copy files inside setUpClass() when there's only one test function that uses it. Just do all of the test inside the test. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/maturin.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py index 83d13c4ec59..e3e8edc7819 100644 --- a/meta/lib/oeqa/sdk/cases/maturin.py +++ b/meta/lib/oeqa/sdk/cases/maturin.py @@ -30,17 +30,6 @@ class MaturinTest(OESDKTestCase): self.assertIn(expected, output) class MaturinDevelopTest(OESDKTestCase): - @classmethod - def setUpClass(self): - targetdir = os.path.join(self.tc.sdk_dir, "guessing-game") - try: - shutil.rmtree(targetdir) - except FileNotFoundError: - pass - shutil.copytree( - os.path.join(self.tc.files_dir, "maturin/guessing-game"), targetdir - ) - def setUp(self): machine = self.td.get("MACHINE") self.ensure_host_package("python3-maturin") @@ -58,9 +47,17 @@ class MaturinDevelopTest(OESDKTestCase): (1) that a .venv can been created. (2) a functional 'rustc' and 'cargo' """ - self._run("cd %s/guessing-game; python3 -m venv .venv" % self.tc.sdk_dir) - cmd = "cd %s/guessing-game; maturin develop" % self.tc.sdk_dir - output = self._run(cmd) + targetdir = os.path.join(self.tc.sdk_dir, "guessing-game") + try: + shutil.rmtree(targetdir) + except FileNotFoundError: + pass + shutil.copytree( + os.path.join(self.tc.files_dir, "maturin/guessing-game"), targetdir + ) + + self._run("cd %s; python3 -m venv .venv" % targetdir) + output = self._run("cd %s; maturin develop" % targetdir) self.assertRegex(output, r" From patchwork Sat May 10 08:43:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62729 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 CAB0AC3ABDD for ; Sat, 10 May 2025 08:44:16 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6815.1746866656019126055 for ; Sat, 10 May 2025 01:44:16 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B9D9B153B for ; Sat, 10 May 2025 01:44:04 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 54CDF3F5A1 for ; Sat, 10 May 2025 01:44:15 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 17/23] oeqa/sdk/autotools: verify that configure is using the correct host Date: Sat, 10 May 2025 09:43:50 +0100 Message-ID: <20250510084400.269726-17-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216265 Search config.log for the correct host_alias assignment to verify that configure has correctly identified the host system. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/autotools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/lib/oeqa/sdk/cases/autotools.py b/meta/lib/oeqa/sdk/cases/autotools.py index b3a71f2aa50..ee6c522551b 100644 --- a/meta/lib/oeqa/sdk/cases/autotools.py +++ b/meta/lib/oeqa/sdk/cases/autotools.py @@ -36,6 +36,12 @@ class AutotoolsTest(OESDKTestCase): os.makedirs(dirs["build"]) self._run("cd {build} && {source}/configure CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' $CONFIGURE_FLAGS".format(**dirs)) + + # Check that configure detected the target correctly + with open(os.path.join(dirs["build"], "config.log")) as f: + host_sys = self.td["HOST_SYS"] + self.assertIn(f"host_alias='{host_sys}'\n", f.readlines()) + self._run("cd {build} && make CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' -j".format(**dirs)) self._run("cd {build} && make install DESTDIR={install}".format(**dirs)) From patchwork Sat May 10 08:43:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62734 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 C6CD2C3ABCC for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6816.1746866656691999695 for ; Sat, 10 May 2025 01:44:16 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6A968153B for ; Sat, 10 May 2025 01:44:05 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 05D343F5A1 for ; Sat, 10 May 2025 01:44:15 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 18/23] toolchain-scripts: Add Meson settings for Yocto build SDK Date: Sat, 10 May 2025 09:43:51 +0100 Message-ID: <20250510084400.269726-18-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216266 From: Tom Hochstein The Meson settings for the standalone SDK also need to be available for the Yocto build SDK, a.k.a. meta-ide-support. (From OE-Core rev: 6287114bf10718fe49f7c1ed211f3d99f0933bc4) Signed-off-by: Tom Hochstein Signed-off-by: Richard Purdie --- meta/classes-recipe/toolchain-scripts.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index b59a295abcc..9e4320f8762 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -99,6 +99,8 @@ toolchain_create_tree_env_script () { echo 'export OECORE_BASELIB="${baselib}"' >> $script echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script + echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script + echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script toolchain_shared_env_script From patchwork Sat May 10 08:43:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62737 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 D194CC3ABCE for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6627.1746866657379870180 for ; Sat, 10 May 2025 01:44:17 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 123C9153B for ; Sat, 10 May 2025 01:44:06 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AAED73F5A1 for ; Sat, 10 May 2025 01:44:16 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 19/23] toolchain-scripts: Export meson settings for SDK builds Date: Sat, 10 May 2025 09:43:52 +0100 Message-ID: <20250510084400.269726-19-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216267 From: Tom Hochstein Create a new set of exports for the Meson `host_machine` cross settings. This allows the target cross file to be created correctly from meson.cross.template and aligns with meson.bbclass. Note, one might think that HOST_OS and HOST_ARCH would be appropriate as inputs here, aligning nicely with the Meson naming. That turns out to be incorrect since the script is generated in a native/nativesdk build with HOST_OS and HOST_ARCH set for the "build machine", not the "host machine", using the Meson terminology. See https://mesonbuild.com/Cross-compilation.html. Fixes: [YOCTO #15485] (From OE-Core rev: 9e742a0a9078f4a19a5edbfa51f22f7b71992188) Signed-off-by: Tom Hochstein Signed-off-by: Richard Purdie --- meta/classes-recipe/toolchain-scripts.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 9e4320f8762..3053cd0f1fa 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -inherit toolchain-scripts-base siteinfo kernel-arch +inherit toolchain-scripts-base siteinfo kernel-arch meson-routines # We want to be able to change the value of MULTIMACH_TARGET_SYS, because it # doesn't always match our expectations... but we default to the stock value @@ -72,6 +72,10 @@ toolchain_create_sdk_env_script () { echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script + echo 'export OECORE_MESON_HOST_SYSTEM="${@meson_operating_system('TARGET_OS', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU_FAMILY="${@meson_cpu_family('TARGET_ARCH', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU="${TARGET_ARCH}"' >>$script + echo 'export OECORE_MESON_HOST_ENDIAN="${@meson_endian('TARGET', d)}"' >>$script echo 'unset command_not_found_handle' >> $script @@ -101,6 +105,10 @@ toolchain_create_tree_env_script () { echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script + echo 'export OECORE_MESON_HOST_SYSTEM="${@meson_operating_system('TARGET_OS', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU_FAMILY="${@meson_cpu_family('TARGET_ARCH', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU="${TARGET_ARCH}"' >>$script + echo 'export OECORE_MESON_HOST_ENDIAN="${@meson_endian('TARGET', d)}"' >>$script toolchain_shared_env_script From patchwork Sat May 10 08:43:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62738 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 DF79FC3ABCB for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6817.1746866657969157174 for ; Sat, 10 May 2025 01:44:18 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ADEDD153B for ; Sat, 10 May 2025 01:44:06 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 529233F5A1 for ; Sat, 10 May 2025 01:44:17 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 20/23] meson: Fix host_machine setting for native cross-file Date: Sat, 10 May 2025 09:43:53 +0100 Message-ID: <20250510084400.269726-20-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216268 From: Tom Hochstein For native and nativesdk, the meson cross-file settings for `host_machine` are incorrectly set for the build machine, not the "machine on which the compiled binary will run". See https://mesonbuild.com/Cross-compilation.html. Fixes: [YOCTO #15485] (From OE-Core rev: 59d21632aecf1ca9085d17aeda19a8a29602cd17) Signed-off-by: Tom Hochstein Signed-off-by: Richard Purdie --- meta/recipes-devtools/meson/meson_1.8.0.bb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/meta/recipes-devtools/meson/meson_1.8.0.bb b/meta/recipes-devtools/meson/meson_1.8.0.bb index 6e3886e0a58..eb88890cd7f 100644 --- a/meta/recipes-devtools/meson/meson_1.8.0.bb +++ b/meta/recipes-devtools/meson/meson_1.8.0.bb @@ -107,18 +107,14 @@ needs_exe_wrapper = true sys_root = @OECORE_TARGET_SYSROOT [host_machine] -system = '$host_system' -cpu_family = '$host_cpu_family' -cpu = '$host_cpu' -endian = '$host_endian' +system = @OECORE_MESON_HOST_SYSTEM +cpu_family = @OECORE_MESON_HOST_CPU_FAMILY +cpu = @OECORE_MESON_HOST_CPU +endian = @OECORE_MESON_HOST_ENDIAN EOF } do_install:append:class-nativesdk() { - host_system=${SDK_OS} - host_cpu_family=${@meson_cpu_family("SDK_ARCH", d)} - host_cpu=${SDK_ARCH} - host_endian=${@meson_endian("SDK", d)} install_templates install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d @@ -132,10 +128,6 @@ do_install:append:class-nativesdk() { FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" do_install:append:class-native() { - host_system=${HOST_OS} - host_cpu_family=${@meson_cpu_family("HOST_ARCH", d)} - host_cpu=${HOST_ARCH} - host_endian=${@meson_endian("HOST", d)} install_templates install -d ${D}${datadir}/post-relocate-setup.d From patchwork Sat May 10 08:43:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62736 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 D1C85C3ABCF for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6628.1746866658616438811 for ; Sat, 10 May 2025 01:44:18 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56B5F153B for ; Sat, 10 May 2025 01:44:07 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EE80A3F5A1 for ; Sat, 10 May 2025 01:44:17 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 21/23] meson: split template generation Date: Sat, 10 May 2025 09:43:54 +0100 Message-ID: <20250510084400.269726-21-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216269 Split the template generation function into two functions, one for cross and another for native. Signed-off-by: Ross Burton --- meta/recipes-devtools/meson/meson_1.8.0.bb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meta/recipes-devtools/meson/meson_1.8.0.bb b/meta/recipes-devtools/meson/meson_1.8.0.bb index eb88890cd7f..1d1011597b9 100644 --- a/meta/recipes-devtools/meson/meson_1.8.0.bb +++ b/meta/recipes-devtools/meson/meson_1.8.0.bb @@ -65,7 +65,7 @@ def generate_native_link_template(d): return repr(val) -install_templates() { +install_native_template() { install -d ${D}${datadir}/meson cat >${D}${datadir}/meson/meson.native.template <${D}${datadir}/meson/meson.cross.template < X-Patchwork-Id: 62735 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 C6D1CC3DA4A for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6629.1746866659294087369 for ; Sat, 10 May 2025 01:44:19 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0816B153B for ; Sat, 10 May 2025 01:44:08 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 973693F5A1 for ; Sat, 10 May 2025 01:44:18 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 22/23] meson: remove sysroot from the native environment file Date: Sat, 10 May 2025 09:43:55 +0100 Message-ID: <20250510084400.269726-22-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216270 The [properties]sys_root assignment doesn't actually do much in cross builds, and does nothing in native builds (confirmed by the Meson author). Signed-off-by: Ross Burton --- meta/recipes-devtools/meson/meson_1.8.0.bb | 3 --- 1 file changed, 3 deletions(-) diff --git a/meta/recipes-devtools/meson/meson_1.8.0.bb b/meta/recipes-devtools/meson/meson_1.8.0.bb index 1d1011597b9..5d4fc39751b 100644 --- a/meta/recipes-devtools/meson/meson_1.8.0.bb +++ b/meta/recipes-devtools/meson/meson_1.8.0.bb @@ -83,9 +83,6 @@ c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2s c_link_args = ${@generate_native_link_template(d)} cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] cpp_link_args = ${@generate_native_link_template(d)} - -[properties] -sys_root = '@OECORE_NATIVE_SYSROOT' EOF } From patchwork Sat May 10 08:43:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62733 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 C09DCC3ABC3 for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6631.1746866659932409131 for ; Sat, 10 May 2025 01:44:20 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A3A3A153B for ; Sat, 10 May 2025 01:44:08 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 483A73F5A1 for ; Sat, 10 May 2025 01:44:19 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 23/23] meson: clean up the native template in nativesdk builds Date: Sat, 10 May 2025 09:43:56 +0100 Message-ID: <20250510084400.269726-23-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216271 In a nativesdk build, the native build template should be minimal as it just needs to ensure that Meson can link with libraries in the SDK's native sysroot. Specifically, it shouldn't be passing BUILD_* flags to Meson as these are for the Yocto build host, not the SDK user. Signed-off-by: Ross Burton --- meta/recipes-devtools/meson/meson_1.8.0.bb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/meta/recipes-devtools/meson/meson_1.8.0.bb b/meta/recipes-devtools/meson/meson_1.8.0.bb index 5d4fc39751b..78e0a0ed805 100644 --- a/meta/recipes-devtools/meson/meson_1.8.0.bb +++ b/meta/recipes-devtools/meson/meson_1.8.0.bb @@ -86,6 +86,21 @@ cpp_link_args = ${@generate_native_link_template(d)} EOF } +install_nativesdk_template() { + install -d ${D}${datadir}/meson + + cat >${D}${datadir}/meson/meson.native.template <