Bug 1384258 - Build Stylo by default. r=chmanchester
authorRalph Giles <giles@mozilla.com>
Tue, 25 Jul 2017 14:29:52 -0700
changeset 420173 b18177e6556b8e31b3b0900aed456d8a2698792d
parent 420172 1bb99bce4b89dadfd41eee201cf1ea340a504ea2
child 420174 274db82383c0b75fd8f4d83c01e3f9dfc237b7dd
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1384258, 1356991
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
Bug 1384258 - Build Stylo by default. r=chmanchester Build Stylo (the styling system from servo) by default in all builds for win32, win64, macOS and linux64 targets. It was previously enabled for automation builds, so this just changes the behaviour for local developer builds. Note that this introduces a new dependency on libclang for the binding generator. If you're developing on a tier-1 platform, run `./mach boostrap` to install a working copy. Otherwise llvm+libclang 4.0.1 is recommended. Remove the explicit --enable-stylo=build in mozconfig.stylo in favour of the configure default. Add mozconfig.stylo to the hazard and debug-asan mozconfigs so LLVM_CONFIG is defined properly for those builds. Based on a patch by Bobby Holly in bug 1356991. MozReview-Commit-ID: C2wRNl7JHpz
--- a/browser/config/mozconfigs/linux64/debug-asan
+++ b/browser/config/mozconfigs/linux64/debug-asan
@@ -1,13 +1,15 @@
 # Use at least -O1 for optimization to avoid stack space
 # exhaustions caused by Clang function inlining.
 ac_add_options --enable-debug
 ac_add_options --enable-optimize="-O1"
+. $topsrcdir/build/mozconfig.stylo
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 . $topsrcdir/build/unix/mozconfig.asan
 export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
 . $topsrcdir/build/unix/mozconfig.gtk
--- a/browser/config/mozconfigs/linux64/hazards
+++ b/browser/config/mozconfigs/linux64/hazards
@@ -15,16 +15,18 @@ MOZ_AUTOMATION_PACKAGE=0
 . "$topsrcdir/build/mozconfig.common"
 ac_add_options --enable-elf-hack
 . "$topsrcdir/build/unix/mozconfig.stdcxx"
+. "$topsrcdir/build/mozconfig.stylo"
 # The objdir must be at a known location so its path can be stripped from the
 # filenames stored by the analysis
 mk_add_options MOZ_OBJDIR=obj-analyzed
 # The configuration options are chosen to compile the most code
 # (--enable-debug, --enable-tests) in the trickiest way possible
 # (--enable-optimize) to maximize the chance of seeing tricky static orderings.
 ac_add_options --enable-debug
--- a/build/mozconfig.stylo
+++ b/build/mozconfig.stylo
@@ -1,6 +1,2 @@
 # Tell the build system where to find llvm-config for builds on automation.
 export LLVM_CONFIG="${TOOLTOOL_DIR:-$topsrcdir}/clang/bin/llvm-config"
-# TODO remove once configure defaults to stylo once stylo enabled
-# on all platforms.
-ac_add_options --enable-stylo=build
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -588,27 +588,37 @@ simple_keyfile('Adjust SDK')
 id_and_secret_keyfile('Leanplum SDK')
 # Servo integration
 # ==============================================================
 option('--enable-stylo', nargs='?', choices=('build',),
        help='Include Stylo in the build and/or enable it at runtime')
-@depends('--enable-stylo', '--help')
-def stylo_config(value, _):
+@depends('--enable-stylo', '--help', target)
+def stylo_config(value, _, target):
     build_stylo = None
     enable_stylo = None
-    # The default is to not build Stylo at all.
+    # If nothing is specified, default to building stylo where possible.
     if value.origin == 'default':
-        pass
+        if target.os == 'GNU' and target.bitness == 32:
+            # The clang setup we use in automation is a little unusual, and
+            # doesn't play well with bindgen on 32-bit Linux.
+            pass
+        elif target.os == 'Android':
+            # Stylo on Android is happening Later(tm).
+            pass
+        else:
+            build_stylo = True
     elif len(value) and value[0] == 'build':
+        # Build but disable by request.
         build_stylo = True
     elif bool(value):
+        # Build and enable.
         build_stylo = True
         enable_stylo = True
     return namespace(
         build = build_stylo,
         enable = enable_stylo,