summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python3-cython/0001-Replace-not-predictable-build-path-prefix-with-hardc.patch72
-rw-r--r--meta/recipes-devtools/python/python3-cython_3.1.3.bb4
2 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-cython/0001-Replace-not-predictable-build-path-prefix-with-hardc.patch b/meta/recipes-devtools/python/python3-cython/0001-Replace-not-predictable-build-path-prefix-with-hardc.patch
new file mode 100644
index 0000000000..1fbbd8fd48
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-cython/0001-Replace-not-predictable-build-path-prefix-with-hardc.patch
@@ -0,0 +1,72 @@
1From 1690c505f1387e1884565021991a162e2f88f2b9 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 17 Sep 2025 01:42:08 -0700
4Subject: [PATCH] Replace not predictable build path prefix with hardcode
5 string in the generated output file
6
7The build path may contain tmp dir which is not predictable, it caused
8the generated output file is not stable at each build and made
9the generated library is not reproducible [1] between builds
10
11vim frozenlist/_frozenlist.cpp
12...
13/* BEGIN: Cython Metadata
14{
15 "distutils": {
16 "depends": [],
17 "language": "c++",
18 "name": "frozenlist._frozenlist",
19 "sources": [
20 "/tmp/.tmp-frozenlist-pep517-cfdvygni/src/frozenlist/_frozenlist.pyx"
21 ]
22 },
23 "module_name": "frozenlist._frozenlist"
24}
25END: Cython Metadata */
26...
27
28Replace build path prefix with hardcode `build_path', it is no harm to
29tweak comments in source file, after applied this commit,
30vim frozenlist/_frozenlist.cpp
31...
32/* BEGIN: Cython Metadata
33{
34 "distutils": {
35 "depends": [],
36 "language": "c++",
37 "name": "frozenlist._frozenlist",
38 "sources": [
39 "build_path/frozenlist/_frozenlist.pyx"
40 ]
41 },
42 "module_name": "frozenlist._frozenlist"
43}
44END: Cython Metadata */
45...
46
47[1] https://reproducible-builds.org/
48
49Upstream-Status: Submitted [https://github.com/cython/cython/pull/7162]
50Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
51---
52 Cython/Compiler/ModuleNode.py | 4 +++-
53 1 file changed, 3 insertions(+), 1 deletion(-)
54
55diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
56index 6672cb986..b1123515e 100644
57--- a/Cython/Compiler/ModuleNode.py
58+++ b/Cython/Compiler/ModuleNode.py
59@@ -779,7 +779,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
60 code.put_generated_by()
61 if metadata:
62 code.putln("/* BEGIN: Cython Metadata")
63- code.putln(json.dumps(metadata, indent=4, sort_keys=True))
64+ _metadata = json.dumps(metadata, indent=4, sort_keys=True)
65+ _metadata = _metadata.replace(os.getcwd(), 'build_path')
66+ code.putln(_metadata)
67 code.putln("END: Cython Metadata */")
68 code.putln("")
69
70--
712.49.0
72
diff --git a/meta/recipes-devtools/python/python3-cython_3.1.3.bb b/meta/recipes-devtools/python/python3-cython_3.1.3.bb
index dcb61a3634..3b2835d9c5 100644
--- a/meta/recipes-devtools/python/python3-cython_3.1.3.bb
+++ b/meta/recipes-devtools/python/python3-cython_3.1.3.bb
@@ -11,6 +11,10 @@ SRC_URI[sha256sum] = "10ee785e42328924b78f75a74f66a813cb956b4a9bc91c44816d089d59
11 11
12inherit pypi setuptools3 cython 12inherit pypi setuptools3 cython
13 13
14SRC_URI += " \
15 file://0001-Replace-not-predictable-build-path-prefix-with-hardc.patch \
16"
17
14# No need to depend on self 18# No need to depend on self
15DEPENDS:remove = "python3-cython-native" 19DEPENDS:remove = "python3-cython-native"
16 20