libgpiod icon indicating copy to clipboard operation
libgpiod copied to clipboard

bindings: python: investigate free threaded builds

Open vfazio opened this issue 1 year ago • 3 comments

@brgl 3.13 was released just a few days ago. We can certainly add 3.13 wheels. I think we'd skip free-threaded wheels for now, however, as I'm not up-to-date on that feature and what changes may be required from the bindings to play nice in a GIL-less build.

Ha! Is there any writeup on this? I would definitely want to make sure the bindings to work fine without the GIL.

https://peps.python.org/pep-0703/

https://docs.python.org/3/whatsnew/3.13.html#free-threaded-cpython

https://docs.python.org/3/c-api/module.html#c.Py_mod_gil

https://py-free-threading.github.io/porting/

Originally posted by @vfazio in https://github.com/brgl/libgpiod/issues/93#issuecomment-2405210680

vfazio avatar Dec 07 '24 17:12 vfazio

I don't know if we should be defensive and throw a compile error if a gil-less build is attempted until we've had a chance to test and validate everything works as expected.

vfazio avatar Dec 08 '24 16:12 vfazio

Does any distro ship GIL-less python 3.13 yet? I'm pretty sure it will make its way into yocto soon, this is when I'll most likely start playing with it. Until then, I don't think we should really do anything about it.

brgl avatar Dec 09 '24 09:12 brgl

@brgl looks like Fedora ships 3.13 as part of f41+: https://docs.fedoraproject.org/en-US/fedora/latest/release-notes/developers/

and it looks like there are build changes and rpms for freethreading, at least for f42, but they're probably also available for f41

https://src.fedoraproject.org/rpms/python3.13/c/84d78b385a57306af12b04922f60d516e6e8be49

https://koji.fedoraproject.org/koji/buildinfo?buildID=2599772

https://koji.fedoraproject.org/koji/rpminfo?rpmID=40917017

vfazio avatar Dec 10 '24 13:12 vfazio