From c558784afe3020d2a9aa2ed6ab066be7314ad0cc Mon Sep 17 00:00:00 2001 From: UK992 Date: Fri, 3 Feb 2017 17:37:05 +0100 Subject: [PATCH 1/4] Update Windows instructions --- README.md | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 94c5275ff08..a22c5b38939 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,7 @@ Please select your operating system: * [Arch Linux](#on-arch-linux) * [openSUSE](#on-opensuse-linux) * [Gentoo Linux](#on-gentoo-linux) -* [Microsoft Windows (MSVC)](#on-windows-msvc) -* [Microsoft Windows (mingw)](#on-windows-mingw) +* [Microsoft Windows](#on-windows-msvc--mingw) * [Android](#cross-compilation-for-android) #### OS X @@ -93,36 +92,31 @@ 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 +#### On Windows (MSVC & MinGW) -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). - -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. - -Install Python for Windows (https://www.python.org/downloads/release/python-2711/). The windows x86-64 MSI installer is fine. +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. -Install virtualenv. +2. Install virtualenv. -In a normal Windows Shell (cmd.exe or "Command Prompt" from the start menu), do: -``` + In a normal Windows Shell (cmd.exe or "Command Prompt" from the start menu), do: + ``` 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. + If this does not work, you may need to reboot for the changed PATH settings (by the python installer) to take effect. -#### On Windows mingw +3. __(MSVC only)__ 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). -Download Python for Windows [here](https://www.python.org/downloads/release/python-2711/). This is -required for the SpiderMonkey build on Windows. +4. __(MSVC only)__ 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. -Install MSYS2 from [here](https://msys2.github.io/). After you have done so, open an MSYS shell +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 + ```sh pacman -Su pacman -Sy git mingw-w64-x86_64-toolchain mingw-w64-x86_64-freetype \ mingw-w64-x86_64-icu mingw-w64-x86_64-nspr mingw-w64-x86_64-ca-certificates \ @@ -133,16 +127,15 @@ 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 -easy_install-2.7 pip virtualenv ``` -Add the following line to the end of `.profile` in your home directory: + Add the following line to the end of `.profile` in your home directory: -``` -export PATH=/c/Python27:$PATH + ``` +export PATH=/c/Python27:/c/Python27/Scripts:$PATH ``` -Now, open a MINGW64 (not MSYS!) shell window, and you should be able to build + Now, open a MINGW64 (not MSYS!) shell window, and you should be able to build servo as usual! #### Cross-compilation for Android From ef2851ad2189d10f284deabb076591131089e734 Mon Sep 17 00:00:00 2001 From: UK992 Date: Sun, 5 Feb 2017 02:33:33 +0100 Subject: [PATCH 2/4] Remove unused packages from travis.yml --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4826c7eb151..82507be07e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,9 +39,6 @@ matrix: - xorg-dev - ccache - libdbus-glib-1-dev - - libavformat-dev - - libavcodec-dev - - libavutil-dev - libedit-dev branches: From b6b96322c16dc51f4f4fc66250552eee541a6a0b Mon Sep 17 00:00:00 2001 From: UK992 Date: Sun, 5 Feb 2017 02:34:58 +0100 Subject: [PATCH 3/4] Remove freetype dependency on Windows --- README.md | 4 ++-- appveyor.yml | 2 +- python/servo/command_base.py | 2 ++ python/servo/package_commands.py | 12 ++++-------- python/servo/packages.py | 1 - 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a22c5b38939..b1a73eade57 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,8 @@ dependencies. We are upgrading to a gcc-free build on Windows as soon as possibl ```sh pacman -Su -pacman -Sy git mingw-w64-x86_64-toolchain mingw-w64-x86_64-freetype \ - mingw-w64-x86_64-icu mingw-w64-x86_64-nspr mingw-w64-x86_64-ca-certificates \ +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 diff --git a/appveyor.yml b/appveyor.yml index 4879b4f038c..782ce173da1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -49,7 +49,7 @@ install: - 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-freetype 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" + - 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 diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 8149a705014..3169e9c9d6a 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -401,6 +401,8 @@ class CommandBase(object): if is_windows(): if not os.environ.get("NATIVE_WIN32_PYTHON"): env["NATIVE_WIN32_PYTHON"] = sys.executable + # Always build harfbuzz from source + env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true" if not self.config["tools"]["system-rust"] \ or self.config["tools"]["rust-root"]: diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 1da21d24a45..d8c2fbe4924 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -117,19 +117,15 @@ def copy_windows_dependencies(binary_path, destination): "libgcc_s_seh-1.dll", "libexpat-1.dll", "zlib1.dll", - "libpng16-16.dll", "libiconv-2.dll", - "libglib-2.0-0.dll", - "libgraphite2.dll", - "libfreetype-6.dll", - "libfontconfig-1.dll", "libintl-8.dll", - "libpcre-1.dll", "libeay32.dll", "ssleay32.dll", - "libharfbuzz-0.dll", ] - [shutil.copy(path.join("C:\\msys64\\mingw64\\bin", d), path.join(destination, d)) for d in deps] + 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)) def change_prefs(resources_path, platform): diff --git a/python/servo/packages.py b/python/servo/packages.py index 9e4906dc5cf..e8054f9a502 100644 --- a/python/servo/packages.py +++ b/python/servo/packages.py @@ -6,7 +6,6 @@ WINDOWS_GNU = set([ "diffutils", "make", "mingw-w64-x86_64-toolchain", - "mingw-w64-x86_64-freetype", "mingw-w64-x86_64-icu", "mingw-w64-x86_64-nspr", "mingw-w64-x86_64-ca-certificates", From e0a20b5568ff364cd5b48b15713eb11a253bd975 Mon Sep 17 00:00:00 2001 From: UK992 Date: Mon, 6 Feb 2017 00:12:51 +0100 Subject: [PATCH 4/4] Silent Windows specific warnings --- components/constellation/pipeline.rs | 1 + components/gfx/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index e8a6ab3c05b..0f5ee424df4 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -28,6 +28,7 @@ use servo_config::opts::{self, Opts}; use servo_config::prefs::{PREFS, Pref}; use servo_url::ServoUrl; use std::collections::HashMap; +#[cfg(not(windows))] use std::env; use std::ffi::OsStr; use std::io::Error as IOError; diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index e314b7b8f39..fb94e7b779f 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -4,7 +4,7 @@ // For SIMD #![feature(cfg_target_feature)] -#![cfg_attr(any(target_os = "linux", target_os = "android", target_os = "windows"), feature(heap_api))] +#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(heap_api))] #![feature(alloc)] #![feature(box_syntax)]