Bug 1382502 - Remove ${var}_IS_SET variables. r?ted draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 20 Jul 2017 14:22:11 +0900
changeset 611989 f39b4640d342d613a494fdc3da7112e7fba7f4ee
parent 611988 aa9ee3c3df4af04054a360bc0d229a2cc420efb8
child 638279 128c585e827695b8ca6126026cdbf3e5a8b3a515
push id69351
push userbmo:mh+mozilla@glandium.org
push dateThu, 20 Jul 2017 06:52:11 +0000
reviewersted
bugs1382502, 1181040
milestone56.0a1
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."""