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 615435 ae6f5050fbbf41807f922e899d7f303fe8de9570
parent 615434 7eded73cc957834c9a952116aca81dbe568eaba1
child 615436 e3944a4eb19e0d217d9c3277936a194fb23e00a8
push id70353
push userbmo:mh+mozilla@glandium.org
push dateTue, 25 Jul 2017 23:00:35 +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."""