Backed out changeset 432f32e842dd (bug 648681) for test failures on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 08 Mar 2013 14:19:42 -0500
changeset 124254 77066de4b3395fbbf105d5bd56e239605b4a4b34
parent 124253 e4bd773544f3f08106a6499bb368e16769eb1d73
child 124255 4740975a1063d58f1e092f5eccd0f9b1a7843d7b
push idunknown
push userunknown
push dateunknown
bugs648681
milestone22.0a1
backs out432f32e842dda7f4aae173c1f72e02eb580dce67
Backed out changeset 432f32e842dd (bug 648681) for test failures on a CLOSED TREE.
build/mach_bootstrap.py
python/mozbuild/mozbuild/base.py
python/mozbuild/mozbuild/mach_commands.py
python/mozbuild/mozbuild/test/test_base.py
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -8,21 +8,20 @@ import os
 import platform
 import sys
 
 # TODO Bug 794506 Integrate with the in-tree virtualenv configuration.
 SEARCH_PATHS = [
     'python/mach',
     'python/mozboot',
     'python/mozbuild',
+    'build/pymake',
     'python/blessings',
     'python/psutil',
     'python/which',
-    'build/pymake',
-    'config',
     'other-licenses/ply',
     'xpcom/idl-parser',
     'testing',
     'testing/xpcshell',
     'testing/mozbase/mozprocess',
     'testing/mozbase/mozfile',
     'testing/mozbase/mozinfo',
 ]
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -11,17 +11,16 @@ import subprocess
 import sys
 import which
 
 from mach.mixin.logging import LoggingMixin
 from mach.mixin.process import ProcessExecutionMixin
 
 from mozfile.mozfile import rmtree
 
-from .backend.configenvironment import ConfigEnvironment
 from .config import BuildConfig
 from .mozconfig import (
     MozconfigFindException,
     MozconfigLoadException,
     MozconfigLoader,
 )
 
 
@@ -46,17 +45,16 @@ class MozbuildObject(ProcessExecutionMix
 
         self.populate_logger()
         self.log_manager = log_manager
 
         self._make = None
         self._topobjdir = topobjdir
         self._mozconfig = None
         self._config_guess_output = None
-        self._config_environment = None
 
     @property
     def topobjdir(self):
         if self._topobjdir is None:
             if self.mozconfig['topobjdir'] is None:
                 self._topobjdir = 'obj-%s' % self._config_guess
             else:
                 self._topobjdir = self.mozconfig['topobjdir']
@@ -71,45 +69,16 @@ class MozbuildObject(ProcessExecutionMix
         """
         if self._mozconfig is None:
             loader = MozconfigLoader(self.topsrcdir)
             self._mozconfig = loader.read_mozconfig()
 
         return self._mozconfig
 
     @property
-    def config_environment(self):
-        """Returns the ConfigEnvironment for the current build configuration.
-
-        This property is only available once configure has executed.
-
-        If configure's output is not available, this will raise.
-        """
-        if self._config_environment:
-            return self._config_environment
-
-        config_status = os.path.join(self.topobjdir, 'config.status')
-
-        if not os.path.exists(config_status):
-            raise Exception('config.status not available. Run configure.')
-
-        self._config_environment = \
-            ConfigEnvironment.from_config_status(config_status)
-
-        return self._config_environment
-
-    @property
-    def defines(self):
-        return self.config_environment.defines
-
-    @property
-    def substs(self):
-        return self.config_environment.substs
-
-    @property
     def distdir(self):
         return os.path.join(self.topobjdir, 'dist')
 
     @property
     def bindir(self):
         return os.path.join(self.topobjdir, 'dist', 'bin')
 
     @property
@@ -118,52 +87,16 @@ class MozbuildObject(ProcessExecutionMix
 
     def remove_objdir(self):
         """Remove the entire object directory."""
 
         # We use mozfile because it is faster than shutil.rmtree().
         # mozfile doesn't like unicode arguments (bug 818783).
         rmtree(self.topobjdir.encode('utf-8'))
 
-    def get_binary_path(self, what='app', validate_exists=True):
-        """Obtain the path to a compiled binary for this build configuration.
-
-        The what argument is the program or tool being sought after. See the
-        code implementation for supported values.
-
-        If validate_exists is True (the default), we will ensure the found path
-        exists before returning, raising an exception if it doesn't.
-
-        If no arguments are specified, we will return the main binary for the
-        configured XUL application.
-        """
-
-        substs = self.substs
-
-        stem = self.distdir
-        if substs['OS_ARCH'] == 'Darwin':
-            stem = os.path.join(stem, substs['MOZ_MACBUNDLE_NAME'], 'Contents',
-                'MacOS')
-
-        leaf = None
-
-        if what == 'app':
-            leaf = substs['MOZ_APP_NAME'] + substs['BIN_SUFFIX']
-        elif what == 'xpcshell':
-            leaf = 'xpcshell'
-        else:
-            raise Exception("Don't know how to locate binary: %s" % what)
-
-        path = os.path.join(stem, leaf)
-
-        if validate_exists and not os.path.exists(path):
-            raise Exception('Binary expected at %s does not exist.' % path)
-
-        return path
-
     @property
     def _config_guess(self):
         if self._config_guess_output is None:
             p = os.path.join(self.topsrcdir, 'build', 'autoconf',
                 'config.guess')
             args = self._normalize_command([p], True)
             self._config_guess_output = subprocess.check_output(args,
                 cwd=self.topsrcdir).strip()
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -2,17 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import print_function, unicode_literals
 
 import logging
 import operator
 import os
-import time
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
 
 from mozbuild.base import MachCommandBase
@@ -57,18 +56,16 @@ class Build(MachCommandBase):
                     self.log(logging.INFO, 'compiler_warning', warning,
                         'Warning: {flag} in {filename}: {message}')
             except:
                 # This will get logged in the more robust implementation.
                 pass
 
             self.log(logging.INFO, 'build_output', {'line': line}, '{line}')
 
-        time_start = time.time()
-
         if what:
             top_make = os.path.join(self.topobjdir, 'Makefile')
             if not os.path.exists(top_make):
                 print('Your tree has not been configured yet. Please run '
                     '|mach build| with no arguments.')
                 return 1
 
             for target in what:
@@ -91,38 +88,17 @@ class Build(MachCommandBase):
 
             self.log(logging.WARNING, 'warning_summary',
                 {'count': len(warnings_collector.database)},
                 '{count} compiler warnings present.')
 
         warnings_database.prune()
         warnings_database.save_to_file(warnings_path)
 
-        time_elapsed = time_start - time.time()
-        long_build = time_elapsed > 600
-
-        if not status:
-            if long_build:
-                print('We know it took a while, but your build finally finished successfully!')
-            else:
-                print('Your build was successful!')
-
-            app_path = self.get_binary_path('app')
-            print('To take your build for a test drive, run: %s' % app_path)
-
-            # Only for full builds because incremental builders likely don't
-            # need to be burdened with this.
-            if not what:
-                app = self.substs['MOZ_BUILD_APP']
-                if app in ('browser', 'mobile/android'):
-                    print('For more information on what to do now, see '
-                        'https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox')
-
-        else:
-            print('A build error occurred. See the output above.')
+        print('Finished building. Built files are in %s' % self.topobjdir)
 
         return status
 
     @Command('clobber', help='Clobber the tree (delete the object directory).')
     def clobber(self):
         try:
             self.remove_objdir()
             return 0
--- a/python/mozbuild/mozbuild/test/test_base.py
+++ b/python/mozbuild/mozbuild/test/test_base.py
@@ -1,31 +1,28 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import unicode_literals
 
 import os
-import sys
 import unittest
 
 from mozfile.mozfile import NamedTemporaryFile
 
 from mozunit import main
 
 from mach.logging import LoggingManager
 
 from mozbuild.base import (
     BuildConfig,
     MozbuildObject,
 )
 
-from mozbuild.backend.configenvironment import ConfigEnvironment
-
 
 
 curdir = os.path.dirname(__file__)
 topsrcdir = os.path.normpath(os.path.join(curdir, '..', '..', '..', '..'))
 log_manager = LoggingManager()
 
 
 class TestMozbuildObject(unittest.TestCase):
@@ -48,38 +45,11 @@ class TestMozbuildObject(unittest.TestCa
         # It's difficult to test for exact values from the output of
         # config.guess because they vary depending on platform.
         base = self.get_base()
         result = base._config_guess
 
         self.assertIsNotNone(result)
         self.assertGreater(len(result), 0)
 
-    def test_config_environment(self):
-        base = self.get_base()
-
-        # This relies on the tree being built. make check only runs after the
-        # tree is built, so this shouldn't be an issue. If this ever changes,
-        # we'll need to stub out a fake config.status.
-        ce = base.config_environment
-        self.assertIsInstance(ce, ConfigEnvironment)
-
-        self.assertEqual(base.defines, ce.defines)
-        self.assertEqual(base.substs, ce.substs)
-
-        self.assertIsInstance(base.defines, dict)
-        self.assertIsInstance(base.substs, dict)
-
-    def test_get_binary_path(self):
-        base = self.get_base()
-
-        p = base.get_binary_path('xpcshell', False)
-        platform = sys.platform
-        if platform.startswith('darwin'):
-            self.assertTrue(p.endswith('Contents/MacOS/xpcshell'))
-        elif platform.startswith('win32', 'cygwin'):
-            self.assertTrue(p.endswith('xpcshell.exe'))
-        else:
-            self.assertTrue(p.endswith('dist/bin/xpcshell'))
-
 
 if __name__ == '__main__':
     main()