servo: Merge #15393 - Windows: Instructions update, removed freetype and silent some warning (from UK992:win32); r=metajack
authorUK992 <urbankrajnc92@gmail.com>
Sun, 05 Feb 2017 17:33:23 -0800
changeset 341492 996e71c6e4d93c875c2291575d20b672026bf39d
parent 341491 e1bd338a3611d801405e51a4aaddcbe58f8902b4
child 341493 e07f402a671b117dc73f19e6d001f06a19591d8c
push id86727
push userkwierso@gmail.com
push dateThu, 09 Feb 2017 00:21:26 +0000
treeherdermozilla-inbound@55a4f5189115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmetajack
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #15393 - Windows: Instructions update, removed freetype and silent some warning (from UK992:win32); r=metajack i made some changes to Windows instruction, more unified. Also removed freetype dependencies on Windows, by forcing to build harfbuzz from source, which is also dependent on freetype. cc @larsbergstrom @metajack Source-Repo: https://github.com/servo/servo Source-Revision: e8d677f9c5caed7e8c750fad7b4fb2eae4744c93
servo/.travis.yml
servo/README.md
servo/appveyor.yml
servo/components/constellation/pipeline.rs
servo/components/gfx/lib.rs
servo/python/servo/command_base.py
servo/python/servo/package_commands.py
servo/python/servo/packages.py
--- a/servo/.travis.yml
+++ b/servo/.travis.yml
@@ -34,16 +34,13 @@ matrix:
             - freeglut3-dev
             - gperf
             - libosmesa6-dev
             - libgles2-mesa-dev
             - python-virtualenv
             - xorg-dev
             - ccache
             - libdbus-glib-1-dev
-            - libavformat-dev
-            - libavcodec-dev
-            - libavutil-dev
             - libedit-dev
 
 branches:
   only:
     - master
--- a/servo/README.md
+++ b/servo/README.md
@@ -16,18 +16,17 @@ Visit the [Servo Project page](https://s
 
 Please select your operating system:
 * [OS X](#os-x)
 * [Debian-based Linuxes](#on-debian-based-linuxes)
 * [Fedora](#on-fedora)
 * [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
 #### On OS X (homebrew)
 
 ``` sh
 brew install automake pkg-config python cmake yasm
 pip install virtualenv
@@ -88,66 +87,60 @@ sudo pacman -S --needed base-devel git p
 #### On Gentoo Linux
 
 ```sh
 sudo emerge net-misc/curl media-libs/freeglut \
     media-libs/freetype media-libs/mesa dev-util/gperf \
     dev-python/virtualenv dev-python/pip dev-libs/openssl \
     x11-libs/libXmu media-libs/glu x11-base/xorg-server
 ```
-#### On Windows MSVC
-
-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).
+#### On Windows (MSVC & MinGW)
 
-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 \
+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
-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
 
 Pre-installed Android tools are needed. See wiki for
 [details](https://github.com/servo/servo/wiki/Building-for-Android)
 
 ## The Rust compiler
--- a/servo/appveyor.yml
+++ b/servo/appveyor.yml
@@ -44,17 +44,17 @@ cache:
 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-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
   - 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'))
--- a/servo/components/constellation/pipeline.rs
+++ b/servo/components/constellation/pipeline.rs
@@ -23,16 +23,17 @@ use script_traits::{ConstellationControl
 use script_traits::{DocumentActivity, InitialScriptState};
 use script_traits::{LayoutControlMsg, LayoutMsg, LoadData, MozBrowserEvent};
 use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg};
 use script_traits::{ScriptThreadFactory, TimerEventRequest, WindowSizeData};
 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;
 use std::process;
 use std::rc::Rc;
 use std::sync::mpsc::Sender;
 use style_traits::{PagePx, ViewportPx};
 use webrender_traits;
--- a/servo/components/gfx/lib.rs
+++ b/servo/components/gfx/lib.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 // 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)]
 #![feature(plugin)]
 #![feature(range_contains)]
 #![feature(unique)]
 
 #![plugin(plugins)]
--- a/servo/python/servo/command_base.py
+++ b/servo/python/servo/command_base.py
@@ -396,16 +396,18 @@ class CommandBase(object):
             env["OPENSSL_LIB_DIR"] = path.join(package_dir("openssl"), "lib" + msvc_x64)
             env["OPENSSL_LIBS"] = "ssleay32MD:libeay32MD"
             # Link moztools
             env["MOZTOOLS_PATH"] = path.join(package_dir("moztools"), "bin")
 
         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"]:
             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
--- a/servo/python/servo/package_commands.py
+++ b/servo/python/servo/package_commands.py
@@ -112,29 +112,25 @@ def copy_windows_dependencies(binary_pat
     except:
         deps = [
             "libstdc++-6.dll",
             "libwinpthread-1.dll",
             "libbz2-1.dll",
             "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):
     print("Swapping prefs")
     prefs_path = path.join(resources_path, "prefs.json")
     package_prefs_path = path.join(resources_path, "package-prefs.json")
     os_type = "os:{}".format(platform)
     with open(prefs_path) as prefs, open(package_prefs_path) as package_prefs:
--- a/servo/python/servo/packages.py
+++ b/servo/python/servo/packages.py
@@ -1,17 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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-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",
     "patch",
     "patchutils",
     "python2-setuptools",