Backed out changeset 415534347ba0 (bug 1636574) for build bustages. CLOSED TREE
authorRazvan Maries <rmaries@mozilla.com>
Wed, 20 May 2020 19:09:46 +0300
changeset 531275 8dba8b454ae100a6e7f5e2ea2745f6c19c928d7a
parent 531274 3f8bd0042ec2f093ad1c712924816cc3c6ac6eb6
child 531276 b45a70689704ffc67766812444530cb15005eb45
push id37436
push userncsoregi@mozilla.com
push dateWed, 20 May 2020 21:30:50 +0000
treeherdermozilla-central@6c10970490f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1636574
milestone78.0a1
backs out415534347ba0c79d4d7ebc27c85723363aaceec3
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
Backed out changeset 415534347ba0 (bug 1636574) for build bustages. CLOSED TREE
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -228,62 +228,16 @@ def shell(value, mozillabuild):
 def help_shell(help, shell):
     if help and not shell:
         return 'sh'
 
 
 shell = help_shell | shell
 
 
-# Inject mozconfig options
-# ==============================================================
-
-
-@depends(mozconfig, 'MOZ_AUTOMATION', '--help')
-# This gives access to the sandbox. Don't copy this blindly.
-@imports('__sandbox__')
-@imports('os')
-@imports('six')
-def mozconfig_options(mozconfig, automation, help):
-    if mozconfig['path']:
-        if 'MOZ_AUTOMATION_MOZCONFIG' in mozconfig['env']['added']:
-            if not automation:
-                log.error('%s directly or indirectly includes an in-tree '
-                          'mozconfig.', mozconfig['path'])
-                log.error('In-tree mozconfigs make strong assumptions about '
-                          'and are only meant to be used by Mozilla '
-                          'automation.')
-                die("Please don't use them.")
-        helper = __sandbox__._helper
-        log.info('Adding configure options from %s' % mozconfig['path'])
-        for arg in mozconfig['configure_args']:
-            log.info('  %s' % arg)
-            # We could be using imply_option() here, but it has other
-            # contraints that don't really apply to the command-line
-            # emulation that mozconfig provides.
-            helper.add(arg, origin='mozconfig', args=helper._args)
-
-        def add(key, value):
-            if key.isupper():
-                arg = '%s=%s' % (key, value)
-                log.info('  %s' % arg)
-                helper.add(arg, origin='mozconfig', args=helper._args)
-
-        for key, value in six.iteritems(mozconfig['env']['added']):
-            add(key, value)
-            os.environ[key] = value
-        for key, (_, value) in six.iteritems(mozconfig['env']['modified']):
-            add(key, value)
-            os.environ[key] = value
-        for key, value in six.iteritems(mozconfig['vars']['added']):
-            add(key, value)
-        for key, (_, value) in six.iteritems(mozconfig['vars']['modified']):
-            add(key, value)
-
-
 # Python 3
 # ========
 
 option(env='PYTHON3', nargs=1, help='Python 3 interpreter (3.5 or later)')
 
 
 @depends('PYTHON3', check_build_environment, mozconfig, '--help')
 @imports(_from='__builtin__', _import='Exception')
@@ -438,16 +392,81 @@ def virtualenv_python3(env_python, build
 def virtualenv_python3(venv):
     return venv
 
 
 set_config('PYTHON3', virtualenv_python3.path)
 set_config('PYTHON3_VERSION', virtualenv_python3.str_version)
 
 
+# Inject mozconfig options
+# ==============================================================
+# All options defined above this point can't be injected in mozconfig_options
+# below, so collect them.
+
+
+@template
+def early_options():
+    @dependable
+    @imports('__sandbox__')
+    @imports(_from='six', _import='itervalues')
+    def early_options():
+        return set(
+            option.env
+            for option in itervalues(__sandbox__._options)
+            if option.env
+        )
+    return early_options
+
+
+early_options = early_options()
+
+
+@depends(mozconfig, 'MOZ_AUTOMATION', '--help')
+# This gives access to the sandbox. Don't copy this blindly.
+@imports('__sandbox__')
+@imports('os')
+@imports('six')
+def mozconfig_options(mozconfig, automation, help):
+    if mozconfig['path']:
+        if 'MOZ_AUTOMATION_MOZCONFIG' in mozconfig['env']['added']:
+            if not automation:
+                log.error('%s directly or indirectly includes an in-tree '
+                          'mozconfig.', mozconfig['path'])
+                log.error('In-tree mozconfigs make strong assumptions about '
+                          'and are only meant to be used by Mozilla '
+                          'automation.')
+                die("Please don't use them.")
+        helper = __sandbox__._helper
+        log.info('Adding configure options from %s' % mozconfig['path'])
+        for arg in mozconfig['configure_args']:
+            log.info('  %s' % arg)
+            # We could be using imply_option() here, but it has other
+            # contraints that don't really apply to the command-line
+            # emulation that mozconfig provides.
+            helper.add(arg, origin='mozconfig', args=helper._args)
+
+        def add(key, value):
+            if key.isupper():
+                arg = '%s=%s' % (key, value)
+                log.info('  %s' % arg)
+                helper.add(arg, origin='mozconfig', args=helper._args)
+
+        for key, value in six.iteritems(mozconfig['env']['added']):
+            add(key, value)
+            os.environ[key] = value
+        for key, (_, value) in six.iteritems(mozconfig['env']['modified']):
+            add(key, value)
+            os.environ[key] = value
+        for key, value in six.iteritems(mozconfig['vars']['added']):
+            add(key, value)
+        for key, (_, value) in six.iteritems(mozconfig['vars']['modified']):
+            add(key, value)
+
+
 # Source checkout and version control integration.
 # ================================================
 
 
 @depends(check_build_environment, 'MOZ_AUTOMATION', '--help')
 @checking('for vcs source checkout')
 @imports('os')
 def vcs_checkout_type(build_env, automation, help):