( )⚙ D11275 contrib: switch the Windows bootstrap environment to py3.9

This is an archive of the discontinued Mercurial Phabricator instance.

contrib: switch the Windows bootstrap environment to py3.9
ClosedPublic

Authored by mharbison72 on Aug 9 2021, 8:46 PM.

Details

Summary

Use the built in venv module instead of virtualenv for simplicity, and
upgrade to a modern Mercurial that supports py3.

One issue here is that venv doesn't copy python3{,Y}.dll into the Scripts
subdirectory, so running the hg.exe that gets installed immediately fails on a
clean system because Python isn't in PATH. There is code in python.exe to
detect when it is in a venv and add the original python install to the DLL
lookup path, which we don't do in hg.exe yet. The simple workaround for now is
to run the hg script with python.exe. Typically PYTHONLEGACYWINDOWSSTDIO
must be set in the environment on Windows, but the clone process works without
it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mharbison72 created this revision.Aug 9 2021, 8:46 PM
pulkit accepted this revision.Aug 10 2021, 8:22 AM
This revision is now accepted and ready to land.Aug 10 2021, 8:22 AM