Bug 1384258 - Build Stylo by default. r?chmanchester draft
authorRalph Giles <giles@mozilla.com>
Tue, 25 Jul 2017 14:29:52 -0700
changeset 616166 34296ad9a87bebc58886c8b6dec1fc9461f64c6e
parent 615935 388d81ed93fa640f91d155f36254667c734157cf
child 616167 0d735758919ba265cf95a48a8f3e3ae68b9f4300
push id70616
push userbmo:giles@thaumas.net
push dateWed, 26 Jul 2017 20:09:12 +0000
reviewerschmanchester
bugs1384258, 1356991
milestone56.0a1
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
browser/config/mozconfigs/linux64/debug-asan
browser/config/mozconfigs/linux64/hazards
build/mozconfig.stylo
toolkit/moz.configure
--- 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
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_UPLOAD=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,
     )