dev-vcs/mercurial with USE=rust not working with python 3.12, even with PYTHON_TARGETS="3.11" Error: ImportError: /usr/lib/python3.12/site-packages/mercurial/rustext.cpython-312-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_Ready Reproducible: Always Steps to Reproduce: 1. emerge dev-vcs/mercurial with USE=rust Actual Results: Traceback (most recent call last): File "/usr/lib/python-exec/python3.12/hg", line 59, in <module> dispatch.run() File "/usr/lib/python3.12/site-packages/mercurial/dispatch.py", line 142, in run status = dispatch(req) ^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/dispatch.py", line 231, in dispatch status = _rundispatch(req) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/dispatch.py", line 253, in _rundispatch req.ui = uimod.ui.load() ^^^^^^^^ File "<frozen importlib.util>", line 208, in __getattribute__ File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/usr/lib/python3.12/site-packages/mercurial/ui.py", line 234, in <module> class ui: File "/usr/lib/python3.12/site-packages/mercurial/ui.py", line 2125, in ui ) -> scmutil.progress: ^^^^^^^^^^^^^^^^ File "<frozen importlib.util>", line 208, in __getattribute__ File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/usr/lib/python3.12/site-packages/mercurial/scmutil.py", line 59, in <module> rustrevlog = policy.importrust('revlog') ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/policy.py", line 138, in importrust mod = _importfrom('rustext', modname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/policy.py", line 61, in _importfrom pkg = __import__(pkgname, globals(), fakelocals, [modname], level=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib.util>", line 252, in create_module ImportError: /usr/lib/python3.12/site-packages/mercurial/rustext.cpython-312-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_Ready Expected Results: working mercurial
Same issue here, and it seems to affect all current versions, both stable and unstable. I tried rebuilding mercurial and its dependencies with the python3_11 target and the problem goes away.
I'll try take a look later if cedk doesn't, but I'm changing machines atm.
Looking.
Reproduced w/ trivial `hg` when USE=rust is on: ``` $ hg Traceback (most recent call last): File "/usr/lib/python-exec/python3.12/hg", line 59, in <module> dispatch.run() File "/usr/lib/python3.12/site-packages/mercurial/dispatch.py", line 142, in run status = dispatch(req) ^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/dispatch.py", line 231, in dispatch status = _rundispatch(req) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/dispatch.py", line 253, in _rundispatch req.ui = uimod.ui.load() ^^^^^^^^ File "<frozen importlib.util>", line 208, in __getattribute__ File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/usr/lib/python3.12/site-packages/mercurial/ui.py", line 234, in <module> class ui: File "/usr/lib/python3.12/site-packages/mercurial/ui.py", line 2125, in ui ) -> scmutil.progress: ^^^^^^^^^^^^^^^^ File "<frozen importlib.util>", line 208, in __getattribute__ File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/usr/lib/python3.12/site-packages/mercurial/scmutil.py", line 59, in <module> rustrevlog = policy.importrust('revlog') ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/policy.py", line 138, in importrust mod = _importfrom('rustext', modname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mercurial/policy.py", line 61, in _importfrom pkg = __import__(pkgname, globals(), fakelocals, [modname], level=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib.util>", line 252, in create_module ImportError: /usr/lib/python3.12/site-packages/mercurial/rustext.cpython-312-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_Ready ```
well, _PyUnicode_Ready isn't in Python 3.12, so...
Three choices: 1) We drop 3.12 on mercurial; 2) We p.use.mask USE=rust on mercurial; 3) REQUIRED_USE for rust vs python3_12 I prefer 2). mgorny, cedk?
Wait, they're not using pyo3? This is just insane.
(In reply to Sam James from comment #6) > Three choices: > 1) We drop 3.12 on mercurial; > 2) We p.use.mask USE=rust on mercurial; > 3) REQUIRED_USE for rust vs python3_12 > > I prefer 2). mgorny, cedk? Yeah, mask it.
I think it is better to set REQUIRED_USE for rust vs python3_12 as it reflects better the constraint.
(In reply to Cédric Krier from comment #9) > I think it is better to set REQUIRED_USE for rust vs python3_12 as it > reflects better the constraint. It's poor UX as it means it's not emergable out of the box, is the problem.
(In reply to Sam James from comment #10) > (In reply to Cédric Krier from comment #9) > > I think it is better to set REQUIRED_USE for rust vs python3_12 as it > > reflects better the constraint. > > It's poor UX as it means it's not emergable out of the box, is the problem. But rust still work on other Python version and it is a big performance boost (especially on server side). So we may have users who will unmask it but still compile with python3_12. Also when upstream will fix it, we will have some versions that needs to be masked and others not. For me it seems better to manage that at the ebuild level.
Fedora have coped with removing it entirely, so it can't be that important? ;) Anyway, I won't insist, but I think it's going to be poor for users.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e394eb879bbbe11e85526e7813d989cd87d7084c commit e394eb879bbbe11e85526e7813d989cd87d7084c Author: Cédric Krier <cedk@gentoo.org> AuthorDate: 2024-06-07 16:48:33 +0000 Commit: Cédric Krier <cedk@gentoo.org> CommitDate: 2024-06-07 16:50:05 +0000 dev-vcs/mercurial: forbid rust extension with python3_12 Closes: https://bugs.gentoo.org/933474 Signed-off-by: Cédric Krier <cedk@gentoo.org> dev-vcs/mercurial/mercurial-6.5.3.ebuild | 2 ++ dev-vcs/mercurial/mercurial-6.6.2.ebuild | 2 ++ dev-vcs/mercurial/mercurial-6.7.3.ebuild | 2 ++ dev-vcs/mercurial/mercurial-9999.ebuild | 2 ++ 4 files changed, 8 insertions(+)
*** Bug 933842 has been marked as a duplicate of this bug. ***