diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-01-13 23:11:34 -0500 |
---|---|---|
committer | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-01-15 15:41:37 -0500 |
commit | 60a1503b2997b05e3f36f4ce92d688df44fdeae7 (patch) | |
tree | a2196ba44e6d3af41e28d322ff4dda7ffb59748b /python/servo/command_base.py | |
parent | ef900cbdcb0e544639ae10b390a68da2afd8bcce (diff) | |
download | servo-60a1503b2997b05e3f36f4ce92d688df44fdeae7.tar.gz servo-60a1503b2997b05e3f36f4ce92d688df44fdeae7.zip |
Clean up and simplify existing `mach bootstrap`
- Default to interactive mode and remove the `--interactive` flag
- Use `--force` to skip interactivity
- Change MSVC dependency storage organization on disk: put each version
into its own folder and directly refer to the versioned folders,
providing immutability and making the installation list redundant
- Reuse `host_triple()` function to fix broken bootstrapper dispatching
- Simplify code:
- Remove or inline many unused and redudant functions and variables
- Prefer plain functions to classes
- Consolidate into fewer files, remove unnecessary bootstrapper/ dir
- Improve Python style
- Sort dependency list
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 00bc38de070..e80c9cb018b 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -19,12 +19,12 @@ from subprocess import PIPE import sys import tarfile +from mach.registrar import Registrar import toml -from mach.registrar import Registrar +from servo.packages import WINDOWS_MSVC as msvc_deps from servo.util import host_triple - BIN_SUFFIX = ".exe" if sys.platform == "win32" else "" @@ -384,14 +384,18 @@ class CommandBase(object): if "msvc" in (target or host_triple()): msvc_x64 = "64" if "x86_64" in (target or host_triple()) else "" msvc_deps_dir = path.join(self.context.sharedir, "msvc-dependencies") - extra_path += [path.join(msvc_deps_dir, "cmake", "bin")] - extra_path += [path.join(msvc_deps_dir, "ninja", "bin")] + + def package_dir(package): + return path.join(msvc_deps_dir, package, msvc_deps[package]) + + extra_path += [path.join(package_dir("cmake"), "bin")] + extra_path += [path.join(package_dir("ninja"), "bin")] # Link openssl - env["OPENSSL_INCLUDE_DIR"] = path.join(msvc_deps_dir, "openssl", "include") - env["OPENSSL_LIB_DIR"] = path.join(msvc_deps_dir, "openssl", "lib" + msvc_x64) + env["OPENSSL_INCLUDE_DIR"] = path.join(package_dir("openssl"), "include") + env["OPENSSL_LIB_DIR"] = path.join(package_dir("openssl"), "lib" + msvc_x64) env["OPENSSL_LIBS"] = "ssleay32MD:libeay32MD" # Link moztools - env["MOZTOOLS_PATH"] = path.join(msvc_deps_dir, "moztools", "bin") + env["MOZTOOLS_PATH"] = path.join(package_dir("moztools"), "bin") if is_windows(): if not os.environ.get("NATIVE_WIN32_PYTHON"): |