( )⚙ D10943 run-tests: stop writing a `python3` symlink pointing to python2

This is an archive of the discontinued Mercurial Phabricator instance.

run-tests: stop writing a `python3` symlink pointing to python2
ClosedPublic

Authored by marmoute on Jul 2 2021, 6:37 PM.

Details

Summary

Having python3 actually pointing to python2 is bad. So we stop doing so.

In addition we need to re-introduce a python executable since some of the
script really need to be able to say "current python" in their shbang. For
example, hghave is one of such script.

The faulty changes where introduced by c102b704edb5.

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

marmoute created this revision.Jul 2 2021, 6:37 PM
Alphare accepted this revision.Jul 5 2021, 5:33 AM
This revision is now accepted and ready to land.Jul 5 2021, 5:33 AM

I agree that python3 pointing to python2 is not good. But won't this change break on distributions that don't have a 'python' executable? For example on CentOS 8: python2 and python3 exist, but 'python' does not.

I agree that python3 pointing to python2 is not good. But won't this change break on distributions that don't have a 'python' executable? For example on CentOS 8: python2 and python3 exist, but 'python' does not.

no because the test runner is now explicitly creating an appropriate symlink from python → "the python used to run run-tests.py"

Then it looks fine to me.

I added a test to check that python2/python/python3 all works and return the right version.

baymax updated this revision to Diff 28820.Jul 6 2021, 9:32 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare added inline comments.Jul 6 2021, 9:37 AM
tests/test-run-tests.t
2052

chmod +x will need to be gated by a #if execbit on Windows, but let's figure it out on a Windows machine and take this as is for now as there might be an issue with the script running at all without an sh prefix.

baymax updated this revision to Diff 28828.Jul 6 2021, 10:14 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)