From patchwork Tue Nov 5 16:12:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 51829 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 33448D2B95C for ; Tue, 5 Nov 2024 16:12:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.23938.1730823155186862333 for ; Tue, 05 Nov 2024 08:12:35 -0800 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 7AC3DFEC for ; Tue, 5 Nov 2024 08:13:04 -0800 (PST) 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 2BC323F6A8 for ; Tue, 5 Nov 2024 08:12:34 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/5] python3-cython: add patch to prefix map source paths in generated files Date: Tue, 5 Nov 2024 16:12:23 +0000 Message-Id: <20241105161227.2324296-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 ; Tue, 05 Nov 2024 16:12:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206718 Cython generates C source code that contains mentions to the original .py files, which results in build paths being embedded inside the binaries. Implement prefix remapping to change these build paths to point at the target debug directory, so that we don't leak build paths and have reproducible builds. This patch is currently not submitted upstream, but will be shortly and I expect it to evolve before being merged. Signed-off-by: Ross Burton --- .../python3-cython/0001-WIP-prefix-map.patch | 148 ++++++++++++++++++ .../python/python3-cython_3.0.11.bb | 1 + 2 files changed, 149 insertions(+) create mode 100644 meta/recipes-devtools/python/python3-cython/0001-WIP-prefix-map.patch diff --git a/meta/recipes-devtools/python/python3-cython/0001-WIP-prefix-map.patch b/meta/recipes-devtools/python/python3-cython/0001-WIP-prefix-map.patch new file mode 100644 index 00000000000..adc9463ffa7 --- /dev/null +++ b/meta/recipes-devtools/python/python3-cython/0001-WIP-prefix-map.patch @@ -0,0 +1,148 @@ +From 4d1b7911372561b22e03c7f2b4ec807502b5b9c1 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Mon, 4 Nov 2024 15:36:39 +0000 +Subject: [PATCH] WIP prefix map + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton +--- + Cython/Compiler/CmdLine.py | 9 ++++++++- + Cython/Compiler/Main.py | 9 +++++---- + Cython/Compiler/Options.py | 1 + + Cython/Compiler/Parsing.py | 1 + + Cython/Compiler/Scanning.py | 9 +++++++-- + 5 files changed, 22 insertions(+), 7 deletions(-) + +diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py +index 776636c..f5a7c79 100644 +--- a/Cython/Compiler/CmdLine.py ++++ b/Cython/Compiler/CmdLine.py +@@ -74,6 +74,12 @@ class SetAnnotateCoverageAction(Action): + namespace.annotate = True + namespace.annotate_coverage_xml = values + ++class SetPrefixMapAction(Action): ++ def __call__(self, parser, namespace, values, option_string=None): ++ mappings = getattr(namespace, self.dest, {}) ++ k, v = values.split("=", 1) ++ mappings[k] = v ++ setattr(namespace, self.dest, mappings) + + def create_cython_argparser(): + description = "Cython (https://cython.org/) is a compiler for code written in the "\ +@@ -157,9 +163,10 @@ def create_cython_argparser(): + 'deduced from the import path if source file is in ' + 'a package, or equals the filename otherwise.') + parser.add_argument('-M', '--depfile', action='store_true', help='produce depfiles for the sources') ++ # TODO: add help ++ parser.add_argument("--prefix-map", action=SetPrefixMapAction) + parser.add_argument('sources', nargs='*', default=[]) + +- # TODO: add help + parser.add_argument("-z", "--pre-import", dest='pre_import', action='store', type=str, help=SUPPRESS) + parser.add_argument("--convert-range", dest='convert_range', action='store_true', help=SUPPRESS) + parser.add_argument("--no-c-in-traceback", dest='c_line_in_traceback', action='store_false', help=SUPPRESS) +diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py +index 80946c0..28cfe68 100644 +--- a/Cython/Compiler/Main.py ++++ b/Cython/Compiler/Main.py +@@ -70,7 +70,7 @@ class Context(object): + language_level = None # warn when not set but default to Py2 + + def __init__(self, include_directories, compiler_directives, cpp=False, +- language_level=None, options=None): ++ language_level=None, prefix_map=None, options=None): + # cython_scope is a hack, set to False by subclasses, in order to break + # an infinite loop. + # Better code organization would fix it. +@@ -83,6 +83,7 @@ class Context(object): + self.future_directives = set() + self.compiler_directives = compiler_directives + self.cpp = cpp ++ self.prefix_map = prefix_map or {} + self.options = options + + self.pxds = {} # full name -> node tree +@@ -98,7 +99,7 @@ class Context(object): + @classmethod + def from_options(cls, options): + return cls(options.include_path, options.compiler_directives, +- options.cplus, options.language_level, options=options) ++ options.cplus, options.language_level, prefix_map=options.prefix_map, options=options) + + def set_language_level(self, level): + from .Future import print_function, unicode_literals, absolute_import, division, generator_stop +@@ -259,7 +260,7 @@ class Context(object): + rel_path = module_name.replace('.', os.sep) + os.path.splitext(pxd_pathname)[1] + if not pxd_pathname.endswith(rel_path): + rel_path = pxd_pathname # safety measure to prevent printing incorrect paths +- source_desc = FileSourceDescriptor(pxd_pathname, rel_path) ++ source_desc = FileSourceDescriptor(pxd_pathname, rel_path, prefix_map=self.prefix_map) + err, result = self.process_pxd(source_desc, scope, qualified_name) + if err: + raise err +@@ -509,7 +510,7 @@ def run_pipeline(source, options, full_module_name=None, context=None): + rel_path = source # safety measure to prevent printing incorrect paths + else: + rel_path = abs_path +- source_desc = FileSourceDescriptor(abs_path, rel_path) ++ source_desc = FileSourceDescriptor(abs_path, rel_path, prefix_map=context.prefix_map) + source = CompilationSource(source_desc, full_module_name, cwd) + + # Set up result object +diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py +index 61950a7..cc52732 100644 +--- a/Cython/Compiler/Options.py ++++ b/Cython/Compiler/Options.py +@@ -796,4 +796,5 @@ default_options = dict( + create_extension=None, + np_pythran=False, + legacy_implicit_noexcept=None, ++ prefix_map=dict(pair.split("=", 1) for pair in os.environ.get("CYTHON_PREFIX_MAP", "").split()), + ) +diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py +index 25c0de9..6c0eccf 100644 +--- a/Cython/Compiler/Parsing.py ++++ b/Cython/Compiler/Parsing.py +@@ -2106,6 +2106,7 @@ def p_include_statement(s, ctx): + s.included_files.append(include_file_name) + with Utils.open_source_file(include_file_path) as f: + source_desc = FileSourceDescriptor(include_file_path) ++ print(f"TODO Cannot use prefix map on {include_file_path}") + s2 = PyrexScanner(f, source_desc, s, source_encoding=f.encoding, parse_comments=s.parse_comments) + tree = p_statement_list(s2, ctx) + return tree +diff --git a/Cython/Compiler/Scanning.py b/Cython/Compiler/Scanning.py +index 372392b..0fa3b30 100644 +--- a/Cython/Compiler/Scanning.py ++++ b/Cython/Compiler/Scanning.py +@@ -195,7 +195,7 @@ class FileSourceDescriptor(SourceDescriptor): + optional name argument and will be passed back when asking for + the position()-tuple. + """ +- def __init__(self, filename, path_description=None): ++ def __init__(self, filename, path_description=None, prefix_map={}): + filename = Utils.decode_filename(filename) + self.path_description = path_description or filename + self.filename = filename +@@ -205,6 +205,7 @@ class FileSourceDescriptor(SourceDescriptor): + self.set_file_type_from_name(filename) + self._cmp_name = filename + self._lines = {} ++ self.prefix_map = prefix_map + + def get_lines(self, encoding=None, error_handling=None): + # we cache the lines only the second time this is called, in +@@ -243,7 +244,11 @@ class FileSourceDescriptor(SourceDescriptor): + return path + + def get_filenametable_entry(self): +- return self.file_path ++ entry = self.file_path ++ for k, v in self.prefix_map.items(): ++ # TODO: should just replace the prefix ++ entry = entry.replace(k, v) ++ return entry + + def __eq__(self, other): + return isinstance(other, FileSourceDescriptor) and self.filename == other.filename diff --git a/meta/recipes-devtools/python/python3-cython_3.0.11.bb b/meta/recipes-devtools/python/python3-cython_3.0.11.bb index 1a42cdcdd0d..57e7848f96c 100644 --- a/meta/recipes-devtools/python/python3-cython_3.0.11.bb +++ b/meta/recipes-devtools/python/python3-cython_3.0.11.bb @@ -7,6 +7,7 @@ SECTION = "devel/python" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c" +SRC_URI += "file://0001-WIP-prefix-map.patch" SRC_URI[sha256sum] = "7146dd2af8682b4ca61331851e6aebce9fe5158e75300343f80c07ca80b1faff" inherit pypi setuptools3 From patchwork Tue Nov 5 16:12:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 51828 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 495E7D31762 for ; Tue, 5 Nov 2024 16:12:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.23939.1730823155655717344 for ; Tue, 05 Nov 2024 08:12:35 -0800 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 0E4771063 for ; Tue, 5 Nov 2024 08:13:05 -0800 (PST) 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 C87013F6A8 for ; Tue, 5 Nov 2024 08:12:34 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/5] classes-recipe: add cython class Date: Tue, 5 Nov 2024 16:12:24 +0000 Message-Id: <20241105161227.2324296-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105161227.2324296-1-ross.burton@arm.com> References: <20241105161227.2324296-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 ; Tue, 05 Nov 2024 16:12:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206719 Recipes that use Cython typically also do some bespoke fixup. Add a class to centralise the logic: - Set CYTHON_PREFIX_MAP to stop build paths appearing in generated objects - Strip "Cython Metadata" blocks from generated code that ends up in the -src package Signed-off-by: Ross Burton --- meta/classes-recipe/cython.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 meta/classes-recipe/cython.bbclass diff --git a/meta/classes-recipe/cython.bbclass b/meta/classes-recipe/cython.bbclass new file mode 100644 index 00000000000..005bc838cc9 --- /dev/null +++ b/meta/classes-recipe/cython.bbclass @@ -0,0 +1,11 @@ +DEPENDS:append = " python3-cython-native" + +# Remap the build paths that appear in generated .c code +export CYTHON_PREFIX_MAP = "${S}=${TARGET_DBGSRC_DIR} ${B}=${TARGET_DBGSRC_DIR}" + +do_compile[postfuncs] = "strip_cython_metadata" +strip_cython_metadata() { + # Remove the Cython Metadata headers that we don't need after the build, and + # may contain build paths. + find ${B} -name "*.c" -print0 | xargs -0 sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d" +} From patchwork Tue Nov 5 16:12:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 51827 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 3C354D2B950 for ; Tue, 5 Nov 2024 16:12:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.23940.1730823156430749988 for ; Tue, 05 Nov 2024 08:12:36 -0800 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 AC3A0FEC for ; Tue, 5 Nov 2024 08:13:05 -0800 (PST) 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 7A3233F6A8 for ; Tue, 5 Nov 2024 08:12:35 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/5] python3-cython: inherit cython Date: Tue, 5 Nov 2024 16:12:25 +0000 Message-Id: <20241105161227.2324296-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105161227.2324296-1-ross.burton@arm.com> References: <20241105161227.2324296-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 ; Tue, 05 Nov 2024 16:12:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206720 As cython is partially built with cython, inherit the cython class and remove the now redundant fixup functions. Also remove the env fix, as the binaries in $bindir are generated by distutils so use the right hashbang. Signed-off-by: Ross Burton --- .../python/python3-cython_3.0.11.bb | 32 +++---------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/meta/recipes-devtools/python/python3-cython_3.0.11.bb b/meta/recipes-devtools/python/python3-cython_3.0.11.bb index 57e7848f96c..81ee1b799cb 100644 --- a/meta/recipes-devtools/python/python3-cython_3.0.11.bb +++ b/meta/recipes-devtools/python/python3-cython_3.0.11.bb @@ -10,7 +10,11 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c" SRC_URI += "file://0001-WIP-prefix-map.patch" SRC_URI[sha256sum] = "7146dd2af8682b4ca61331851e6aebce9fe5158e75300343f80c07ca80b1faff" -inherit pypi setuptools3 +inherit pypi setuptools3 cython + +# No need to depend on self +DEPENDS:remove = "python3-cython-native" + UPSTREAM_CHECK_PYPI_PACKAGE = "Cython" # running build_ext a second time during install fails, because Python @@ -19,38 +23,12 @@ UPSTREAM_CHECK_PYPI_PACKAGE = "Cython" SETUPTOOLS_INSTALL_ARGS += "--skip-build" do_install:append() { - # Make sure we use /usr/bin/env python3 - for PYTHSCRIPT in `grep -rIl '^#!.*python' ${D}`; do - sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT - done - - # remove build paths from generated sources - sed -i -e 's|${WORKDIR}||' ${S}/Cython/*.c ${S}/Cython/Compiler/*.c ${S}/Cython/Plex/*.c - # rename scripts that would conflict with the Python 2 build of Cython mv ${D}${bindir}/cython ${D}${bindir}/cython3 mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3 mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3 } -PACKAGESPLITFUNCS =+ "cython_fix_sources" - -cython_fix_sources () { - for f in ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/FlowControl.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/FusedNode.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/Scanning.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/Visitor.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Plex/Actions.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Plex/Scanners.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Runtime/refnanny.c \ - ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Tempita/_tempita.c \ - ${PKGD}${libdir}/${PYTHON_DIR}/site-packages/Cython*/SOURCES.txt; do - if [ -e $f ]; then - sed -i -e 's#${WORKDIR}/cython-${PV}#${TARGET_DBGSRC_DIR}#g' $f - fi - done -} - RDEPENDS:${PN}:class-target += "\ python3-misc \ python3-netserver \ From patchwork Tue Nov 5 16:12: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: 51826 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 34C88D2B95E for ; Tue, 5 Nov 2024 16:12:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.23808.1730823157066719018 for ; Tue, 05 Nov 2024 08:12:37 -0800 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 5A3B01063 for ; Tue, 5 Nov 2024 08:13:06 -0800 (PST) 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 224253F6A8 for ; Tue, 5 Nov 2024 08:12:36 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/5] python_mesonpy: remove cython-specific INSANE_SKIPs Date: Tue, 5 Nov 2024 16:12:26 +0000 Message-Id: <20241105161227.2324296-4-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105161227.2324296-1-ross.burton@arm.com> References: <20241105161227.2324296-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 ; Tue, 05 Nov 2024 16:12:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206721 These INSANE_SKIPs are specific to cython and unrelated to mesonpy, so remove them. The new cython.bbclass should resolve the cause. Signed-off-by: Ross Burton --- meta/classes-recipe/python_mesonpy.bbclass | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/classes-recipe/python_mesonpy.bbclass b/meta/classes-recipe/python_mesonpy.bbclass index 131fa74bede..81c087c7c75 100644 --- a/meta/classes-recipe/python_mesonpy.bbclass +++ b/meta/classes-recipe/python_mesonpy.bbclass @@ -33,10 +33,6 @@ def mesonpy_get_args(d): PEP517_BUILD_OPTS = "-Cbuilddir='${B}' ${@mesonpy_get_args(d)}" -# Python pyx -> c -> so build leaves absolute build paths in the code -INSANE_SKIP:${PN} += "buildpaths" -INSANE_SKIP:${PN}-src += "buildpaths" - python_mesonpy_do_configure () { python_pep517_do_configure } From patchwork Tue Nov 5 16:12: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: 51830 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 4A80ED31763 for ; Tue, 5 Nov 2024 16:12:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.23809.1730823157453310225 for ; Tue, 05 Nov 2024 08:12:37 -0800 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 026AFFEC for ; Tue, 5 Nov 2024 08:13:07 -0800 (PST) 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 C6CAA3F6A8 for ; Tue, 5 Nov 2024 08:12:36 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 5/5] python3-pyyaml: rearrange recipe Date: Tue, 5 Nov 2024 16:12:27 +0000 Message-Id: <20241105161227.2324296-5-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105161227.2324296-1-ross.burton@arm.com> References: <20241105161227.2324296-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 ; Tue, 05 Nov 2024 16:12:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206722 Sort the recipe into a more traditional order, and remove a duplicated DEPENDS on libyaml. Signed-off-by: Ross Burton --- .../python/python3-pyyaml_6.0.2.bb | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/meta/recipes-devtools/python/python3-pyyaml_6.0.2.bb b/meta/recipes-devtools/python/python3-pyyaml_6.0.2.bb index a41d073af95..10e61274b07 100644 --- a/meta/recipes-devtools/python/python3-pyyaml_6.0.2.bb +++ b/meta/recipes-devtools/python/python3-pyyaml_6.0.2.bb @@ -1,38 +1,39 @@ SUMMARY = "Python support for YAML" -DEPENDS += "libyaml python3-cython-native" HOMEPAGE = "https://pyyaml.org/" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=6d8242660a8371add5fe547adf083079" -inherit pypi python_setuptools_build_meta +DEPENDS += "python3-cython-native" SRC_URI[sha256sum] = "d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e" + +SRC_URI += "\ + https://raw.githubusercontent.com/yaml/pyyaml/a98fd6088e81d7aca571220c966bbfe2ac43c335/tests/test_dump_load.py;name=test \ + file://run-ptest \ +" +SRC_URI[test.sha256sum] = "b6a8a2825d89fdc8aee226560f66b8196e872012a0ea7118cbef1a832359434a" + UPSTREAM_CHECK_PYPI_PACKAGE = "PyYAML" +inherit pypi python_setuptools_build_meta ptest + PACKAGECONFIG ?= "libyaml" PACKAGECONFIG[libyaml] = "--with-libyaml,--without-libyaml,libyaml" +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + cp -rf ${UNPACKDIR}/test_dump_load.py ${D}${PTEST_PATH}/tests/ +} + RDEPENDS:${PN} += "\ python3-datetime \ python3-netclient \ " -inherit ptest -SRC_URI += "\ - https://raw.githubusercontent.com/yaml/pyyaml/a98fd6088e81d7aca571220c966bbfe2ac43c335/tests/test_dump_load.py;name=test \ - file://run-ptest \ -" -SRC_URI[test.sha256sum] = "b6a8a2825d89fdc8aee226560f66b8196e872012a0ea7118cbef1a832359434a" - RDEPENDS:${PN}-ptest += " \ python3-pytest \ python3-unittest-automake-output \ " -do_install_ptest() { - install -d ${D}${PTEST_PATH}/tests - cp -rf ${UNPACKDIR}/test_dump_load.py ${D}${PTEST_PATH}/tests/ -} - BBCLASSEXTEND = "native nativesdk"