> Package: mercurial
> Version: 6.8-1
> Severity: grave
> Justification: renders package unusable
>
> Dear maintainer,
>
> In current sid, with python 3.12.4-3, mercurial fails at load with:

Hi all,

I introduced the patches to Python to resolve race conditions in lazy
loading with threads. Initially, we imported threading at the module
level, but that broke gevent, so we moved the import inside the load.
It seems hgdemandimport turns all imports lazy, so if threading has
not already been imported, it will block its own import.

It looks like mercurial maintains a list of imports that cannot be
deferred, so the simplest thing is probably to update/patch that list
to include threading:

https://foss.heptapod.net/mercurial/mercurial-devel/-/blob/80c8dcf/hgdemandimport/__init__.py#L22-61

I'll see about whether we can also do something on the Python side to
consider this case, as I believe lazy-loader is looking into creating
similar functionality:
https://github.com/scientific-python/lazy-loader

Best,
Chris

Reply via email to