Skip to content

RFC Fix some fallouts with Python free-threading enabled

Zoltán Böszörményi openembedded-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ntpsec: Support Python free-threadingmeta-networking/recipes-support/ntpsec/ntpsec_1.2.4.bb+2 -20 replies
2/6libuser: Support Python free-threadingmeta-gnome/recipes-support/libuser/libuser_0.64.bb+6 -00 replies
3/6libpwquality: Support Python free-threadingmeta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb+1 -10 replies
4/6upm: Support Python free-threadingmeta-oe/recipes-extended/upm/upm_git.bb+1 -10 replies
5/6fontforge: Allow different PYTHON_ABI set for native and targetmeta-oe/recipes-graphics/fontforge/fontforge_20251009.bb+1 -10 replies
6/6opencv: Support Python free-threadingmeta-oe/recipes-support/opencv/opencv_4.13.0.bb+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/6] Fix some fallouts with Python free-threading enabled

This is supplementary to the series entitled "Enable Python free-threading" sent to the openembedded-core mailing list.

Quoting parts of the cover letter from there:

===========================================================================
See https://docs.python.org/3/howto/free-threading-python.html
Quote:

Python support for free threading

Starting with the 3.13 release, CPython has support for a build of Python called free threading where the global interpreter lock (GIL) is disabled. Free-threaded execution allows for full utilization of the available processing power by running threads in parallel on available CPU cores. While not all software will benefit from this automatically, programs designed with threading in mind will run faster on multi-core hardware.

Some third-party packages, in particular ones with an extension module, may not be ready for use in a free-threaded build, and will re-enable the GIL.

...

Compatibility is poor for a lot of modules, that clearly spell this out in their pyproject.toml or PKG-INFO:

"Programming Language :: Python :: Free Threading :: 1 - Unstable"

or something not quite production level support.
It's still experimental for 3rd party modules, despite being officially supported for the interpreter and built-in modules in 3.14.
===========================================================================

That being said, a lot of python modules included in meta-openembedded do build and use the correct site-packages path after applying the two series, i.e. the module is installed into ${libdir}/python3.14t/site-packages

The usual warnings apply: DO NOT TRY THIS AT HOME. If it breaks, you need to keep both pieces.