Bug 1519603 - Remove dead code in build/subconfigure.py. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 14 Jan 2019 18:33:33 +0000
changeset 453867 c8f92004fdfba2861c7a4ca2ab0abbb65ae8aa7e
parent 453866 9386709aeec02c6706fadc49d7e4f7c63c73203f
child 453868 78ac28070badf85fe5d2f8f13e8f83fb4edbf1f8
push id35378
push userbtara@mozilla.com
push dateTue, 15 Jan 2019 16:08:45 +0000
treeherdermozilla-central@5090d461e169 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1519603
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 1519603 - Remove dead code in build/subconfigure.py. r=nalexander We only run it for js/src now, so get_config_files always returns empty lists. Depends on D16378 Differential Revision: https://phabricator.services.mozilla.com/D16379
build/subconfigure.py
--- a/build/subconfigure.py
+++ b/build/subconfigure.py
@@ -115,62 +115,16 @@ def maybe_clear_cache(data):
             print('  %s' % (value if value is not None else 'undefined'))
             print('to:')
             print('  %s' % env.get(precious, 'undefined'))
             os.remove(data['cache-file'])
             return True
     return False
 
 
-def split_template(s):
-    """Given a "file:template" string, returns "file", "template". If the string
-    is of the form "file" (without a template), returns "file", "file.in"."""
-    if ':' in s:
-        return s.split(':', 1)
-    return s, '%s.in' % s
-
-
-def get_config_files(data):
-    # config.status in js/src never contains the output we try to scan here.
-    if data['relobjdir'] == 'js/src':
-        return [], []
-
-    config_status = mozpath.join(data['objdir'], 'config.status')
-    if not os.path.exists(config_status):
-        return [], []
-
-    config_files = []
-    command_files = []
-
-    # Scan the config.status output for information about configuration files
-    # it generates.
-    config_status_output = subprocess.check_output(
-        [data['shell'], '-c', '%s --help' % config_status],
-        stderr=subprocess.STDOUT).splitlines()
-    state = None
-    for line in config_status_output:
-        if line.startswith('Configuration') and line.endswith(':'):
-            if line.endswith('commands:'):
-                state = 'commands'
-            else:
-                state = 'config'
-        elif not line.strip():
-            state = None
-        elif state:
-            for f, t in (split_template(couple) for couple in line.split()):
-                f = mozpath.join(data['objdir'], f)
-                t = mozpath.join(data['srcdir'], t)
-                if state == 'commands':
-                    command_files.append(f)
-                else:
-                    config_files.append((f, t))
-
-    return config_files, command_files
-
-
 def prepare(srcdir, objdir, shell, args):
     parser = argparse.ArgumentParser()
     parser.add_argument('--target', type=str)
     parser.add_argument('--host', type=str)
     parser.add_argument('--build', type=str)
     parser.add_argument('--cache-file', type=str)
     # The --srcdir argument is simply ignored. It's a useless autoconf feature
     # that we don't support well anyways. This makes it stripped from `others`
@@ -263,29 +217,16 @@ def run(objdir):
     data['objdir'] = objdir
     relobjdir = data['relobjdir'] = os.path.relpath(objdir, os.getcwd())
 
     cache_file = data['cache-file']
     cleared_cache = True
     if os.path.exists(cache_file):
         cleared_cache = maybe_clear_cache(data)
 
-    config_files, command_files = get_config_files(data)
-    contents = []
-    for f, t in config_files:
-        contents.append(File(f))
-
-    # AC_CONFIG_COMMANDS actually only registers tags, not file names
-    # but most commands are tagged with the file name they create.
-    # However, a few don't, or are tagged with a directory name (and their
-    # command is just to create that directory)
-    for f in command_files:
-        if os.path.isfile(f):
-            contents.append(File(f))
-
     # Only run configure if one of the following is true:
     # - config.status doesn't exist
     # - config.status is older than an input to configure
     # - the configure arguments changed
     # - the environment changed in a way that requires a cache clear.
     configure = mozpath.join(data['srcdir'], 'old-configure')
     config_status_path = mozpath.join(objdir, 'config.status')
     skip_configure = True
@@ -351,35 +292,24 @@ def run(objdir):
         # Running config.status in js/src actually does nothing, so we just
         # skip it.
         pass
     elif not config_status or config_status.modified:
         # If config.status doesn't exist after configure (because it's not
         # an autoconf configure), skip it.
         if os.path.exists(config_status_path):
             skip_config_status = False
-    else:
-        # config.status changed or was created, so we need to update the
-        # list of config and command files.
-        config_files, command_files = get_config_files(data)
-        for f, t in config_files:
-            if not os.path.exists(t) or \
-                    os.path.getmtime(f) < os.path.getmtime(t):
-                skip_config_status = False
 
     if not skip_config_status:
         if skip_configure:
             print(prefix_lines('running config.status', relobjdir))
             sys.stdout.flush()
         ret = execute_and_prefix([data['shell'], '-c', './config.status'],
                                  cwd=objdir, env=data['env'], prefix=relobjdir)
 
-        for f in contents:
-            f.update_time()
-
     return ret
 
 
 def subconfigure(args):
     parser = argparse.ArgumentParser()
     parser.add_argument('--list', type=str,
                         help='File containing a list of subconfigures to run')
     parser.add_argument('subconfigures', type=str, nargs='*',