Bug 1634623 - Don't pass js configure flags to old-configure. r=firefox-build-system-reviewers,rstewart

As mentioned in previous change, js subconfigure used to be called from
old-configure, and some of that old setup remains to this day.

They don't really cause problems, except speed issues, especially on
Windows: arguments passed to old-configure is treated in a large shell
loop, and the more arguments are passed, the longer it takes. On my
machine, this cumulates to more than 10s! For arguments it doesn't
recognizes and doesn't use. And the environment variable js_options are
not used either, although they don't have a similar impact.

What we're doing here:
- Remove js_options from extra_old_configure_args, that leaves only
  host_for_sub_configure and target_for_sub_configure there.
- Since none of the above are environment variables, we don't need to
  separate out environment variables, nor to pass them down to
  old-configure.

Differential Revision: https://phabricator.services.mozilla.com/D73410
This commit is contained in:
Mike Hommey 2020-05-01 16:30:26 +00:00
parent 2ee3a6437c
commit 686830ec36
2 changed files with 2 additions and 21 deletions

View File

@ -1252,9 +1252,6 @@ def js_option(*args, **kwargs):
if build_project != 'js':
arg = value.format(opt.option)
js_configure_args.append(arg)
return arg
add_old_configure_arg(js_option)
js_option(env='MOZILLA_OFFICIAL',

View File

@ -298,21 +298,11 @@ def prepare_configure_options(extra_old_configure_args, all_options, *options):
if value.origin != 'default'
]
extra_env = {}
# We also pass it the options from js/moz.configure so that it can pass
# them down to js/src/configure. Note this list is empty when running
# js/src/configure, in which case we don't need to pass those options
# to old-configure since old-configure doesn't handle them anyways.
if extra_old_configure_args:
for arg in extra_old_configure_args:
if arg.startswith('-'):
options.append(arg)
else:
k, v = arg.split('=', 1)
extra_env[k] = v
options.append(arg)
return namespace(options=options, extra_env=extra_env, all_options=all_options)
return namespace(options=options, all_options=all_options)
@depends(prepare_configure, prepare_configure_options, altered_path)
@ -329,17 +319,11 @@ def prepare_configure_options(extra_old_configure_args, all_options, *options):
@imports(_from='six', _import='string_types')
def old_configure(prepare_configure, prepare_configure_options, altered_path):
cmd = prepare_configure + prepare_configure_options.options
extra_env = prepare_configure_options.extra_env
env = dict(os.environ)
if extra_env:
env.update(extra_env)
# For debugging purpose, in case it's not what we'd expect.
log.debug('Running %s', quote(*cmd))
if extra_env:
log.debug('with extra environment: %s',
' '.join('%s=%s' % pair for pair in iteritems(extra_env)))
# Our logging goes to config.log, the same file old.configure uses.
# We can't share the handle on the file, so close it.