Repository navigation
Keep the hg 6.5 client tests working on ubuntu-latest - #33
Conversation
ubuntu-latest is now Ubuntu 26.04 with Python 3.14, and the Mercurial 6.5 bundled with the pinned Chorus client can't start on it (its C extensions stop at 3.13), so the pinned leg failed and master's image wasn't pushed. Old clients in the field still use hg 6.5, so keep testing it with setup-python instead of dropping it or moving the job to ubuntu-24.04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Python 3.12 from setup-python didn't help: the failure isn't the Python version as such but CPython's LazyLoader importing threading itself (later 3.12 releases and 3.14), which deadlocks Mercurial 6.5's demandimport when it lazy-loads threading. Ubuntu 24.04's 3.12.3 predates that, which is why it used to pass. HGDEMANDIMPORT=disable gets hg 6.5 starting on the runner's own Python 3.14 (its module policy falls back to pure Python). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmunn
left a comment
There was a problem hiding this comment.
This is a good plan. The only difference that HGDEMANDIMPORT=disable makes is to load Python modules eagerly when the import command is reached. (Mercurial's default behavior is to turn import statements into lazy-loading objects that only import their module when someone tries to access the module's contents). In theory this could change behavior if a module has a bug, e.g. an exception could be thrown that wouldn't have been thrown by the default Mercurial behavior. But that's not the case here, or we would have seen test failures. And setting HGDEMANDIMPORT=disable does not change what Mercurial sends or reads on the wire, how it handles merge logic, and so on.
So this is the simplest change we can make that will continue to work.
AI summary
ubuntu-latestis now Ubuntu 26.04 (Python 3.14), and the Mercurial 6.5 bundled with the pinned Chorus client dies on startup there withpartially initialized module 'threading' has no attribute 'RLock'. So the pinned leg failed on master (run) and the image with #27 wasn't pushed.The cause isn't the Python version as such: newer CPython's
importlib.util.LazyLoaderimportsthreadingitself, which loops when hg 6.5's demandimport lazy-loadsthreading. Ubuntu 24.04's Python 3.12.3 predates that change, which is why it used to pass; a first attempt with setup-python 3.12 (3.12.16) failed the same way.Old clients in the field still use hg 6.5, so this keeps the leg on
ubuntu-latestand setsHGDEMANDIMPORT=disablefor the pinned leg only. The bundle's module policy isallow, so on 3.14 it falls back to pure Python. The latest leg (hg 7.2) keeps demandimport on; the hg3 leg runs on Python 2.7.Checked locally: the bundle's Linux
hg versionreproduces the error on Python 3.14 and starts withHGDEMANDIMPORT=disable.LexBox hit the same thing in sillsdev/languageforge-lexbox#2861 (it pinned its hg 6 legs to
ubuntu-24.04instead).Test plan
🤖 Generated with Claude Code