Skip to contentSkip to conversation

python3-setuptools: add more comments to a patch

PATCH In review Ross Burton 2 participants 10 messages Nov 7, 2024 – Nov 8, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/8 python3-setuptools: add more comments to a patch

Add more explanatory comments, including when we can drop the patch.

---
 ...-conditionally-do-not-fetch-code-by-easy_install.patch | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3-setuptools/0001-conditionally-do-not-fetch-code-by-easy_install.patch +5 -3
index e227c2889cf..16b316e9cc2 100644
@@ -3,11 +3,13 @@ From: Hongxu Jia <[email protected]>
 Date: Tue, 17 Jul 2018 10:13:38 +0800
 Subject: [PATCH] conditionally do not fetch code by easy_install
 
-If var-NO_FETCH_BUILD is set, do not allow to fetch code from
-internet by easy_install.
+If NO_FETCH_BUILD is set, do not fetch code in easy_install. This avoids setup.py
+trying to fetch missing dependencies at build time.
 
-Upstream-Status: Inappropriate [oe specific]
+This is only used by the deprecated codepath as implemented by setuptools3.bbclass, so
+when that ever gets removed this patch can also be deleted.
 
+Upstream-Status: Denied [https://github.com/pypa/setuptools/issues/4735]
 Signed-off-by: Hongxu Jia <[email protected]>
 ---
  setuptools/command/easy_install.py | 5 +++++
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 2/8 classes/setuptools: do parallel builds in a clean directory

It turns out that by setting DIST_EXTRA_CONFIG you can tell setuptools to read a supplementary configuration file. This lets us pass options that we normally cannot reach via the bdist_wheel command.

Tell the build task to use a build directory outside of the source tree, so that we can clean it before each rebuild.

Tell the build_ext task to do parallel builds, as it defaults to not. In my testing this halves the build time of python3-pandas.

---
 .../python_setuptools_build_meta.bbclass           | 14 ++++++++++++++
 meta/classes-recipe/setuptools3.bbclass            | 12 ++++++++++++
 2 files changed, 26 insertions(+)
meta/classes-recipe/python_setuptools_build_meta.bbclass +14 -0
index 4c84d1e8d0b..3fd42cc9845 100644
@@ -7,3 +7,17 @@
 inherit setuptools3-base python_pep517
 
 DEPENDS += "python3-setuptools-native python3-wheel-native"
+
+B = "${WORKDIR}/build"
+do_configure[cleandirs] += "${B}"
+
+do_compile:prepend() {
+    # Write an extra config file to build in parallel
+    export DIST_EXTRA_CONFIG=${WORKDIR}/setuptools-extra.cfg
+    cat <<EOF >$DIST_EXTRA_CONFIG
+[build]
+build_base = ${B}
+[build_ext]
+parallel = ${@oe.utils.parallel_make(d)}
+EOF
+}
meta/classes-recipe/setuptools3.bbclass +12 -0
index 64a78e9a367..be260093b47 100644
@@ -12,6 +12,8 @@ SETUPTOOLS_BUILD_ARGS ?= ""
 
 SETUPTOOLS_SETUP_PATH ?= "${S}"
 
+B = "${WORKDIR}/build"
+
 python do_check_backend() {
     import re
     filename = d.expand("${SETUPTOOLS_SETUP_PATH}/pyproject.toml")
@@ -29,8 +31,18 @@ addtask check_backend after do_patch before do_configure
 setuptools3_do_configure() {
     :
 }
+do_configure[cleandirs] += "${B}"
 
 setuptools3_do_compile() {
+        # Write an extra config file to build in parallel
+        export DIST_EXTRA_CONFIG=${WORKDIR}/setuptools-extra.cfg
+        cat <<EOF >$DIST_EXTRA_CONFIG
+[build]
+build_base = ${B}
+[build_ext]
+parallel = ${@oe.utils.parallel_make(d)}
+EOF
+
         cd ${SETUPTOOLS_SETUP_PATH}
         NO_FETCH_BUILD=1 \
         STAGING_INCDIR=${STAGING_INCDIR} \
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 3/8 python3-numpy: don't do out-of-tree builds

In reply to Ross Burton

The source generation in numpy appears to be fragile and silently fails when an out-of-tree build is done with setuptools. The result is that importing the numpy library results in failing linkage.

We should move numpy to build with mesonpy, but until that is done we can simply reset B to be at the default location under the source tree.

---
 meta/recipes-devtools/python/python3-numpy_1.26.4.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/python/python3-numpy_1.26.4.bb +3 -0
index 914245507c7..4ffbe0d3708 100644
@@ -23,6 +23,9 @@ DEPENDS += "python3-cython-native"
 inherit ptest setuptools3 github-releases
 
 S = "${WORKDIR}/numpy-${PV}"
+# numpy built with setuptools fails to build correctly when out-of-tree, so
+# until we switch to mesonpy we need this.
+B = "${S}/build"
 
 CLEANBROKEN = "1"
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH v2 4/8 recipes/python: remove obsolete CLEANBROKEN

In reply to Ross Burton

These CLEANBROKENs are obsolete: the classes involved set their own do_configure so the clean in base_do_configure doesn't get ran.

---
 meta/recipes-devtools/python/python3-babel_2.16.0.bb | 2 --
 meta/recipes-devtools/python/python3-click_8.1.7.bb  | 2 --
 meta/recipes-devtools/python/python3-jinja2_3.1.4.bb | 2 --
 meta/recipes-devtools/python/python3-lxml_5.3.0.bb   | 2 --
 meta/recipes-devtools/python/python3-numpy_1.26.4.bb | 2 --
 5 files changed, 10 deletions(-)
meta/recipes-devtools/python/python3-babel_2.16.0.bb +0 -2
index 929d7e99831..34aa7c9a750 100644
@@ -9,8 +9,6 @@ inherit pypi setuptools3
 
 S = "${WORKDIR}/babel-${PV}"
 
-CLEANBROKEN = "1"
-
 RDEPENDS:${PN} += " \
     python3-codecs \
     python3-difflib \
meta/recipes-devtools/python/python3-click_8.1.7.bb +0 -2
index 7d91e1af838..3998d0864f5 100644
@@ -29,8 +29,6 @@ do_install_ptest() {
 
 UPSTREAM_CHECK_REGEX = "click/(?P<pver>\d+(\.\d+)+)/"
 
-CLEANBROKEN = "1"
-
 RDEPENDS:${PN} += "\
     python3-io \
     python3-threading \
meta/recipes-devtools/python/python3-jinja2_3.1.4.bb +0 -2
index a11878496c6..98968ffaec4 100644
@@ -10,8 +10,6 @@ PYPI_PACKAGE = "jinja2"
 
 CVE_PRODUCT = "jinja2 jinja"
 
-CLEANBROKEN = "1"
-
 inherit pypi python_flit_core ptest
 UPSTREAM_CHECK_PYPI_PACKAGE = "Jinja2"
 
meta/recipes-devtools/python/python3-lxml_5.3.0.bb +0 -2
index 4c9c22e5c40..f130b567225 100644
@@ -40,5 +40,3 @@ BBCLASSEXTEND = "native nativesdk"
 RDEPENDS:${PN} += "libxml2 libxslt python3-compression"
 
 CVE_PRODUCT = "lxml"
-
-CLEANBROKEN = "1"
meta/recipes-devtools/python/python3-numpy_1.26.4.bb +0 -2
index 4ffbe0d3708..95614361be0 100644
@@ -27,8 +27,6 @@ S = "${WORKDIR}/numpy-${PV}"
 # until we switch to mesonpy we need this.
 B = "${S}/build"
 
-CLEANBROKEN = "1"
-
 do_compile:prepend() {
     export NPY_DISABLE_SVML=1
 }
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 5/8 python3-cython: add patch to prefix map source paths in generated files

In reply to Ross Burton

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.

---
 .../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
meta/recipes-devtools/python/python3-cython/0001-WIP-prefix-map.patch new file +148 -0
new file mode 100644
index 00000000000..adc9463ffa7
@@ -0,0 +1,148 @@
+From 4d1b7911372561b22e03c7f2b4ec807502b5b9c1 Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+Date: Mon, 4 Nov 2024 15:36:39 +0000
+Subject: [PATCH] WIP prefix map
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <[email protected]>
+---
+ 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
meta/recipes-devtools/python/python3-cython_3.0.11.bb +1 -0
index 980cb046365..efce67d0921 100644
@@ -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
Signature · 1 line
2.34.1
#5 lore raw

PATCH v2 6/8 classes-recipe: add cython class

In reply to Ross Burton

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

---
 meta/classes-recipe/cython.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 meta/classes-recipe/cython.bbclass
meta/classes-recipe/cython.bbclass new file +11 -0
new file mode 100644
index 00000000000..f37ebeb23fe
@@ -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 ${S} -name "*.c" -print0 | xargs -0 sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d"
+}
Signature · 1 line
2.34.1
#6 lore raw

PATCH v2 7/8 python3-*: inherit cython

In reply to Ross Burton

Change recipes that depend on python3-cython-native to inherit cython instead.

---
 .../python/python3-cython_3.0.11.bb           | 32 +++----------------
 .../python/python3-numpy_1.26.4.bb            |  4 +--
 .../python/python3-pyyaml_6.0.2.bb            |  4 +--
 3 files changed, 7 insertions(+), 33 deletions(-)
meta/recipes-devtools/python/python3-cython_3.0.11.bb +5 -27
index efce67d0921..020a8e7205c 100644
@@ -10,42 +10,20 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c"
 SRC_URI += "file://0001-WIP-prefix-map.patch"
 SRC_URI[sha256sum] = "7146dd2af8682b4ca61331851e6aebce9fe5158e75300343f80c07ca80b1faff"
 
-inherit pypi setuptools3
-UPSTREAM_CHECK_PYPI_PACKAGE = "Cython"
+inherit pypi setuptools3 cython
 
-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
+# No need to depend on self
+DEPENDS:remove = "python3-cython-native"
 
-    # remove build paths from generated sources
-    sed -i -e 's|${WORKDIR}||' ${S}/Cython/*.c ${S}/Cython/Compiler/*.c ${S}/Cython/Plex/*.c
+UPSTREAM_CHECK_PYPI_PACKAGE = "Cython"
 
+do_install:append() {
     # 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 \
meta/recipes-devtools/python/python3-numpy_1.26.4.bb +1 -3
index 95614361be0..7de92f687c3 100644
@@ -18,9 +18,7 @@ SRC_URI[sha256sum] = "2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4
 GITHUB_BASE_URI = "https://github.com/numpy/numpy/releases"
 UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$"
 
-DEPENDS += "python3-cython-native"
-
-inherit ptest setuptools3 github-releases
+inherit ptest setuptools3 github-releases cython
 
 S = "${WORKDIR}/numpy-${PV}"
 # numpy built with setuptools fails to build correctly when out-of-tree, so
meta/recipes-devtools/python/python3-pyyaml_6.0.2.bb +1 -3
index 10e61274b07..9f9320a5949 100644
@@ -4,8 +4,6 @@ HOMEPAGE = "https://pyyaml.org/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=6d8242660a8371add5fe547adf083079"
 
-DEPENDS += "python3-cython-native"
-
 SRC_URI[sha256sum] = "d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"
 
 SRC_URI += "\
@@ -16,7 +14,7 @@ SRC_URI[test.sha256sum] = "b6a8a2825d89fdc8aee226560f66b8196e872012a0ea7118cbef1
 
 UPSTREAM_CHECK_PYPI_PACKAGE = "PyYAML"
 
-inherit pypi python_setuptools_build_meta ptest
+inherit pypi python_setuptools_build_meta ptest cython
 
 PACKAGECONFIG ?= "libyaml"
 PACKAGECONFIG[libyaml] = "--with-libyaml,--without-libyaml,libyaml"
Signature · 1 line
2.34.1
#7 lore raw

PATCH v2 8/8 python_mesonpy: remove cython-specific INSANE_SKIPs

In reply to Ross Burton

These INSANE_SKIPs are specific to cython and unrelated to mesonpy, so remove them. The new cython.bbclass should resolve the cause.

---
 meta/classes-recipe/python_mesonpy.bbclass | 4 ----
 1 file changed, 4 deletions(-)
meta/classes-recipe/python_mesonpy.bbclass +0 -4
index 131fa74bede..81c087c7c75 100644
@@ -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
 }
Signature · 1 line
2.34.1
#8 lore raw
In reply to Ross Burton
Quoted 3 lines · Ross Burton

Add more explanatory comments, including when we can drop the patch.

Hi Ross,

Thanks for the v2, but I suspect it is still responsible for some failures on the autobuilder.

First we have some reproducibility issues on numpy. (Issues on piglit are probably linked to the build fail described below).

AssertionError: Bitbake reproducibleA failure
The following deb packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/python3-numpy-dbg_1.26.4-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/python3-numpy_1.26.4-r0_amd64.deb The following deb packages are missing and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/piglit-bash-completion_1.0+gitr0+c11c9374c1-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/piglit-dbg_1.0+gitr0+c11c9374c1-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/piglit-dev_1.0+gitr0+c11c9374c1-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/piglit-doc_1.0+gitr0+c11c9374c1-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/piglit_1.0+gitr0+c11c9374c1-r0_amd64.deb The following ipk packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/python3-numpy-dbg_1.26.4-r0_core2-64.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/python3-numpy_1.26.4-r0_core2-64.ipk The following ipk packages are missing and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/piglit-bash-completion_1.0+gitr0+c11c9374c1-r0_core2-64.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/piglit-dbg_1.0+gitr0+c11c9374c1-r0_core2-64.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/piglit-dev_1.0+gitr0+c11c9374c1-r0_core2-64.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/piglit-doc_1.0+gitr0+c11c9374c1-r0_core2-64.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./core2-64/piglit_1.0+gitr0+c11c9374c1-r0_core2-64.ipk The following rpm packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/python3-numpy-1.26.4-r0.core2_64.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/python3-numpy-dbg-1.26.4-r0.core2_64.rpm The following rpm packages are missing and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/piglit-1.0+gitr0+c11c9374c1-r0.core2_64.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/piglit-bash-completion-1.0+gitr0+c11c9374c1-r0.core2_64.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/piglit-dbg-1.0+gitr0+c11c9374c1-r0.core2_64.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/piglit-dev-1.0+gitr0+c11c9374c1-r0.core2_64.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./core2_64/piglit-doc-1.0+gitr0+c11c9374c1-r0.core2_64.rpm

https://valkyrie.yoctoproject.org/#/builders/37/builds/421/steps/13/logs/stdio

Diffoscope output can be found here:
https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20241108-wkf8tasz/packages/

There is also a build error on piglit. I'm not sure but I suspect this is also caused by these patches, as piglit depends on numpy. I will confirm this with a new build today.

| CMake Error at /srv/pokybuild/yocto-worker/qemux86-world/build/build/tmp/work/core2-64-poky-linux/piglit/1.0+gitr/recipe-sysroot-native/usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
| Could NOT find PythonNumpy (missing: PythonNumpy_STATUS) (Required
is at
| least version "1.7.0")

https://valkyrie.yoctoproject.org/#/builders/59/builds/399/steps/11/logs/stdio

Can you have a look at these issues please ?

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw
Quoted 10 lines · Mathieu Dubois-Briand
Quoted 3 lines · Ross Burton

Add more explanatory comments, including when we can drop the patch.

Hi Ross,

Thanks for the v2, but I suspect it is still responsible for some failures on the autobuilder.

I just pulled out the parallel/out-of-tree changes and sent v3 with just the cython changes, which are the important ones.

I’ll glare at setuptools harder, later.

Sorry about this. I just verified that qemux86-world built piglit fine for me with this branch: https://valkyrie.yoctoproject.org/#/builders/59/builds/401 and I hope the reproducibility thing is due to ordering changes thanks to the parallelism.

Ross