diff mbox series

[meta-python,v4,5/6] python3-pandas: fix reproducibility issue

Message ID 20250926081914.3127272-5-hongxu.jia@windriver.com
State Under Review
Headers show
Series [meta-python,v4,1/6] python3-frozenlist: support reproducibility | expand

Commit Message

Hongxu Jia Sept. 26, 2025, 8:19 a.m. UTC
The type of new_value is either `npy_timedelta' or `int64_t'
In build/pandas/_libs/tslibs/timedeltas.cpython-313-x86_64-linux-gnu.so.p/pandas/_libs/tslibs/timedeltas.pyx.c
..
npy_timedelta __pyx_v_new_value;
...

In build/pandas/_libs/tslibs/timedeltas.cpython-313-x86_64-linux-gnu.so.p/pandas/_libs/tslibs/timedeltas.pyx.c
...
__pyx_t_5numpy_int64_t __pyx_v_new_value;
...

Explicitly define it as int64_t to assure the generated source is
reproducibility between builds

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../0001-fix-reproducibility-issue.patch      | 43 +++++++++++++++++++
 .../python/python3-pandas_2.2.3.bb            |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pandas/0001-fix-reproducibility-issue.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pandas/0001-fix-reproducibility-issue.patch b/meta-python/recipes-devtools/python/python3-pandas/0001-fix-reproducibility-issue.patch
new file mode 100644
index 0000000000..deadacafa9
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pandas/0001-fix-reproducibility-issue.patch
@@ -0,0 +1,43 @@ 
+From 80274cd3a0746ddc5421643dd40d47bdf3c6a68c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 26 Sep 2025 15:47:53 +0800
+Subject: [PATCH] fix reproducibility issue
+
+The type of new_value is either `npy_timedelta' or `int64_t'
+In build/pandas/_libs/tslibs/timedeltas.cpython-313-x86_64-linux-gnu.so.p/pandas/_libs/tslibs/timedeltas.pyx.c
+..
+npy_timedelta __pyx_v_new_value;
+...
+
+In build/pandas/_libs/tslibs/timedeltas.cpython-313-x86_64-linux-gnu.so.p/pandas/_libs/tslibs/timedeltas.pyx.c
+...
+__pyx_t_5numpy_int64_t __pyx_v_new_value;
+...
+
+Explicitly define it as int64_t to assure the generated source is
+reproducibility between builds
+
+Upstream-Status: Submitted [https://github.com/pandas-dev/pandas/pull/62459]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ pandas/_libs/tslibs/timedeltas.pyx | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx
+index f6c69cf..34ac9e7 100644
+--- a/pandas/_libs/tslibs/timedeltas.pyx
++++ b/pandas/_libs/tslibs/timedeltas.pyx
+@@ -1820,6 +1820,9 @@ class Timedelta(_Timedelta):
+ 
+         disallow_ambiguous_unit(unit)
+ 
++        cdef:
++            int64_t new_value;
++
+         # GH 30543 if pd.Timedelta already passed, return it
+         # check that only value is passed
+         if isinstance(value, _Timedelta):
+-- 
+2.34.1
+
diff --git a/meta-python/recipes-devtools/python/python3-pandas_2.2.3.bb b/meta-python/recipes-devtools/python/python3-pandas_2.2.3.bb
index f1df026c5c..60cc01800f 100644
--- a/meta-python/recipes-devtools/python/python3-pandas_2.2.3.bb
+++ b/meta-python/recipes-devtools/python/python3-pandas_2.2.3.bb
@@ -8,6 +8,7 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=cb819092901ddb13a7d0a4f5e05f098a"
 
 SRC_URI += " \
             file://0001-pyproject.toml-don-t-pin-dependency-versions.patch \
+            file://0001-fix-reproducibility-issue.patch \
             "
 
 SRC_URI:append:class-target = " file://0001-BLD-add-option-to-specify-numpy-header-location.patch "