Remove more deprecated Windows GNU code/docs

This commit is contained in:
Aneesh Agrawal 2017-04-14 23:56:59 -04:00
parent ff74faee10
commit 022f0aa34a
10 changed files with 31 additions and 163 deletions

View file

@ -211,7 +211,7 @@ def _ensure_case_insensitive_if_windows():
def _is_windows():
return sys.platform == 'win32' or sys.platform == 'msys'
return sys.platform == 'win32'
def bootstrap(topdir):
@ -235,15 +235,6 @@ def bootstrap(topdir):
print('Current path:', topdir)
sys.exit(1)
# We don't support MinGW Python
if os.path.join(os.sep, 'mingw64', 'bin') in sys.executable:
print('Cannot run mach with MinGW or MSYS Python.')
print('\nPlease add the path to Windows Python (usually /c/Python27) to your path.')
print('You can do this by appending the line:')
print(' export PATH=/c/Python27:$PATH')
print('to your ~/.profile.')
sys.exit(1)
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module import.
if not (3, 0) > sys.version_info >= (2, 7):

View file

@ -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()

View file

@ -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

View file

@ -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"

View file

@ -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):

View file

@ -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",

View file

@ -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:

View file

@ -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: