Bug 1530562 - Enable DMD by default when possible. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 26 Feb 2019 22:07:04 +0000
changeset 461277 8f0627e655a9a1aacce3134cc848fc9c81916d4a
parent 461276 74f246913bb514e59b39cd7a1a2ce97bc2db8eff
child 461278 b4cc238408111d01cf9230debb2bf0c6cb235c92
push id35621
push userncsoregi@mozilla.com
push dateWed, 27 Feb 2019 04:29:56 +0000
treeherdermozilla-central@31abc7fd9a26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1530562, 1409739
milestone67.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
Bug 1530562 - Enable DMD by default when possible. r=mshal And remove the manual --enable-dmd in in-tree mozconfigs, as well as --enable-profiling, which is implied by --enable-dmd. This disables DMD on add-on-devel builds, which don't look like they were actually meant to have DMD enabled in the first place (they only do because they use the nightly mozconfig on all branches, and as a matter of fact, the nightly mozconfig didn't enable DMD before bug 1409739) This enables DMD on mingw builds with the same conditions applied as other platforms, meaning that it's not enabled on opt builds on release branches. And this enables DMD on plain builds, which, from this perspective, reflect local developer builds, and this is the expected effect. Depends on D21161 Differential Revision: https://phabricator.services.mozilla.com/D21162
browser/config/mozconfigs/linux32/debug
browser/config/mozconfigs/linux32/nightly
browser/config/mozconfigs/linux64/debug
browser/config/mozconfigs/linux64/debug-fuzzing
browser/config/mozconfigs/linux64/debug-searchfox-clang
browser/config/mozconfigs/linux64/debug-static-analysis-clang
browser/config/mozconfigs/linux64/nightly
browser/config/mozconfigs/macosx64/debug
browser/config/mozconfigs/macosx64/debug-searchfox
browser/config/mozconfigs/macosx64/debug-static-analysis
browser/config/mozconfigs/macosx64/nightly
browser/config/mozconfigs/macosx64/opt-static-analysis
browser/config/mozconfigs/whitelist
browser/config/mozconfigs/win32/debug
browser/config/mozconfigs/win32/debug-static-analysis
browser/config/mozconfigs/win32/nightly
browser/config/mozconfigs/win64-aarch64/debug
browser/config/mozconfigs/win64-aarch64/nightly
browser/config/mozconfigs/win64/debug
browser/config/mozconfigs/win64/nightly
toolkit/moz.configure
--- a/browser/config/mozconfigs/linux32/debug
+++ b/browser/config/mozconfigs/linux32/debug
@@ -1,10 +1,9 @@
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 ac_add_options --enable-verify-mar
 
 . $topsrcdir/build/mozconfig.stylo
 
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/unix/mozconfig.linux32
 
--- a/browser/config/mozconfigs/linux32/nightly
+++ b/browser/config/mozconfigs/linux32/nightly
@@ -1,8 +1,7 @@
 . "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
 
 ac_add_options --enable-verify-mar
-ac_add_options --enable-dmd
 
 ac_add_options --with-branding=browser/branding/nightly
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/debug
+++ b/browser/config/mozconfigs/linux64/debug
@@ -1,10 +1,9 @@
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 ac_add_options --enable-verify-mar
 
 . $topsrcdir/build/mozconfig.stylo
 
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/unix/mozconfig.linux
 
--- a/browser/config/mozconfigs/linux64/debug-fuzzing
+++ b/browser/config/mozconfigs/linux64/debug-fuzzing
@@ -1,10 +1,9 @@
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 ac_add_options --enable-verify-mar
 
 . $topsrcdir/build/mozconfig.stylo
 
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/unix/mozconfig.linux
 
--- a/browser/config/mozconfigs/linux64/debug-searchfox-clang
+++ b/browser/config/mozconfigs/linux64/debug-searchfox-clang
@@ -1,16 +1,15 @@
 MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . "$topsrcdir/build/mozconfig.common"
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 
 . $topsrcdir/build/mozconfig.stylo
 
 # Use Clang as specified in manifest
 export CC="$topsrcdir/clang/bin/clang"
 export CXX="$topsrcdir/clang/bin/clang++"
 
 # Save rust analysis (this requires unlocking the unstable features,
--- a/browser/config/mozconfigs/linux64/debug-static-analysis-clang
+++ b/browser/config/mozconfigs/linux64/debug-static-analysis-clang
@@ -1,16 +1,15 @@
 MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . "$topsrcdir/build/mozconfig.common"
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 
 . $topsrcdir/build/mozconfig.stylo
 
 # Use Clang as specified in manifest
 export CC="$topsrcdir/clang/bin/clang"
 export CXX="$topsrcdir/clang/bin/clang++"
 
 # Add the static checker
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -1,8 +1,7 @@
 . "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
 
 ac_add_options --enable-verify-mar
-ac_add_options --enable-dmd
 
 ac_add_options --with-branding=browser/branding/nightly
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/macosx64/debug
+++ b/browser/config/mozconfigs/macosx64/debug
@@ -1,12 +1,11 @@
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 ac_add_options --enable-verify-mar
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable Telemetry
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/browser/config/mozconfigs/macosx64/debug-searchfox
+++ b/browser/config/mozconfigs/macosx64/debug-searchfox
@@ -1,16 +1,15 @@
 MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 
 # Save rust analysis (this requires unlocking the unstable features,
 # which is done in the taskcluster task definition via RUSTC_BOOTSTRAP)
 export RUSTFLAGS="-Zsave-analysis"
 
 ac_add_options --enable-clang-plugin
 ac_add_options --enable-mozsearch-plugin
 
--- a/browser/config/mozconfigs/macosx64/debug-static-analysis
+++ b/browser/config/mozconfigs/macosx64/debug-static-analysis
@@ -1,12 +1,11 @@
 MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 
 ac_add_options --enable-clang-plugin
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/macosx64/nightly
+++ b/browser/config/mozconfigs/macosx64/nightly
@@ -1,14 +1,13 @@
 . "$topsrcdir/browser/config/mozconfigs/macosx64/common-opt"
 
 ac_add_options --disable-install-strip
 ac_add_options --enable-verify-mar
 ac_add_options --enable-instruments
-ac_add_options --enable-dmd
 
 # Cross-compiled builds fail when dtrace is enabled
 if test `uname -s` != Linux; then
   ac_add_options --enable-dtrace
 fi
 
 ac_add_options --enable-lto
 
--- a/browser/config/mozconfigs/macosx64/opt-static-analysis
+++ b/browser/config/mozconfigs/macosx64/opt-static-analysis
@@ -1,14 +1,13 @@
 MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --disable-debug
 ac_add_options --enable-optimize
-ac_add_options --enable-dmd
 
 ac_add_options --enable-clang-plugin
 
 . "$topsrcdir/build/mozconfig.common.override"
 
--- a/browser/config/mozconfigs/whitelist
+++ b/browser/config/mozconfigs/whitelist
@@ -4,17 +4,16 @@ whitelist = {
     'release': {},
     'nightly': {},
     }
 
 all_platforms = ['win64', 'win64-aarch64', 'win32', 'linux32', 'linux64', 'macosx64']
 
 for platform in all_platforms:
     whitelist['nightly'][platform] = [
-        'ac_add_options --enable-dmd',
         'ac_add_options --with-branding=browser/branding/nightly',
     ]
 
 whitelist['nightly']['macosx64'] += [
     'ac_add_options --disable-install-strip',
     'ac_add_options --enable-instruments',
     'ac_add_options --enable-dtrace',
     'if test `uname -s` != Linux; then',
--- a/browser/config/mozconfigs/win32/debug
+++ b/browser/config/mozconfigs/win32/debug
@@ -1,17 +1,15 @@
 . "$topsrcdir/build/mozconfig.win-common"
 MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 . "$topsrcdir/build/mozconfig.stylo"
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
-ac_add_options --enable-profiling  # needed for --enable-dmd to work on Windows
 ac_add_options --enable-verify-mar
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable Telemetry
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/browser/config/mozconfigs/win32/debug-static-analysis
+++ b/browser/config/mozconfigs/win32/debug-static-analysis
@@ -1,16 +1,15 @@
 MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
 
 ac_add_options --enable-clang-plugin
 
 . $topsrcdir/build/win32/mozconfig.vs-latest
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.clang-cl"
--- a/browser/config/mozconfigs/win32/nightly
+++ b/browser/config/mozconfigs/win32/nightly
@@ -1,9 +1,8 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win32/common-opt"
 
 ac_add_options --enable-verify-mar
-ac_add_options --enable-dmd
 
 ac_add_options --with-branding=browser/branding/nightly
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/win64-aarch64/debug
+++ b/browser/config/mozconfigs/win64-aarch64/debug
@@ -2,18 +2,16 @@
 MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 . "$topsrcdir/browser/config/mozconfigs/win64-aarch64/common-win64"
 
 . "$topsrcdir/build/mozconfig.stylo"
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
-ac_add_options --enable-profiling  # needed for --enable-dmd to work on Windows
 ac_add_options --enable-verify-mar
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable Telemetry
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/browser/config/mozconfigs/win64-aarch64/nightly
+++ b/browser/config/mozconfigs/win64-aarch64/nightly
@@ -1,14 +1,13 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win64-aarch64/common-win64"
 . "$topsrcdir/browser/config/mozconfigs/win64-aarch64/common-opt"
 
 ac_add_options --enable-verify-mar
-ac_add_options --enable-dmd
 
 ac_add_options --enable-lto
 
 ac_add_options --with-branding=browser/branding/nightly
 
 unset ENABLE_CLANG_PLUGIN
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/win64/debug
+++ b/browser/config/mozconfigs/win64/debug
@@ -1,18 +1,16 @@
 . "$topsrcdir/build/mozconfig.win-common"
 MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
 
 . "$topsrcdir/build/mozconfig.stylo"
 
 ac_add_options --enable-debug
-ac_add_options --enable-dmd
-ac_add_options --enable-profiling  # needed for --enable-dmd to work on Windows
 ac_add_options --enable-verify-mar
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable Telemetry
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/browser/config/mozconfigs/win64/nightly
+++ b/browser/config/mozconfigs/win64/nightly
@@ -1,10 +1,9 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-opt"
 
 ac_add_options --enable-verify-mar
-ac_add_options --enable-dmd
 
 ac_add_options --with-branding=browser/branding/nightly
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -87,31 +87,42 @@ def gecko_profiler_parse_elf(value, targ
 set_config('MOZ_GECKO_PROFILER_PARSE_ELF', gecko_profiler_parse_elf)
 set_define('MOZ_GECKO_PROFILER_PARSE_ELF', gecko_profiler_parse_elf)
 
 # enable this by default if the profiler is enabled
 # Note: also requires jemalloc
 set_config('MOZ_PROFILER_MEMORY', gecko_profiler_define)
 set_define('MOZ_PROFILER_MEMORY', gecko_profiler_define)
 
-option('--enable-dmd', env='MOZ_DMD',
-       help='Enable Dark Matter Detector (heap profiler). '
+
+@depends('--enable-debug', milestone, build_project,
+         # Artifact builds are included because the downloaded artifacts can
+         # have DMD enabled.
+         when=artifact_builds | depends(when='--enable-replace-malloc')(lambda: True))
+def dmd_default(debug, milestone, build_project):
+    return bool(build_project == 'browser' and (debug or milestone.is_nightly))
+
+
+option('--enable-dmd', env='MOZ_DMD', default=dmd_default,
+       help='{Enable|Disable} Dark Matter Detector (heap profiler). '
             'Also enables jemalloc, replace-malloc and profiling')
 
+
 @depends('--enable-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)
-imply_option('--enable-replace-malloc', dmd)
+imply_option('--enable-jemalloc', dmd, when=compile_environment)
+imply_option('--enable-replace-malloc', dmd, when=compile_environment)
 
 # ALSA cubeb backend
 # ==============================================================
 option('--enable-alsa', env='MOZ_ALSA',
        help='Enable ALSA audio backend.')
 
 alsa = pkg_check_modules('MOZ_ALSA', 'alsa', when='--enable-alsa')