$OpenBSD$ index 8e3162f..0bfe4a6 100644 --- python/mozbuild/mozbuild/mach_commands.py.orig Fri Feb 20 15:40:38 2015 +++ python/mozbuild/mozbuild/mach_commands.py Fri Feb 20 15:40:38 2015 @@ -367,6 +367,23 @@ class Build(MachCommandBase): allow_parallel=False, ensure_exit_code=False, num_jobs=jobs, silent=not verbose, force_pymake=pymake) + make_extra = self.mozconfig['make_extra'] or [] + make_extra = dict(m.split('=', 1) for m in make_extra) + + # For universal builds, we need to run the automation steps in + # the first architecture from MOZ_BUILD_PROJECTS + projects = make_extra.get('MOZ_BUILD_PROJECTS') + if projects: + subdir = os.path.join(self.topobjdir, projects.split()[0]) + else: + subdir = self.topobjdir + moz_automation = os.getenv('MOZ_AUTOMATION') or make_extra.get('export MOZ_AUTOMATION', None) + if moz_automation and status == 0: + status = self._run_make(target='automation/build', directory=subdir, + line_handler=output.on_line, log=False, print_directory=False, + ensure_exit_code=False, num_jobs=jobs, silent=not verbose, + force_pymake=pymake) + self.log(logging.WARNING, 'warning_summary', {'count': len(monitor.warnings_database)}, '{count} compiler warnings present.') @@ -415,15 +432,20 @@ class Build(MachCommandBase): # Only for full builds because incremental builders likely don't # need to be burdened with this. if not what: - # Fennec doesn't have useful output from just building. We should - # arguably make the build action useful for Fennec. Another day... - if self.substs['MOZ_BUILD_APP'] != 'mobile/android': - app_path = self.get_binary_path('app') - print('To take your build for a test drive, run: %s' % app_path) - 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') + try: + # Fennec doesn't have useful output from just building. We should + # arguably make the build action useful for Fennec. Another day... + if self.substs['MOZ_BUILD_APP'] != 'mobile/android': + app_path = self.get_binary_path('app') + print('To take your build for a test drive, run: %s' % app_path) + 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') + except Exception: + # Ignore Exceptions in case we can't find config.status (such + # as when doing OSX Universal builds) + pass return status @@ -898,6 +920,7 @@ class MachDebug(MachCommandBase): @CommandArgument('--verbose', '-v', action='store_true', help='Print verbose output.') def environment(self, verbose=False): + state_dir = self._mach_context.state_dir import platform print('platform:\n\t%s' % platform.platform()) print('python version:\n\t%s' % sys.version) @@ -905,62 +928,31 @@ class MachDebug(MachCommandBase): print('mach cwd:\n\t%s' % self._mach_context.cwd) print('os cwd:\n\t%s' % os.getcwd()) print('mach directory:\n\t%s' % self._mach_context.topdir) - print('state directory:\n\t%s' % self._mach_context.state_dir) - - try: - mb = MozbuildObject.from_environment(cwd=self._mach_context.cwd) - except ObjdirMismatchException as e: - print('Ambiguous object directory detected. We detected that ' - 'both %s and %s could be object directories. This is ' - 'typically caused by having a mozconfig pointing to a ' - 'different object directory from the current working ' - 'directory. To solve this problem, ensure you do not have a ' - 'default mozconfig in searched paths.' % (e.objdir1, - e.objdir2)) - return 1 - - mozconfig = None - - try: - mozconfig = mb.mozconfig - print('mozconfig path:\n\t%s' % mozconfig['path']) - except MozconfigFindException as e: - print('Unable to find mozconfig: %s' % e.message) - return 1 - - except MozconfigLoadException as e: - print('Error loading mozconfig: %s' % e.path) - print(e.message) - - if e.output: - print('mozconfig evaluation output:') - for line in e.output: - print(line) - - return 1 + print('state directory:\n\t%s' % state_dir) - print('object directory:\n\t%s' % mb.topobjdir) + print('object directory:\n\t%s' % self.topobjdir) - if mozconfig: - print('mozconfig configure args:') - if mozconfig['configure_args']: - for arg in mozconfig['configure_args']: + if self.mozconfig['path']: + print('mozconfig path:\n\t%s' % self.mozconfig['path']) + if self.mozconfig['configure_args']: + print('mozconfig configure args:') + for arg in self.mozconfig['configure_args']: print('\t%s' % arg) - print('mozconfig extra make args:') - if mozconfig['make_extra']: - for arg in mozconfig['make_extra']: + if self.mozconfig['make_extra']: + print('mozconfig extra make args:') + for arg in self.mozconfig['make_extra']: print('\t%s' % arg) - print('mozconfig make flags:') - if mozconfig['make_flags']: - for arg in mozconfig['make_flags']: + if self.mozconfig['make_flags']: + print('mozconfig make flags:') + for arg in self.mozconfig['make_flags']: print('\t%s' % arg) config = None try: - config = mb.config_environment + config = self.config_environment except Exception: pass