Backed out 6 changesets (bug 1377216) for SM(pkg) bustage on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 19 Jul 2017 22:14:03 -0400
changeset 418513 b31c56eb631789f9a1ffce34bf24e50d4da2950c
parent 418512 42204c0ff24aae4637606ffc525cda7fdb6bccd4
child 418525 0985725c848ec0cfc6f2f3c3a5aa3d71321e7620
child 418534 06e2da701e49f5a474bac8a1e819b82ccac86dc6
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1377216
milestone56.0a1
backs outb5701f3ce50613dc6c88f76e177631676ddbe2a9
1f37aebe0f438dc0a8d05708d407c43046812bdc
c8931588f674c86b6b1a749dcf419c8f959f7f1a
ded5328ba74cf66d45d97ccb9997d59853c42e12
6cb234539746e2d85c7bca3f808fed879ba0b676
ce836965fd58ca3e59fa52123b1422ecfde51fc3
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 6 changesets (bug 1377216) for SM(pkg) bustage on a CLOSED TREE. Backed out changeset b5701f3ce506 (bug 1377216) Backed out changeset 1f37aebe0f43 (bug 1377216) Backed out changeset c8931588f674 (bug 1377216) Backed out changeset ded5328ba74c (bug 1377216) Backed out changeset 6cb234539746 (bug 1377216) Backed out changeset ce836965fd58 (bug 1377216)
build/moz.configure/init.configure
build/moz.configure/util.configure
python/mozbuild/mozbuild/base.py
python/mozbuild/mozbuild/mach_commands.py
python/mozversioncontrol/mozversioncontrol/__init__.py
taskcluster/scripts/builder/build-sm-package.sh
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -304,96 +304,16 @@ def shell(value, mozillabuild):
     shell = 'sh'
     if mozillabuild:
         shell = mozillabuild[0] + '/msys/bin/sh'
     if sys.platform == 'win32':
         shell = shell + '.exe'
     return find_program(shell)
 
 
-# Source checkout and version control integration.
-# ================================================
-
-@depends(check_build_environment, 'MOZ_AUTOMATION')
-@checking('for vcs source checkout')
-@imports('os')
-def vcs_checkout_type(build_env, automation):
-    if os.path.exists(os.path.join(build_env.topsrcdir, '.hg')):
-        return 'hg'
-    elif os.path.exists(os.path.join(build_env.topsrcdir, '.git')):
-        return 'git'
-    elif automation:
-        raise FatalCheckError('unable to resolve VCS type; must run '
-                              'from a source checkout when MOZ_AUTOMATION '
-                              'is set')
-
-# Resolve VCS binary for detected repository type.
-hg = check_prog('HG', ('hg',), allow_missing=True,
-                when=depends(vcs_checkout_type)(lambda x: x == 'hg'))
-git = check_prog('GIT', ('git',), allow_missing=True,
-                 when=depends(vcs_checkout_type)(lambda x: x == 'git'))
-
-@depends_if(hg)
-@checking('for Mercurial version')
-@imports('os')
-@imports('re')
-def hg_version(hg):
-    # HGPLAIN in Mercurial 1.5+ forces stable output, regardless of set
-    # locale or encoding.
-    env = dict(os.environ)
-    env['HGPLAIN'] = '1'
-
-    out = check_cmd_output(hg, '--version', env=env)
-
-    match = re.search(r'Mercurial Distributed SCM \(version ([^\)]+)', out)
-
-    if not match:
-        raise FatalCheckError('unable to determine Mercurial version: %s' % out)
-
-    # The version string may be "unknown" for Mercurial run out of its own
-    # source checkout or for bad builds. But LooseVersion handles it.
-
-    return Version(match.group(1))
-
-@depends_if(git)
-@checking('for Git version')
-@imports('re')
-def git_version(git):
-    out = check_cmd_output(git, '--version').rstrip()
-
-    match = re.search('git version (.*)$', out)
-
-    if not match:
-        raise FatalCheckError('unable to determine Git version: %s' % out)
-
-    return Version(match.group(1))
-
-# Only set VCS_CHECKOUT_TYPE if we resolved the VCS binary.
-# Require resolved VCS info when running in automation so automation's
-# environment is more well-defined.
-@depends(vcs_checkout_type, hg_version, git_version, 'MOZ_AUTOMATION')
-def exposed_vcs_checkout_type(vcs_checkout_type, hg, git, automation):
-    if vcs_checkout_type == 'hg':
-        if hg:
-            return 'hg'
-
-        if automation:
-            raise FatalCheckError('could not resolve Mercurial binary info')
-
-    elif vcs_checkout_type == 'git':
-        if git:
-            return 'git'
-
-        if automation:
-            raise FatalCheckError('could not resolve Git binary info')
-    elif vcs_checkout_type:
-        raise FatalCheckError('unhandled VCS type: %s' % vcs_checkout_type)
-
-set_config('VCS_CHECKOUT_TYPE', exposed_vcs_checkout_type)
-
 # Host and target systems
 # ==============================================================
 option('--host', nargs=1, help='Define the system type performing the build')
 
 option('--target', nargs=1,
        help='Define the system type where the resulting executables will be '
             'used')
 
--- a/build/moz.configure/util.configure
+++ b/build/moz.configure/util.configure
@@ -17,44 +17,27 @@ def configure_error(message):
     Primarily for use in moz.configure templates to sanity check
     their inputs from moz.configure usage.'''
     raise ConfigureError(message)
 
 # A wrapper to obtain a process' output that returns the output generated
 # by running the given command if it exits normally, and streams that
 # output to log.debug and calls die or the given error callback if it
 # does not.
-@imports(_from='__builtin__', _import='unicode')
 @imports('subprocess')
 @imports('sys')
 @imports(_from='mozbuild.configure.util', _import='LineIO')
 @imports(_from='mozbuild.shellutil', _import='quote')
 def check_cmd_output(*args, **kwargs):
     onerror = kwargs.pop('onerror', None)
 
-    # subprocess on older Pythons can't handle unicode keys or values in
-    # environment dicts. Normalize automagically so callers don't have to
-    # deal with this.
-    if 'env' in kwargs:
-        normalized_env = {}
-        for k, v in kwargs['env'].items():
-            if isinstance(k, unicode):
-                k = k.encode('utf-8', 'strict')
-
-            if isinstance(v, unicode):
-                v = v.encode('utf-8', 'strict')
-
-            normalized_env[k] = v
-
-        kwargs['env'] = normalized_env
-
     with log.queue_debug():
         log.debug('Executing: `%s`', quote(*args))
         proc = subprocess.Popen(args, stdout=subprocess.PIPE,
-                                stderr=subprocess.PIPE, **kwargs)
+                                stderr=subprocess.PIPE)
         stdout, stderr = proc.communicate()
         retcode = proc.wait()
         if retcode == 0:
             return stdout
 
         log.debug('The command returned non-zero exit status %d.',
                   retcode)
         for out, desc in ((stdout, 'output'), (stderr, 'error output')):
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -746,22 +746,34 @@ class MachCommandConditions(object):
         """Must have an Android build."""
         if hasattr(cls, 'substs'):
             return cls.substs.get('MOZ_WIDGET_TOOLKIT') == 'android'
         return False
 
     @staticmethod
     def is_hg(cls):
         """Must have a mercurial source checkout."""
-        return getattr(cls, 'substs', {}).get('VCS_CHECKOUT_TYPE') == 'hg'
+        if hasattr(cls, 'substs'):
+            top_srcdir = cls.substs.get('top_srcdir')
+        elif hasattr(cls, 'topsrcdir'):
+            top_srcdir = cls.topsrcdir
+        else:
+            return False
+        return top_srcdir and os.path.isdir(os.path.join(top_srcdir, '.hg'))
 
     @staticmethod
     def is_git(cls):
         """Must have a git source checkout."""
-        return getattr(cls, 'substs', {}).get('VCS_CHECKOUT_TYPE') == 'git'
+        if hasattr(cls, 'substs'):
+            top_srcdir = cls.substs.get('top_srcdir')
+        elif hasattr(cls, 'topsrcdir'):
+            top_srcdir = cls.topsrcdir
+        else:
+            return False
+        return top_srcdir and os.path.exists(os.path.join(top_srcdir, '.git'))
 
 
 class PathArgument(object):
     """Parse a filesystem path argument and transform it in various ways."""
 
     def __init__(self, arg, topsrcdir, topobjdir, cwd=None):
         self.arg = arg
         self.topsrcdir = topsrcdir
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1624,26 +1624,34 @@ class PackageFrontend(MachCommandBase):
 
         '''
         pass
 
     def _make_artifacts(self, tree=None, job=None, skip_cache=False):
         state_dir = self._mach_context.state_dir
         cache_dir = os.path.join(state_dir, 'package-frontend')
 
+        import which
+
         here = os.path.abspath(os.path.dirname(__file__))
         build_obj = MozbuildObject.from_environment(cwd=here)
 
         hg = None
         if conditions.is_hg(build_obj):
-            hg = build_obj.substs['HG']
+            if self._is_windows():
+                hg = which.which('hg.exe')
+            else:
+                hg = which.which('hg')
 
         git = None
         if conditions.is_git(build_obj):
-            git = build_obj.substs['GIT']
+            if self._is_windows():
+                git = which.which('git.exe')
+            else:
+                git = which.which('git')
 
         from mozbuild.artifacts import Artifacts
         artifacts = Artifacts(tree, self.substs, self.defines, job,
                               log=self.log, cache_dir=cache_dir,
                               skip_cache=skip_cache, hg=hg, git=git,
                               topsrcdir=self.topsrcdir)
         return artifacts
 
--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
@@ -8,19 +8,16 @@ import os
 import re
 import subprocess
 import which
 
 from distutils.version import LooseVersion
 
 def get_tool_path(tool):
     """Obtain the path of `tool`."""
-    if os.path.isabs(tool) and os.path.exists(tool):
-        return tool
-
     # We use subprocess in places, which expects a Win32 executable or
     # batch script. On some versions of MozillaBuild, we have "hg.exe",
     # "hg.bat," and "hg" (a Python script). "which" will happily return the
     # Python script, which will cause subprocess to choke. Explicitly favor
     # the Windows version over the plain script.
     try:
         return which.which(tool + '.exe')
     except which.WhichError:
@@ -81,18 +78,18 @@ class Repository(object):
 
     def get_files_in_working_directory(self):
         """Obtain a list of managed files in the working directory."""
         raise NotImplementedError
 
 
 class HgRepository(Repository):
     '''An implementation of `Repository` for Mercurial repositories.'''
-    def __init__(self, path, hg='hg'):
-        super(HgRepository, self).__init__(path, tool=hg)
+    def __init__(self, path):
+        super(HgRepository, self).__init__(path, 'hg')
         self._env[b'HGPLAIN'] = b'1'
 
     def get_modified_files(self):
         # Use --no-status to print just the filename.
         return self._run('status', '--modified', '--no-status').splitlines()
 
     def get_added_files(self):
         # Use --no-status to print just the filename.
@@ -110,18 +107,18 @@ class HgRepository(Repository):
     def get_files_in_working_directory(self):
         # Can return backslashes on Windows. Normalize to forward slashes.
         return list(p.replace('\\', '/') for p in
                     self._run('files', '-0').split('\0'))
 
 
 class GitRepository(Repository):
     '''An implementation of `Repository` for Git repositories.'''
-    def __init__(self, path, git='git'):
-        super(GitRepository, self).__init__(path, tool=git)
+    def __init__(self, path):
+        super(GitRepository, self).__init__(path, 'git')
 
     def get_modified_files(self):
         return self._run('diff', '--diff-filter=M', '--name-only').splitlines()
 
     def get_added_files(self):
         return self._run('diff', '--diff-filter=A', '--name-only').splitlines()
 
     def add_remove_files(self, path):
@@ -146,64 +143,25 @@ def get_repository_object(path):
         return HgRepository(path)
     elif os.path.exists(os.path.join(path, '.git')):
         return GitRepository(path)
     else:
         raise InvalidRepoPath('Unknown VCS, or not a source checkout: %s' %
                               path)
 
 
-class MissingVCSInfo(Exception):
-    """Represents a general failure to resolve a VCS interface."""
-
-
-class MissingConfigureInfo(MissingVCSInfo):
-    """Represents error finding VCS info from configure data."""
-
-
 def get_repository_from_env():
-    """Obtain a repository object by looking at the environment.
-
-    If inside a build environment (denoted by presence of a ``buildconfig``
-    module), VCS info is obtained from it, as found via configure. This allows
-    us to respect what was passed into configure. Otherwise, we fall back to
-    scanning the filesystem.
-    """
-    try:
-        import buildconfig
-
-        flavor = buildconfig.substs.get('VCS_CHECKOUT_TYPE')
-
-        # If in build mode, only use what configure found. That way we ensure
-        # that everything in the build system can be controlled via configure.
-        if not flavor:
-            raise MissingConfigureInfo('could not find VCS_CHECKOUT_TYPE '
-                                       'in build config; check configure '
-                                       'output and verify it could find a '
-                                       'VCS binary')
-
-        if flavor == 'hg':
-            return HgRepository(buildconfig.topsrcdir,
-                                hg=buildconfig.substs['HG'])
-        elif flavor == 'git':
-            return GitRepository(buildconfig.topsrcdir,
-                                 git=buildconfig.subst['GIT'])
-        else:
-            raise MissingVCSInfo('unknown VCS_CHECKOUT_TYPE value: %s' % flavor)
-
-    except ImportError:
-        pass
-
+    """Obtain a repository object by looking at the environment."""
     def ancestors(path):
         while path:
             yield path
             path, child = os.path.split(path)
             if child == '':
                 break
 
     for path in ancestors(os.getcwd()):
         try:
             return get_repository_object(path)
         except InvalidRepoPath:
             continue
 
-    raise MissingVCSInfo('Could not find Mercurial or Git checkout for %s' %
-                         os.getcwd())
+    raise Exception('Could not find Mercurial or Git checkout for %s' %
+                    os.getcwd())
--- a/taskcluster/scripts/builder/build-sm-package.sh
+++ b/taskcluster/scripts/builder/build-sm-package.sh
@@ -16,18 +16,13 @@ mkdir -p $PACKAGE_DIR
 pushd $PACKAGE_DIR
 
 tar -xjvf $UPLOAD_DIR/mozjs-*.tar.bz2
 
 : ${PYTHON:=python2.7}
 
 # Build the freshly extracted, packaged SpiderMonkey.
 pushd ./mozjs-*/js/src
-
-# MOZ_AUTOMATION enforces certain requirements that don't apply to
-# packaged builds. Unset it.
-unset MOZ_AUTOMATION
-
 AUTOMATION=1 $PYTHON ./devtools/automation/autospider.py --skip-tests=checks $SPIDERMONKEY_VARIANT
 popd
 
 # Copy artifacts for upload by TaskCluster
 cp -rL ./mozjs-*/obj-spider/dist/bin/{js,jsapi-tests,js-gdb.py,libmozjs*} $UPLOAD_DIR