aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2023-12-07 03:18:30 -0500
committerGitHub <noreply@github.com>2023-12-07 08:18:30 +0000
commit117d59d393cf7926063e8723934fec97fd61d713 (patch)
treec9a04626c0269ca52377fd14d71dabb70caa48b1 /python/servo
parent914fe64fc72462f3af743d9d1ff26781d9fecec3 (diff)
downloadservo-117d59d393cf7926063e8723934fec97fd61d713.tar.gz
servo-117d59d393cf7926063e8723934fec97fd61d713.zip
Replace virtualenv with Python's built-in venv (#30377)
* Replace virtualenv with Python's built-in venv. * Apply Delan's suggestions and make a couple small fixes - Fix a tidy warning about directories that don't exist - Use shutil instead of the redundant get_exec_path - Miscellaneous cleanups * Fix typo in environment variable * fix bug where pip still tries to the wrong site-packages --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/build_commands.py4
-rw-r--r--python/servo/command_base.py5
2 files changed, 4 insertions, 5 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index cd977dfe91d..fae27e25b9e 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -252,7 +252,7 @@ class MachCommands(CommandBase):
subprocess.call(["perl", "-i", "-pe", expr, target_path])
@Command('clean',
- description='Clean the target/ and python/_virtualenv[version]/ directories',
+ description='Clean the target/ and python/_venv[version]/ directories',
category='build')
@CommandArgument('--manifest-path',
default=None,
@@ -265,7 +265,7 @@ class MachCommands(CommandBase):
def clean(self, manifest_path=None, params=[], verbose=False):
self.ensure_bootstrapped()
- virtualenv_fname = '_virtualenv%d.%d' % (sys.version_info[0], sys.version_info[1])
+ virtualenv_fname = '_venv%d.%d' % (sys.version_info[0], sys.version_info[1])
virtualenv_path = path.join(self.get_top_dir(), 'python', virtualenv_fname)
if path.exists(virtualenv_path):
print('Removing virtualenv directory: %s' % virtualenv_path)
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index daf9b68dd8e..af44102b313 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -36,7 +36,6 @@ from xml.etree.ElementTree import XML
import toml
-from mach_bootstrap import _get_exec_path
from mach.decorators import CommandArgument, CommandArgumentGroup
from mach.registrar import Registrar
@@ -618,8 +617,8 @@ class CommandBase(object):
host_suffix = "x86_64"
host = os_type + "-" + host_suffix
- host_cc = env.get('HOST_CC') or _get_exec_path(["clang"]) or _get_exec_path(["gcc"])
- host_cxx = env.get('HOST_CXX') or _get_exec_path(["clang++"]) or _get_exec_path(["g++"])
+ host_cc = env.get('HOST_CC') or shutil.which(["clang"]) or util.whichget_exec_path(["gcc"])
+ host_cxx = env.get('HOST_CXX') or util.whichget_exec_path(["clang++"]) or util.whichget_exec_path(["g++"])
llvm_toolchain = path.join(env['ANDROID_NDK'], "toolchains", "llvm", "prebuilt", host)
gcc_toolchain = path.join(env['ANDROID_NDK'], "toolchains",