Skip to contentSkip to conversation

python3-cython: upgrade 3.2.9 -> 3.3.1

PATCH Superseded Thomas Roos 3 participants 4 messages Nov 8 – Nov 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-cython: upgrade 3.2.9 -> 3.3.1

PyAV 19.0.0, which Home Assistant 2026.11 pins for its stream and generic camera integrations, requires Cython 3.3: its generated code uses __Pyx_BEGIN_CRITICAL_SECTION, which Cython 3.2 does not provide.

Refresh the line numbers of the build path patch for 3.3.1.

License-Update: none, LICENSE.txt is unchanged.
AI-Generated: Claude Code, Claude Opus 5.5

---

PyAV 19.0.0 (needed by Home Assistant 2026.11) requires Cython >= 3.3.0. Built with this upgrade for qemux86-64: python3-av 19.0.0, aiohttp, yarl, multidict, frozenlist, propcache (with its 0.5.4 upgrade in meta-python), numpy, pandas, scipy and uvloop. python3-propcache 0.4.1 in meta-python pins Cython ~= 3.2.0 and fails with this patch; the meta-python series upgrades it to 0.5.4, so the two should land together. Checked with bodnuti: patchtest 10 pass, 0 fail; no new findings.

Related changes for the Home Assistant 2026.11 upgrade. They belong together and are meant to land as a set:

- openembedded-core: python3-cython 3.2.9 -> 3.3.1
https://github.com/thomas-roos/openembedded-core/commits/ha-2026.11
- meta-openembedded (meta-python): two series, fixes (6) and updates (13)
https://github.com/thomas-roos/meta-openembedded/commits/ha-2026.11
- meta-python-ai: 7 upgrades
https://github.com/zboszor/meta-python-ai/pull/46
- meta-homeassistant: Home Assistant 2026.3.1 -> 2026.11.0
https://github.com/meta-homeassistant/meta-homeassistant/pull/207

AI disclosure: the patch and its commit message were written with Claude Code (Claude Opus 5.5), as the AI-Generated tag says. I reviewed the change and ran the builds above.

 ...1-Replace-not-predictable-build-path-prefix-with-hardc.patch | 2 +-
 .../python/{python3-cython_3.2.9.bb => python3-cython_3.3.1.bb} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename meta/recipes-devtools/python/{python3-cython_3.2.9.bb => python3-cython_3.3.1.bb} (93%)
meta/recipes-devtools/python/python3-cython/0001-Replace-not-predictable-build-path-prefix-with-hardc.patch +1 -1
index 573a53ee56..9481b9c16f 100644
@@ -56,7 +56,7 @@ diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
 index 34f1b32..b09350b 100644
 --- a/Cython/Compiler/ModuleNode.py
 +++ b/Cython/Compiler/ModuleNode.py
-@@ -877,7 +877,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
+@@ -899,7 +899,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
          code.put_generated_by()
          if metadata:
              code.putln("/* BEGIN: Cython Metadata")
meta/recipes-devtools/python/python3-cython_3.3.1.bb renamed from meta/recipes-devtools/python/python3-cython_3.2.9.bb +1 -1
similarity index 93%
rename from meta/recipes-devtools/python/python3-cython_3.2.9.bb
rename to meta/recipes-devtools/python/python3-cython_3.3.1.bb
index 3457a91490..49f1e83cb0 100644
@@ -7,7 +7,7 @@ SECTION = "devel/python"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c"
 
-SRC_URI[sha256sum] = "d249c9022ab13286b17bd66f30609e800c5f95efeecb06168990c7a66cecde6c"
+SRC_URI[sha256sum] = "e0e45989e821bef6aa9ae15c7d583ab5e055f7406c4b3624e49e06d24e90375a"
 
 inherit pypi setuptools3 cython
 
Signature · 1 line
2.56.0
#1 lore raw

PATCH v2 1/1 python3-cython: upgrade 3.2.9 -> 3.3.1

PyAV 19.0.0, which Home Assistant 2026.11 pins for its stream and generic camera integrations, requires Cython 3.3: its generated code uses __Pyx_BEGIN_CRITICAL_SECTION, which Cython 3.2 does not provide.

3.3.1 contains the upstream fixes for the non-deterministic generated code that held back the 3.3.0 upgrade (cython#8045, #7982, #8025).

Cython 3.3 still fails intermittently when it builds itself in parallel (cython#7997; #8008 and #8013 are not merged). Clean builds of python3-cython-native with PARALLEL_MAKE = "-j 32" failed 6 out of 20 times with 3.3.1 (and 8 out of 20 with 3.3.0), with the refnanny error seen on the autobuilder. With PARALLEL_MAKE = "" all 20 builds passed, so build serially for now.

Refresh the line numbers of the build path patch for 3.3.1.

License-Update: none, LICENSE.txt is unchanged.
AI-Generated: Claude Code, Claude Opus 5.5

---

Changes in v2:
- Build serially (PARALLEL_MAKE = ""). Cython 3.3 races when setuptools runs cythonize in threads (cython#7997, still open; #8008 and #8013 are not merged). Clean builds of python3-cython-native with PARALLEL_MAKE = "-j 32" failed 6 of 20 times with 3.3.1 and 8 of 20 times with 3.3.0, with the refnanny error from the autobuilder ("'__Pyx_refnanny_mutex' redeclared", "C attributes cannot be added in implementation part of extension type"). With PARALLEL_MAKE = "" all 20 builds of 3.3.1 passed. v1 did not have this and would have failed on the autobuilder sooner or later.
With cython PR #8008 applied on top of 3.3.1 the parallel build passed 20 of 20 times as well, so the serial build can go once a release contains that fix.

Ross, this follows your 3.3.0 upgrade that was held back for reproducibility and these build failures. 3.3.1 contains the fixes for the non-deterministic generated code (#8045 via #7982, #8025, 0a948c7d). I have not run the reproducibility selftest. If you would rather carry this on with your patch, please drop mine.

PyAV 19.0.0 (needed by Home Assistant 2026.11) requires Cython >= 3.3.0. Built with this upgrade for qemux86-64: python3-av 19.0.0, aiohttp, yarl, multidict, frozenlist, propcache (with its 0.5.4 upgrade in meta-python), numpy, pandas, scipy and uvloop.

Related changes for the Home Assistant 2026.11 upgrade:
- meta-openembedded (meta-python): two series, fixes and updates
- meta-python-ai: https://github.com/zboszor/meta-python-ai/pull/46
- meta-homeassistant: https://github.com/meta-homeassistant/meta-homeassistant/pull/207

AI disclosure: the patch, its commit message and these notes were written with Claude Code (Claude Opus 5.5), which also ran the build tests above in my build environment. I reviewed the change.

 ...ace-not-predictable-build-path-prefix-with-hardc.patch | 2 +-
 .../{python3-cython_3.2.9.bb => python3-cython_3.3.1.bb}  | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
 rename meta/recipes-devtools/python/{python3-cython_3.2.9.bb => python3-cython_3.3.1.bb} (78%)
meta/recipes-devtools/python/python3-cython/0001-Replace-not-predictable-build-path-prefix-with-hardc.patch +1 -1
index 573a53ee56..9481b9c16f 100644
@@ -56,7 +56,7 @@ diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
 index 34f1b32..b09350b 100644
 --- a/Cython/Compiler/ModuleNode.py
 +++ b/Cython/Compiler/ModuleNode.py
-@@ -877,7 +877,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
+@@ -899,7 +899,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
          code.put_generated_by()
          if metadata:
              code.putln("/* BEGIN: Cython Metadata")
meta/recipes-devtools/python/python3-cython_3.3.1.bb renamed from meta/recipes-devtools/python/python3-cython_3.2.9.bb +7 -1
similarity index 78%
rename from meta/recipes-devtools/python/python3-cython_3.2.9.bb
rename to meta/recipes-devtools/python/python3-cython_3.3.1.bb
index 3457a91490..75cde4ef70 100644
@@ -7,12 +7,18 @@ SECTION = "devel/python"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c"
 
-SRC_URI[sha256sum] = "d249c9022ab13286b17bd66f30609e800c5f95efeecb06168990c7a66cecde6c"
+SRC_URI[sha256sum] = "e0e45989e821bef6aa9ae15c7d583ab5e055f7406c4b3624e49e06d24e90375a"
 
 inherit pypi setuptools3 cython
 
 SRC_URI += "file://0001-Replace-not-predictable-build-path-prefix-with-hardc.patch"
 
+# Cython 3.3 races when it builds itself in parallel: setuptools runs
+# cythonize in threads and Cython keeps global state, which fails
+# intermittently (https://github.com/cython/cython/issues/7997, not fixed
+# in 3.3.1). Build serially until upstream fixes it.
+PARALLEL_MAKE = ""
+
 # No need to depend on self
 DEPENDS:remove = "python3-cython-native"
 
Signature · 1 line
2.56.0
#2 lore raw
Quoted 14 lines · Thomas Roos via openembedded-core

PyAV 19.0.0, which Home Assistant 2026.11 pins for its stream and generic camera integrations, requires Cython 3.3: its generated code uses __Pyx_BEGIN_CRITICAL_SECTION, which Cython 3.2 does not provide.

3.3.1 contains the upstream fixes for the non-deterministic generated code that held back the 3.3.0 upgrade (cython#8045, #7982, #8025).

Cython 3.3 still fails intermittently when it builds itself in parallel (cython#7997; #8008 and #8013 are not merged). Clean builds of python3-cython-native with PARALLEL_MAKE = "-j 32" failed 6 out of 20 times with 3.3.1 (and 8 out of 20 with 3.3.0), with the refnanny error seen on the autobuilder. With PARALLEL_MAKE = "" all 20 builds passed, so build serially for now.

Quoted 6 lines

Refresh the line numbers of the build path patch for 3.3.1.

License-Update: none, LICENSE.txt is unchanged.
AI-Generated: Claude Code, Claude Opus 5.5

---

Hi Thomas,

Thanks for the new version.

It does look better, but it looks like we still see some intermittent reproducibility issues. I had it on my branch for a few days, and suddenly we had a failed test:

AssertionError: The following deb packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./x86-64-v3/python3-cython-dbg_3.3.1-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./x86-64-v3/python3-cython-src_3.3.1-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./x86-64-v3/python3-cython_3.3.1-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/./x86-64-v3/python3-cython-dbg_3.3.1-r0_x86-64-v3.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./x86-64-v3/python3-cython-src_3.3.1-r0_x86-64-v3.ipk /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./x86-64-v3/python3-cython_3.3.1-r0_x86-64-v3.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/./x86_64_v3/python3-cython-3.3.1-r0.x86_64_v3.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./x86_64_v3/python3-cython-dbg-3.3.1-r0.x86_64_v3.rpm /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./x86_64_v3/python3-cython-src-3.3.1-r0.x86_64_v3.rpm

https://autobuilder.yoctoproject.org/valkyrie/#/builders/37/builds/5342
https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20261111-opb4ps2w/packages/diff-html/

Can you have a look at the issue?

Thanks,
Mathieu

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

It does look better, but it looks like we still see some intermittent reproducibility issues. I had it on my branch for a few days, and suddenly we had a failed test:

I’ve filed an upstream ticket at https://github.com/cython/cython/issues/8136.

Ross