Summary: | sys-apps/portage: allow GIL to be disabled in whirlpool C extension | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Zac Medico <zmedico> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | zmedico |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://github.com/gentoo/portage/pull/1344 https://github.com/python/cpython/issues/116322 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 933499 | ||
Bug Blocks: |
Description
Zac Medico
2024-06-13 21:07:17 UTC
There's a PyUnstable_Module_SetGIL() function we can use with single-phase init modules, but it's an unstable API so it seems better to migrate to multi-phase init: https://docs.python.org/3.13/c-api/module.html#c.PyUnstable_Module_SetGIL The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=918f4a4aa82f47291deac496d13c2761f306e01f commit 918f4a4aa82f47291deac496d13c2761f306e01f Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2024-06-16 19:44:37 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2024-06-28 18:15:38 +0000 Allow GIL to be disabled in whirlpool C extension In 3.13 python extensions need to declare support for GIL features, for example if they don't declare Py_MOD_GIL_NOT_USED then it will cause the GIL to be enabled even when python was launched in free-threaded mode. This requires "multi-phase initialization" because Py_mod_create is incompatible with m_slots. There's a PyUnstable_Module_SetGIL() function that can be used with single-phase init, but it's an unstable API, so it's better to use multi-phase init. There's no need to use PyModule_GetState() because the whirlpool module has no mutable state. Bug: https://bugs.gentoo.org/934220 Signed-off-by: Zac Medico <zmedico@gentoo.org> src/portage_util__whirlpool.c | 46 +++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 17 deletions(-) The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02d0e00a1ba811b39140d10e17488f7fc3916534 commit 02d0e00a1ba811b39140d10e17488f7fc3916534 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-09-11 01:30:10 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-09-11 01:30:30 +0000 sys-apps/portage: add 3.0.66 Closes: https://bugs.gentoo.org/435066 Closes: https://bugs.gentoo.org/907061 Closes: https://bugs.gentoo.org/910560 Closes: https://bugs.gentoo.org/933433 Closes: https://bugs.gentoo.org/934220 Closes: https://bugs.gentoo.org/934514 Closes: https://bugs.gentoo.org/934784 Closes: https://bugs.gentoo.org/935830 Closes: https://bugs.gentoo.org/936273 Closes: https://bugs.gentoo.org/937384 Closes: https://bugs.gentoo.org/937485 Closes: https://bugs.gentoo.org/937740 Closes: https://bugs.gentoo.org/937888 Closes: https://bugs.gentoo.org/937891 Closes: https://bugs.gentoo.org/938127 Closes: https://bugs.gentoo.org/933499 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.66.ebuild | 227 +++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) |