Bug 1520340 - Normalize old_configure's result earlier. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Jan 2019 14:58:30 +0000
changeset 511279 7695daf6bc2da8616269282f55b4bf88b2a8abc3
parent 511278 fad773445014ef73076aae5f2460984c79b37a3c
child 511280 191f54a3dd6c24ec9025ed771112ef3226dc87de
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1520340
milestone66.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 1520340 - Normalize old_configure's result earlier. r=froydnj Depends on D16618 Differential Revision: https://phabricator.services.mozilla.com/D16619
build/moz.configure/old.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -264,16 +264,17 @@ def old_configure_options(*options):
     '--x-libraries',
 )
 @imports(_from='__builtin__', _import='compile')
 @imports(_from='__builtin__', _import='open')
 @imports('logging')
 @imports('os')
 @imports('subprocess')
 @imports('sys')
+@imports('types')
 @imports(_from='mozbuild.shellutil', _import='quote')
 @imports(_from='mozbuild.shellutil', _import='split')
 @imports(_from='mozbuild.util', _import='encode')
 def old_configure(prepare_configure, extra_old_configure_args, all_options,
                   *options):
     cmd = prepare_configure
 
     # old-configure only supports the options listed in @old_configure_options
@@ -348,16 +349,23 @@ def old_configure(prepare_configure, ext
     for flag in raw_config['flags']:
         if flag not in all_options:
             die('Missing option in `@old_configure_options` in %s: %s',
                 __file__, flag)
 
     # If the code execution above fails, we want to keep the file around for
     # debugging.
     os.remove('config.data')
+
+    for c in ('substs', 'defines'):
+        raw_config[c] = [
+            (k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
+            for k, v in raw_config[c]
+        ]
+
     return raw_config
 
 
 # set_config is only available in the global namespace, not directly in
 # @depends functions, but we do need to enumerate the result of
 # old_configure, so we cheat.
 @imports('__sandbox__')
 def set_old_configure_config(name, value):
@@ -367,24 +375,22 @@ def set_old_configure_config(name, value
 
 
 @imports('__sandbox__')
 def set_old_configure_define(name, value):
     __sandbox__.set_define_impl(name, value)
 
 
 @depends(old_configure)
-@imports('types')
 def post_old_configure(raw_config):
     for k, v in raw_config['substs']:
-        set_old_configure_config(
-            k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
+        set_old_configure_config(k, v)
 
     for k, v in dict(raw_config['defines']).iteritems():
-        set_old_configure_define(k[1:-1], v[1:-1])
+        set_old_configure_define(k, v)
 
     set_old_configure_config('non_global_defines',
                              raw_config['non_global_defines'])
 
 
 # Assuming no other option is declared after this function, handle the
 # env options that were injected by mozconfig_options by creating dummy
 # Option instances and having the sandbox's CommandLineHelper handle