From d7d8a0ec9534e9d142a4317e63e3b0f191cc6b63 Mon Sep 17 00:00:00 2001 From: f321x Date: Wed, 9 Sep 2026 18:16:08 +0200 Subject: [PATCH] python3: keep the order of patches and configure args stable `patches` and `configure_args` are deduplicated with `list(set(...))`, whose order depends on PYTHONHASHSEED. The configure arguments end up in the shipped `_sysconfigdata` module (CONFIG_ARGS), so two otherwise identical builds can differ, and the patches are applied in a different order on every run. Use an order-preserving dedup instead to help with reproducible builds. Upstreamed from https://github.com/spesmilo/python-for-android --- pythonforandroid/recipes/python3/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/recipes/python3/__init__.py b/pythonforandroid/recipes/python3/__init__.py index f3d52ef4c3..3da132d698 100644 --- a/pythonforandroid/recipes/python3/__init__.py +++ b/pythonforandroid/recipes/python3/__init__.py @@ -206,7 +206,7 @@ def apply_patches(self, arch, build_dir=None): elif _p_version.minor >= 8: self.patches.append("patches/py3.8.1_fix_cortex_a8.patch") - self.patches = list(set(self.patches)) + self.patches = list(dict.fromkeys(self.patches)) # preserve order for reproducibility super().apply_patches(arch, build_dir) def include_root(self, arch_name): @@ -333,7 +333,7 @@ def add_flags(include_flags, link_dirs, link_libs): if _p_version.minor >= 13 and self.disable_gil: self.configure_args.append("--disable-gil") - self.configure_args = list(set(self.configure_args)) + self.configure_args = list(dict.fromkeys(self.configure_args)) # preserve order for reproducibility return env