run-tests: ensure that --no-rust do not use rust
Since having a valid value in HGWITHRUSTEXT is enough to trigger the use of
rust, we need to unset it before install to be sure.
--- a/tests/run-tests.py Tue Sep 17 16:40:24 2024 +0200
+++ b/tests/run-tests.py Fri Sep 27 15:53:56 2024 +0200
@@ -3717,15 +3717,18 @@
vlog("# Performing temporary installation of HG")
installerrs = os.path.join(self._hgtmp, b"install.err")
compiler = ''
+ install_env = original_env.copy()
if self.options.compiler:
compiler = '--compiler ' + self.options.compiler
setup_opts = b""
if self.options.pure:
setup_opts = b"--pure"
+ install_env.pop('HGWITHRUSTEXT', None)
elif self.options.rust:
setup_opts = b"--rust"
elif self.options.no_rust:
setup_opts = b"--no-rust"
+ install_env.pop('HGWITHRUSTEXT', None)
# Run installer in hg root
compiler = _sys2bytes(compiler)
@@ -3771,7 +3774,7 @@
makedirs(self._bindir)
vlog("# Running", cmd.decode("utf-8"))
- if subprocess.call(_bytes2sys(cmd), shell=True, env=original_env) == 0:
+ if subprocess.call(_bytes2sys(cmd), shell=True, env=install_env) == 0:
if not self.options.verbose:
try:
os.remove(installerrs)