From patchwork Thu Jul 25 15:30:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 46847 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 E72BAC3DA64 for ; Thu, 25 Jul 2024 15:30:47 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.39438.1721921438291314690 for ; Thu, 25 Jul 2024 08:30:38 -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 06A901007 for ; Thu, 25 Jul 2024 08:31:03 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.oss.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 208BD3F766 for ; Thu, 25 Jul 2024 08:30:37 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/4] setuptools3: check for a PEP517 build system selection Date: Thu, 25 Jul 2024 16:30:26 +0100 Message-Id: <20240725153029.828624-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 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 ; Thu, 25 Jul 2024 15:30:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/202507 Some recipes use setuptools3 but should be using a PEP517-compliant backend, be it the setuptools itself via python_setuptools_build_meta or an alternative backend such as flit/hatch/poetry. As we can't currently assume Python 3.11 on the build host we need to parse the pyproject.toml manually, but this should be sufficient for the limited parsing needed. This task emits a QA error if a build backend is set, and can be ignored by using INSANE_SKIP if needed. [ YOCTO #14736 ] Signed-off-by: Ross Burton --- meta/classes-recipe/setuptools3.bbclass | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meta/classes-recipe/setuptools3.bbclass b/meta/classes-recipe/setuptools3.bbclass index d71a0895398..64a78e9a367 100644 --- a/meta/classes-recipe/setuptools3.bbclass +++ b/meta/classes-recipe/setuptools3.bbclass @@ -12,6 +12,20 @@ SETUPTOOLS_BUILD_ARGS ?= "" SETUPTOOLS_SETUP_PATH ?= "${S}" +python do_check_backend() { + import re + filename = d.expand("${SETUPTOOLS_SETUP_PATH}/pyproject.toml") + if os.path.exists(filename): + for line in open(filename): + match = re.match(r"build-backend\s*=\s*\W([\w.]+)\W", line) + if not match: continue + + msg = f"inherits setuptools3 but has pyproject.toml with {match[1]}, use the correct class" + if "pep517-backend" not in (d.getVar("INSANE_SKIP") or "").split(): + oe.qa.handle_error("pep517-backend", msg, d) +} +addtask check_backend after do_patch before do_configure + setuptools3_do_configure() { : } From patchwork Thu Jul 25 15:30:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 46849 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 34A3EC52CD8 for ; Thu, 25 Jul 2024 15:30:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.39439.1721921438723237123 for ; Thu, 25 Jul 2024 08:30:38 -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 C97D11476 for ; Thu, 25 Jul 2024 08:31:03 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.oss.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 C42033F766 for ; Thu, 25 Jul 2024 08:30:37 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/4] insane: add pep517-backend to WARN_QA Date: Thu, 25 Jul 2024 16:30:27 +0100 Message-Id: <20240725153029.828624-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240725153029.828624-1-ross.burton@arm.com> References: <20240725153029.828624-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 ; Thu, 25 Jul 2024 15:30:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/202508 Enable the new pep517-backend warning from setuptools3, initially as a warning so as not to break builds straight away. Signed-off-by: Ross Burton --- meta/classes-global/insane.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 7bf33f9bc0f..ad38879fa4b 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -26,7 +26,7 @@ # Elect whether a given type of error is a warning or error, they may # have been set by other files. -WARN_QA ?= "32bit-time native-last" +WARN_QA ?= "32bit-time native-last pep517-backend" ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ textrel incompatible-license files-invalid \ infodir build-deps src-uri-bad symlink-to-sysroot multilib \ From patchwork Thu Jul 25 15:30:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 46850 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 09CABC3DA7E for ; Thu, 25 Jul 2024 15:30:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.39106.1721921439337102058 for ; Thu, 25 Jul 2024 08:30:39 -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 6AA441007 for ; Thu, 25 Jul 2024 08:31:04 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.oss.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 7BF273F766 for ; Thu, 25 Jul 2024 08:30:38 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/4] python3-numpy: ignore pep517-backend warnings Date: Thu, 25 Jul 2024 16:30:28 +0100 Message-Id: <20240725153029.828624-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240725153029.828624-1-ross.burton@arm.com> References: <20240725153029.828624-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 ; Thu, 25 Jul 2024 15:30:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/202509 Upstream has a pyproject.toml but it's marked as experimental and does not currently work at all with the meson-python release we currently have. Signed-off-by: Ross Burton --- meta/recipes-devtools/python/python3-numpy_1.26.4.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.4.bb b/meta/recipes-devtools/python/python3-numpy_1.26.4.bb index ccd08147af6..914245507c7 100644 --- a/meta/recipes-devtools/python/python3-numpy_1.26.4.bb +++ b/meta/recipes-devtools/python/python3-numpy_1.26.4.bb @@ -61,4 +61,7 @@ RDEPENDS:${PN}-ptest += "python3-pytest \ ldd \ " +# Upstream has a pyproject.toml but as of 1.26.4 it's marked as experimental +INSANE_SKIP = "pep517-backend" + BBCLASSEXTEND = "native nativesdk" From patchwork Thu Jul 25 15:30:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 46848 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 E8AEDC49EA1 for ; Thu, 25 Jul 2024 15:30:47 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.39440.1721921439959138684 for ; Thu, 25 Jul 2024 08:30:40 -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 22FF31007 for ; Thu, 25 Jul 2024 08:31:05 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.oss.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 3400B3F766 for ; Thu, 25 Jul 2024 08:30:39 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/4] bmaptool: temporarily silence the pep517-backend warning Date: Thu, 25 Jul 2024 16:30:29 +0100 Message-Id: <20240725153029.828624-4-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240725153029.828624-1-ross.burton@arm.com> References: <20240725153029.828624-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 ; Thu, 25 Jul 2024 15:30:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/202510 Whilst bmaptool has a pyproject.toml that uses poetry, the setuptools build path appears to be more complete. Upstream has moved to hatch and removed setup.py entirely so the next release can drop this. Signed-off-by: Ross Burton --- meta/recipes-support/bmaptool/bmaptool_git.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/recipes-support/bmaptool/bmaptool_git.bb b/meta/recipes-support/bmaptool/bmaptool_git.bb index fd53c21c066..c38f05e1a1d 100644 --- a/meta/recipes-support/bmaptool/bmaptool_git.bb +++ b/meta/recipes-support/bmaptool/bmaptool_git.bb @@ -26,4 +26,7 @@ inherit setuptools3 RREPLACES:${PN} = "bmap-tools" RCONFLICTS:${PN} = "bmap-tools" +# Poetry backend appears incomplete, upstream has moved to hatch +INSANE_SKIP = "pep517-backend" + BBCLASSEXTEND = "native nativesdk"