mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Backed out changeset 432f32e842dd (bug 648681) for test failures on a CLOSED TREE.
This commit is contained in:
parent
2b514dc04a
commit
ccda8b6b9f
@ -13,11 +13,10 @@ 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',
|
||||
|
@ -16,7 +16,6 @@ from mach.mixin.process import ProcessExecutionMixin
|
||||
|
||||
from mozfile.mozfile import rmtree
|
||||
|
||||
from .backend.configenvironment import ConfigEnvironment
|
||||
from .config import BuildConfig
|
||||
from .mozconfig import (
|
||||
MozconfigFindException,
|
||||
@ -51,7 +50,6 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
self._topobjdir = topobjdir
|
||||
self._mozconfig = None
|
||||
self._config_guess_output = None
|
||||
self._config_environment = None
|
||||
|
||||
@property
|
||||
def topobjdir(self):
|
||||
@ -75,35 +73,6 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
|
||||
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')
|
||||
@ -123,42 +92,6 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
# 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:
|
||||
|
@ -7,7 +7,6 @@ from __future__ import print_function, unicode_literals
|
||||
import logging
|
||||
import operator
|
||||
import os
|
||||
import time
|
||||
|
||||
from mach.decorators import (
|
||||
CommandArgument,
|
||||
@ -62,8 +61,6 @@ class Build(MachCommandBase):
|
||||
|
||||
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):
|
||||
@ -96,28 +93,7 @@ class Build(MachCommandBase):
|
||||
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
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from mozfile.mozfile import NamedTemporaryFile
|
||||
@ -19,8 +18,6 @@ from mozbuild.base import (
|
||||
MozbuildObject,
|
||||
)
|
||||
|
||||
from mozbuild.backend.configenvironment import ConfigEnvironment
|
||||
|
||||
|
||||
|
||||
curdir = os.path.dirname(__file__)
|
||||
@ -53,33 +50,6 @@ class TestMozbuildObject(unittest.TestCase):
|
||||
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user