Bug 1300290 - Avoid --enable-dmd and --enable-stylo setting conflicting --enable-jemalloc values; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Wed, 30 Nov 2016 22:17:59 -0800
changeset 446289 6f120f35fb8096d2f18899f2720701646aa81acc
parent 446179 69d873e6b8dd809bb6bcf88f3c27de5715846bcf
child 538745 1f0462aae27ef6981c34fad1054cc48cbe707b4d
push id37744
push usergszorc@mozilla.com
push dateThu, 01 Dec 2016 06:18:18 +0000
reviewersglandium
bugs1300290
milestone53.0a1
Bug 1300290 - Avoid --enable-dmd and --enable-stylo setting conflicting --enable-jemalloc values; r?glandium Before, --enable-dmd implied --enable-jemalloc. If --enable-stylo was also set, it tried to imply --enable-jemalloc=moz. Configure barfed due to setting the value twice. The commit refactors the logic for implying the --enable-jemalloc value to set the proper value depending on the state of dmd and stylo. MozReview-Commit-ID: 1wKE9Cs1Umt
toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -60,17 +60,17 @@ option('--enable-dmd', env='MOZ_DMD',
 def dmd(value):
     if value:
         return True
 
 set_config('MOZ_DMD', dmd)
 set_define('MOZ_DMD', dmd)
 add_old_configure_assignment('MOZ_DMD', dmd)
 imply_option('--enable-profiling', dmd)
-imply_option('--enable-jemalloc', dmd)
+# --enable-jemalloc is implied below.
 imply_option('--enable-replace-malloc', dmd)
 
 # JACK cubeb backend
 # ==============================================================
 option('--enable-jack', env='MOZ_JACK',
        help='Enable JACK audio backend.')
 
 @depends('--enable-jack')
@@ -566,17 +566,26 @@ option('--enable-stylo', env='STYLO_ENAB
 
 @depends('--enable-stylo')
 def stylo(value):
     if value:
         return True
 
 set_config('MOZ_STYLO', stylo)
 set_define('MOZ_STYLO', stylo)
-imply_option('--enable-jemalloc', depends_if('--enable-stylo')(lambda _: 'moz'))
+
+@depends(stylo, dmd)
+def jemalloc(stylo, dmd):
+    if stylo:
+        return 'moz'
+    elif dmd:
+        return True
+
+imply_option('--enable-jemalloc', jemalloc,
+             reason='--enable-dmd or --enable-stylo')
 
 option('--with-servo', env='SERVO_TARGET_DIR', nargs=1,
        help='Absolute path of the target directory where libgeckoservo can '
             'be found. This is generally servo_src_dir/target/release.')
 
 @depends_if('--with-servo')
 def servo_target_dir(value):
     return value[0]