Bug 1281603 - Respect --disable-debug even when MOZ_DEBUG is set in the environment. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Wed, 22 Jun 2016 14:58:32 -0700
changeset 302488 0cb8668f22788b51c8c492b3cedf7b455787121a
parent 302487 b9f69e5a65657af40a8af2811fe5be83454f8f71
child 302489 436cebf9fd491fb1ea0f52e56b15cff3e875d602
push id78761
push usercmanchester@mozilla.com
push dateThu, 23 Jun 2016 23:29:12 +0000
treeherdermozilla-inbound@0cb8668f2278 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1281603
milestone50.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 1281603 - Respect --disable-debug even when MOZ_DEBUG is set in the environment. r=glandium MozReview-Commit-ID: 9zPF9uzhhuM
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -85,18 +85,25 @@ set_define('GTEST_USE_OWN_TR1_TUPLE',
 set_define('GTEST_HAS_CLONE',
            delayed_getattr(linux_gtest_defines, 'has_clone'))
 
 js_option('--enable-debug',
           nargs='?',
           help='Enable building with developer debug info '
                '(using the given compiler flags).')
 
-add_old_configure_assignment('MOZ_DEBUG',
-                             depends_if('--enable-debug')(lambda _: True))
+@depends('--enable-debug')
+def debug_value(value):
+    # If a value was passed ensure this is set as the value for
+    # old-configure, so that --disable-debug works even when MOZ_DEBUG is
+    # set in the environment.
+    if value.origin != 'default':
+        return bool(value)
+
+add_old_configure_assignment('MOZ_DEBUG', debug_value)
 
 @depends('--disable-compile-environment', '--help')
 def toolchain_include(compile_env, help):
     if compile_env:
         return 'build/moz.configure/toolchain.configure'
 
 include(toolchain_include)