mach is broken on Python 3.12.8
I updated to Python 3.12.8 on my Debian testing machine last Friday.
Today I tried to build, but mach
is refusing to work:
The error
Traceback (most recent call last):
File "/home/piero/Tor/tor-browser/./mach", line 155, in main
mach = check_and_get_mach(os.path.dirname(os.path.realpath(__file__)), args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/piero/Tor/tor-browser/./mach", line 39, in check_and_get_mach
return load_mach(dir_path, mach_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/piero/Tor/tor-browser/./mach", line 25, in load_mach
return mach_initialize.initialize(dir_path, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/piero/Tor/tor-browser/build/mach_initialize.py", line 344, in initialize
command_site_manager.activate()
File "/home/piero/Tor/tor-browser/python/mach/mach/site.py", line 602, in activate
self.ensure()
File "/home/piero/Tor/tor-browser/python/mach/mach/site.py", line 563, in ensure
result = self._up_to_date()
^^^^^^^^^^^^^^^^^^
File "/home/piero/Tor/tor-browser/python/mach/mach/site.py", line 800, in _up_to_date
pthfile_lines = self._pthfile_lines()
^^^^^^^^^^^^^^^^^^^^^
File "/home/piero/Tor/tor-browser/python/mach/mach/site.py", line 782, in _pthfile_lines
PythonVirtualenv(self._mach_virtualenv_root).site_packages_dirs()
File "/home/piero/Tor/tor-browser/python/mach/mach/site.py", line 853, in site_packages_dirs
platlib = self.resolve_sysconfig_packages_path("platlib")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/piero/Tor/tor-browser/python/mach/mach/site.py", line 843, in resolve_sysconfig_packages_path
relative_path = path.relative_to(data_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 682, in relative_to
raise ValueError(f"{str(self)!r} is not in the subpath of {str(other)!r}")
ValueError: '/usr/lib/python3.12/site-packages' is not in the subpath of '/home/piero/.mozbuild/srcdirs/tor-browser-9b7c12c6b422/_virtualenvs/mach'
It looks like python/mach/mach/site.py
has been updated on central a few days ago with Bug 1935621, but fixes haven't been backported to ESR, we'll have to backport them by ourselves.