diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-04-14 23:56:59 -0400 |
---|---|---|
committer | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-04-16 22:12:17 -0400 |
commit | 022f0aa34a6b8688e816ff0c3ecbf970fc210cf7 (patch) | |
tree | b7ae7a427414d500a80e38f41792bbab0c34e5e2 /python/servo | |
parent | ff74faee109fc4977865512aa5657166667da6b4 (diff) | |
download | servo-022f0aa34a6b8688e816ff0c3ecbf970fc210cf7.tar.gz servo-022f0aa34a6b8688e816ff0c3ecbf970fc210cf7.zip |
Remove more deprecated Windows GNU code/docs
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/bootstrap.py | 37 | ||||
-rw-r--r-- | python/servo/build_commands.py | 28 | ||||
-rw-r--r-- | python/servo/command_base.py | 8 | ||||
-rw-r--r-- | python/servo/package_commands.py | 25 | ||||
-rw-r--r-- | python/servo/packages.py | 15 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 11 | ||||
-rw-r--r-- | python/servo/util.py | 4 |
7 files changed, 25 insertions, 103 deletions
diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py index 010b410b9d4..a8154c72607 100644 --- a/python/servo/bootstrap.py +++ b/python/servo/bootstrap.py @@ -170,39 +170,6 @@ def salt(context, force=False): return retcode -def windows_gnu(context, force=False): - '''Bootstrapper for msys2 based environments for building in Windows.''' - - if not find_executable('pacman'): - print( - 'The Windows GNU bootstrapper only works with msys2 with pacman. ' - 'Get msys2 at http://msys2.github.io/' - ) - return 1 - - # Ensure repositories are up to date - command = ['pacman', '--sync', '--refresh'] - subprocess.check_call(command) - - # Install packages - command = ['pacman', '--sync', '--needed'] - if force: - command.append('--noconfirm') - subprocess.check_call(command + list(packages.WINDOWS_GNU)) - - # Downgrade GCC to 5.4.0-1 - gcc_pkgs = ["gcc", "gcc-ada", "gcc-fortran", "gcc-libgfortran", "gcc-libs", "gcc-objc"] - gcc_version = "5.4.0-1" - mingw_url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-{}-{}-any.pkg.tar.xz" - gcc_list = [mingw_url.format(gcc, gcc_version) for gcc in gcc_pkgs] - - # Note: `--upgrade` also does downgrades - downgrade_command = ['pacman', '--upgrade'] - if force: - downgrade_command.append('--noconfirm') - subprocess.check_call(downgrade_command + gcc_list) - - def windows_msvc(context, force=False): '''Bootstrapper for MSVC building on Windows.''' @@ -264,9 +231,7 @@ def bootstrap(context, force=False): bootstrapper = None - if "windows-gnu" in host_triple(): - bootstrapper = windows_gnu - elif "windows-msvc" in host_triple(): + if "windows-msvc" in host_triple(): bootstrapper = windows_msvc elif "linux-gnu" in host_triple(): distro, version, _ = platform.linux_distribution() diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index cb4f108400c..efed18c609e 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -297,10 +297,6 @@ class MachCommands(CommandBase): cargo_binary = "cargo" + BIN_SUFFIX - if sys.platform in ("win32", "msys"): - if "msvc" not in host_triple(): - env[b'RUSTFLAGS'] = b'-C link-args=-Wl,--subsystem,windows' - status = call( [cargo_binary, "build"] + opts, env=env, cwd=self.servo_crate(), verbose=verbose) @@ -308,22 +304,22 @@ class MachCommands(CommandBase): # Do some additional things if the build succeeded if status == 0: - if sys.platform in ("win32", "msys"): + if sys.platform == "win32": servo_exe_dir = path.join(base_path, "debug" if dev else "release") # On windows, copy in our manifest shutil.copy(path.join(self.get_top_dir(), "components", "servo", "servo.exe.manifest"), servo_exe_dir) - if "msvc" in (target or host_triple()): - msvc_x64 = "64" if "x86_64" in (target or host_triple()) else "" - # on msvc builds, use editbin to change the subsystem to windows, but only - # on release builds -- on debug builds, it hides log output - if not dev: - call(["editbin", "/nologo", "/subsystem:windows", path.join(servo_exe_dir, "servo.exe")], - verbose=verbose) - # on msvc, we need to copy in some DLLs in to the servo.exe dir - for ssl_lib in ["libcryptoMD.dll", "libsslMD.dll"]: - shutil.copy(path.join(env['OPENSSL_LIB_DIR'], "../bin" + msvc_x64, ssl_lib), - servo_exe_dir) + + msvc_x64 = "64" if "x86_64" in (target or host_triple()) else "" + # on msvc builds, use editbin to change the subsystem to windows, but only + # on release builds -- on debug builds, it hides log output + if not dev: + call(["editbin", "/nologo", "/subsystem:windows", path.join(servo_exe_dir, "servo.exe")], + verbose=verbose) + # on msvc, we need to copy in some DLLs in to the servo.exe dir + for ssl_lib in ["libcryptoMD.dll", "libsslMD.dll"]: + shutil.copy(path.join(env['OPENSSL_LIB_DIR'], "../bin" + msvc_x64, ssl_lib), + servo_exe_dir) elif sys.platform == "darwin": # On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 2dbeff53bfb..ba91bcc3e74 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -168,8 +168,7 @@ def check_call(*args, **kwargs): def is_windows(): - """ Detect windows, mingw, cygwin """ - return sys.platform == 'win32' or sys.platform == 'msys' or sys.platform == 'cygwin' + return sys.platform == 'win32' def is_macosx(): @@ -420,9 +419,6 @@ class CommandBase(object): if not self.config["tools"]["system-rust"] \ or self.config["tools"]["rust-root"]: env["RUST_ROOT"] = self.config["tools"]["rust-root"] - # Add mingw64 binary path before rust paths to avoid conflict with libstdc++-6.dll - if sys.platform == "msys": - extra_path += [path.join(os.sep, "mingw64", "bin")] # These paths are for when rust-root points to an unpacked installer extra_path += [path.join(self.config["tools"]["rust-root"], "rustc", "bin")] extra_lib += [path.join(self.config["tools"]["rust-root"], "rustc", "lib")] @@ -489,7 +485,7 @@ class CommandBase(object): env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " " + self.config["build"]["rustflags"] # Don't run the gold linker if on Windows https://github.com/servo/servo/issues/9499 - if self.config["tools"]["rustc-with-gold"] and sys.platform not in ("win32", "msys"): + if self.config["tools"]["rustc-with-gold"] and sys.platform != "win32": if subprocess.call(['which', 'ld.gold'], stdout=PIPE, stderr=PIPE) == 0: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C link-args=-fuse-ld=gold" diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index c3e29829e45..2551844e4b5 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -107,25 +107,12 @@ def copy_dependencies(binary_path, lib_path): def copy_windows_dependencies(binary_path, destination): - try: - [shutil.copy(path.join(binary_path, d), destination) for d in ["libcryptoMD.dll", "libsslMD.dll"]] - except: - deps = [ - "libstdc++-6.dll", - "libwinpthread-1.dll", - "libbz2-1.dll", - "libgcc_s_seh-1.dll", - "libexpat-1.dll", - "zlib1.dll", - "libiconv-2.dll", - "libintl-8.dll", - "libcryptoMD.dll", - "libsslMD.dll", - ] - for d in deps: - dep_path = path.join("C:\\msys64\\mingw64\\bin", d) - if path.exists(dep_path): - shutil.copy(dep_path, path.join(destination, d)) + deps = [ + "libcryptoMD.dll", + "libsslMD.dll", + ] + for d in deps: + shutil.copy(path.join(binary_path, d), destination) def change_prefs(resources_path, platform): diff --git a/python/servo/packages.py b/python/servo/packages.py index 8e9bd22c69f..d368c91504c 100644 --- a/python/servo/packages.py +++ b/python/servo/packages.py @@ -2,21 +2,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. -WINDOWS_GNU = set([ - "diffutils", - "make", - "mingw-w64-x86_64-toolchain", - "mingw-w64-x86_64-icu", - "mingw-w64-x86_64-nspr", - "mingw-w64-x86_64-ca-certificates", - "mingw-w64-x86_64-expat", - "mingw-w64-x86_64-cmake", - "patch", - "patchutils", - "python2-setuptools", - "tar", -]) - WINDOWS_MSVC = { "cmake": "3.7.2", "moztools": "0.0.1-5", diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index c00bcc42057..70c90eab136 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -245,13 +245,10 @@ class MachCommands(CommandBase): env = self.build_env() env["RUST_BACKTRACE"] = "1" - if sys.platform in ("win32", "msys"): - if "msvc" in 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. - env["PATH"] = "%s%s%s" % (path.dirname(self.get_binary_path(False, False)), os.pathsep, env["PATH"]) - else: - env["RUSTFLAGS"] = "-C link-args=-Wl,--subsystem,windows" + if "msvc" in 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. + env["PATH"] = "%s%s%s" % (path.dirname(self.get_binary_path(False, False)), os.pathsep, env["PATH"]) features = self.servo_features() if len(packages) > 0: diff --git a/python/servo/util.py b/python/servo/util.py index 4df128419ae..c3217df8bfd 100644 --- a/python/servo/util.py +++ b/python/servo/util.py @@ -32,12 +32,8 @@ def host_platform(): # If we are in a Visual Studio environment, use msvc if os.getenv("PLATFORM") is not None: os_type = "pc-windows-msvc" - elif os.getenv("MSYSTEM") is not None: - os_type = "pc-windows-gnu" else: os_type = "unknown" - elif os_type.startswith("mingw64_nt-") or os_type.startswith("cygwin_nt-"): - os_type = "pc-windows-gnu" elif os_type == "freebsd": os_type = "unknown-freebsd" else: |