diff options
author | bors-servo <infra@servo.org> | 2023-06-24 14:27:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-24 14:27:15 +0200 |
commit | 7ffb9b2d4958adf6943f72c99ccc53b4d5a598e7 (patch) | |
tree | cf121606d45bf468faf8ea9420ed13c444efaeda /python/servo | |
parent | d30c9f83020c18d49c11c94ab1c4a96c3b7091f7 (diff) | |
parent | f162d28e6d5bff9d45e85ac620da2ec4d95aad7f (diff) | |
download | servo-7ffb9b2d4958adf6943f72c99ccc53b4d5a598e7.tar.gz servo-7ffb9b2d4958adf6943f72c99ccc53b4d5a598e7.zip |
Auto merge of #29917 - mrobinson:more-environment-cleanup, r=jdm
Clean up environment variables in `command_base.py`
- The `HOST_FILE` setting is completely unused by the code.
- Remove some likely Python 2 compatibility code.
- Remove things pertaining to Ubuntu 16.04 which is EOL.
- Remove a workaround for MacOS which no longer applies.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they mostly remove dead build script code.
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/command_base.py | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index ebb96d8866a..ae702e67142 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -11,7 +11,6 @@ from __future__ import print_function import contextlib from typing import List, Optional -import distro import functools import gzip import itertools @@ -497,7 +496,7 @@ class CommandBase(object): 'vcdir': vcinstalldir, } - def build_env(self, hosts_file_path=None, is_build=False, test_unit=False): + def build_env(self, is_build=False, test_unit=False): """Return an extended environment dictionary.""" env = os.environ.copy() @@ -506,14 +505,6 @@ class CommandBase(object): env, cross_compilation_target=self.cross_compile_target, check_installation=is_build) - if sys.platform == "win32" and type(env['PATH']) == six.text_type: - # On win32, the virtualenv's activate_this.py script sometimes ends up - # turning os.environ['PATH'] into a unicode string. This doesn't work - # for passing env vars in to a process, so we force it back to ascii. - # We don't use UTF8 since that won't be correct anyway; if you actually - # have unicode stuff in your path, all this PATH munging would have broken - # it in any case. - env['PATH'] = env['PATH'].encode('ascii', 'ignore') extra_path = [] effective_target = self.cross_compile_target or servo.platform.host_triple() if "msvc" in effective_target: @@ -566,13 +557,6 @@ class CommandBase(object): # Always build harfbuzz from source env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true" - if is_linux(): - distrib, version, _ = distro.linux_distribution() - distrib = six.ensure_str(distrib) - version = six.ensure_str(version) - if distrib == "Ubuntu" and version == "16.04": - env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true" - if extra_path: util.append_paths_to_env(env, "PATH", extra_path) @@ -613,18 +597,11 @@ class CommandBase(object): if "ANDROID_TOOLCHAIN" in env: env["NDK_STANDALONE"] = env["ANDROID_TOOLCHAIN"] - if hosts_file_path: - env['HOST_FILE'] = hosts_file_path - if test_unit and "msvc" in servo.platform.host_triple(): # on MSVC, we need some DLLs in the path. They were copied # in to the servo.exe build dir, so just point PATH to that. util.prepend_paths_to_env(env, "PATH", path.dirname(self.get_binary_path(False, False))) - # FIXME: https://github.com/servo/servo/issues/26192 - if test_unit and "apple-darwin" not in servo.platform.host_triple(): - env["RUST_BACKTRACE"] = "1" - if self.config["build"]["rustflags"]: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " " + self.config["build"]["rustflags"] |