mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
Remove more deprecated Windows GNU code/docs
This commit is contained in:
parent
ff74faee10
commit
022f0aa34a
10 changed files with 31 additions and 163 deletions
35
README.md
35
README.md
|
@ -21,7 +21,7 @@ Please select your operating system:
|
|||
* [Arch Linux](#on-arch-linux)
|
||||
* [openSUSE](#on-opensuse-linux)
|
||||
* [Gentoo Linux](#on-gentoo-linux)
|
||||
* [Microsoft Windows](#on-windows-msvc--mingw)
|
||||
* [Microsoft Windows](#on-windows-msvc)
|
||||
* [Android](#cross-compilation-for-android)
|
||||
|
||||
#### OS X
|
||||
|
@ -94,7 +94,7 @@ sudo emerge net-misc/curl media-libs/freeglut \
|
|||
dev-python/virtualenv dev-python/pip dev-libs/openssl \
|
||||
x11-libs/libXmu media-libs/glu x11-base/xorg-server
|
||||
```
|
||||
#### On Windows (MSVC & MinGW)
|
||||
#### On Windows (MSVC)
|
||||
|
||||
1. Install Python for Windows (https://www.python.org/downloads/release/python-2711/). The windows x86-64 MSI installer is fine.
|
||||
You should change the installation to install the "Add python.exe to Path" feature.
|
||||
|
@ -107,39 +107,12 @@ pip install virtualenv
|
|||
```
|
||||
If this does not work, you may need to reboot for the changed PATH settings (by the python installer) to take effect.
|
||||
|
||||
3. __(MSVC only)__ Install Git for Windows (https://git-scm.com/download/win). DO allow it to add git.exe to the PATH (default
|
||||
3. Install Git for Windows (https://git-scm.com/download/win). DO allow it to add git.exe to the PATH (default
|
||||
settings for the installer are fine).
|
||||
|
||||
4. __(MSVC only)__ Install Visual Studio 2015 Community Edition (https://www.visualstudio.com/). You MUST add "Visual C++" to the
|
||||
4. Install Visual Studio 2015 Community Edition (https://www.visualstudio.com/). You MUST add "Visual C++" to the
|
||||
list of installed components. It is not on by default.
|
||||
|
||||
5. __(MinGW only)__ Install MSYS2 (https://msys2.github.io/). After you have done so, open an MSYS shell
|
||||
window and update the core libraries and install new packages. The extra step at the end is to
|
||||
downgrade GCC to 5.4, as the GCC6 versions in mingw currently fail to compile some of our
|
||||
dependencies. We are upgrading to a gcc-free build on Windows as soon as possible:
|
||||
|
||||
```sh
|
||||
pacman -Su
|
||||
pacman -Sy git 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 tar diffutils patch \
|
||||
patchutils make python2-setuptools
|
||||
export GCC_URL=http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc
|
||||
export GCC_EXT=5.4.0-1-any.pkg.tar.xz
|
||||
pacman -U --noconfirm $GCC_URL-$GCC_EXT $GCC_URL-ada-$GCC_EXT \
|
||||
$GCC_URL-fortran-$GCC_EXT $GCC_URL-libgfortran-$GCC_EXT $GCC_URL-libs-$GCC_EXT \
|
||||
$GCC_URL-objc-$GCC_EXT
|
||||
```
|
||||
|
||||
Add the following line to the end of `.profile` in your home directory:
|
||||
|
||||
```
|
||||
export PATH=/c/Python27:/c/Python27/Scripts:$PATH
|
||||
```
|
||||
|
||||
Now, open a MINGW64 (not MSYS!) shell window, and you should be able to build
|
||||
servo as usual!
|
||||
|
||||
#### Cross-compilation for Android
|
||||
|
||||
Pre-installed Android tools are needed. See wiki for
|
||||
|
|
20
appveyor.yml
20
appveyor.yml
|
@ -30,7 +30,6 @@ environment:
|
|||
C:\\Program Files\\AppVeyor\\BuildAgent;"
|
||||
matrix:
|
||||
- TARGET: nightly-x86_64-pc-windows-msvc
|
||||
- TARGET: nightly-x86_64-pc-windows-gnu
|
||||
|
||||
branches:
|
||||
only:
|
||||
|
@ -41,20 +40,6 @@ cache:
|
|||
- .cargo -> rust-commit-hash, cargo-commit-hash
|
||||
- .ccache
|
||||
|
||||
install:
|
||||
- if %TARGET:*-msvc=msvc%==msvc set BUILD_ENV=msvc
|
||||
- if %TARGET:*-gnu=gnu%==gnu set BUILD_ENV=gnu
|
||||
- if %BUILD_ENV%==gnu set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%
|
||||
- if %BUILD_ENV%==gnu set MSYSTEM=MINGW64
|
||||
- if %BUILD_ENV%==gnu set MSYS=winsymlinks=lnk
|
||||
- if %BUILD_ENV%==gnu bash -lc "echo $MSYSTEM; pacman --needed --noconfirm -Sy pacman-mirrors"
|
||||
- if %BUILD_ENV%==gnu bash -lc "pacman --noconfirm -Sy"
|
||||
- if %BUILD_ENV%==gnu bash -lc "pacman -Sy --needed --noconfirm mingw-w64-x86_64-ccache 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 tar diffutils patch patchutils make python2-setuptools"
|
||||
# Downgrade msys2 build GCC to 5.4.0-1 - https://github.com/servo/servo/issues/12512
|
||||
- if %BUILD_ENV%==gnu set GCC_URL=http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc
|
||||
- if %BUILD_ENV%==gnu set GCC_EXT=5.4.0-1-any.pkg.tar.xz
|
||||
- if %BUILD_ENV%==gnu bash -lc "pacman -U --noconfirm $GCC_URL-$GCC_EXT $GCC_URL-ada-$GCC_EXT $GCC_URL-fortran-$GCC_EXT $GCC_URL-libgfortran-$GCC_EXT $GCC_URL-libs-$GCC_EXT $GCC_URL-objc-$GCC_EXT"
|
||||
|
||||
# Uncomment these lines to expose RDP access information to the build machine in the build log.
|
||||
#init:
|
||||
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
@ -63,9 +48,6 @@ install:
|
|||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
build_script:
|
||||
- if %BUILD_ENV%==gnu bash -lc "ccache -s"
|
||||
- if %BUILD_ENV%==msvc mach build -d -v && mach test-unit
|
||||
- if %BUILD_ENV%==gnu bash -lc "export PATH=/c/Python27:$PATH; export CCACHE=/mingw64/bin/ccache; cd $APPVEYOR_BUILD_FOLDER; ./mach build -d -v && ./mach test-unit"
|
||||
- if %BUILD_ENV%==gnu bash -lc "ccache -s"
|
||||
- mach build -d -v && mach test-unit
|
||||
|
||||
test: off
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue