Bug 1382502 - Remove ${var}_IS_SET variables. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 20 Jul 2017 14:22:11 +0900
changeset 422054 692beddc13e32b15237075354d1d575aa3946a29
parent 422053 ed4688fd119a5c6714e78e67466eefe16b8e0ce1
child 422055 07bcdde68b57704a17a3c0d4ae3aeb33d687d095
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1382502, 1181040
milestone56.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 1382502 - Remove ${var}_IS_SET variables. r=ted In bug 1181040, we added ${var}_IS_SET variables for mk_add_options-defined variables. In the two years since, that has never been used for anything else than MOZ_PGO_IS_SET, and the only use for that has now been removed, so remove those ${var}_IS_SET variables.
build/moz.configure/init.configure
python/mozbuild/mozbuild/mozconfig_loader
python/mozbuild/mozbuild/test/test_mozconfig.py
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -274,19 +274,17 @@ def mozconfig_options(mozconfig, automat
 
         for key, value in mozconfig['env']['added'].iteritems():
             add(key, value)
             os.environ[key] = value
         for key, (_, value) in mozconfig['env']['modified'].iteritems():
             add(key, value)
             os.environ[key] = value
         for key, value in mozconfig['vars']['added'].iteritems():
-            # mozconfig_loader adds _IS_SET variables that are irrelevant
-            if not key.endswith('_IS_SET'):
-                add(key, value)
+            add(key, value)
         for key, (_, value) in mozconfig['vars']['modified'].iteritems():
             add(key, value)
 
 
 # Mozilla-Build
 # ==============================================================
 option(env='MOZILLABUILD', nargs=1,
        help='Path to Mozilla Build (Windows-only)')
--- a/python/mozbuild/mozbuild/mozconfig_loader
+++ b/python/mozbuild/mozbuild/mozconfig_loader
@@ -32,29 +32,16 @@ ac_add_app_options() {
   echo "$*"
   echo "------END_AC_APP_OPTION"
 }
 
 mk_add_options() {
   for _mozconfig_opt; do
     echo "------BEGIN_MK_OPTION"
     echo $_mozconfig_opt
-    # Remove any leading "export"
-    opt=${_mozconfig_opt#export}
-    case "$_mozconfig_opt" in
-    *\?=*) _mozconfig_op="?=" ;;
-    *:=*) _mozconfig_op=":=" ;;
-    *+=*) _mozconfig_op="+=" ;;
-    *=*) _mozconfig_op="=" ;;
-    esac
-    # Remove the operator and the value that follows
-    _mozconfig_name=${_mozconfig_opt%%${_mozconfig_op}*}
-    # Note: $(echo ${_mozconfig_name}) strips the variable from any leading and trailing
-    # whitespaces.
-    eval "$(echo ${_mozconfig_name})_IS_SET=1"
     echo "------END_MK_OPTION"
   done
 }
 
 echo "------BEGIN_ENV_BEFORE_SOURCE"
 $3 $4
 echo "------END_ENV_BEFORE_SOURCE"
 
--- a/python/mozbuild/mozbuild/test/test_mozconfig.py
+++ b/python/mozbuild/mozbuild/test/test_mozconfig.py
@@ -314,20 +314,16 @@ class TestMozconfigLoader(unittest.TestC
             mozconfig.write('mk_add_options BIZ=1\n')
             mozconfig.flush()
 
             result = self.get_loader().read_mozconfig(mozconfig.name)
             self.assertEqual(result['topobjdir'], '/foo/bar')
             self.assertEqual(result['make_flags'], ['-j8', '-s'])
             self.assertEqual(result['make_extra'], ['FOO=BAR BAZ', 'BIZ=1'])
 
-            vars = result['vars']['added']
-            for var in ('MOZ_OBJDIR', 'MOZ_MAKE_FLAGS', 'FOO', 'BIZ'):
-                self.assertEqual(vars.get('%s_IS_SET' % var), '1')
-
     def test_read_empty_mozconfig_objdir_environ(self):
         os.environ[b'MOZ_OBJDIR'] = b'obj-firefox'
         with NamedTemporaryFile(mode='w') as mozconfig:
             result = self.get_loader().read_mozconfig(mozconfig.name)
             self.assertEqual(result['topobjdir'], 'obj-firefox')
 
     def test_read_capture_mk_options_objdir_environ(self):
         """Ensures mk_add_options calls are captured and override the environ."""