Bug 780698 - Part a: Give _run_make append_env and explicit_env arguments; r=gps
authorMs2ger <ms2ger@gmail.com>
Tue, 02 Oct 2012 10:24:11 +0200
changeset 108820 195e7907f7ba5c96c983558370895f202a865a71
parent 108819 9598fc30867529ca71116c30c937afee79b45aa4
child 108821 1b36381b4b6bb1122d9deee7c5fd504eadd28508
push id23593
push userMs2ger@gmail.com
push dateTue, 02 Oct 2012 08:25:46 +0000
treeherdermozilla-central@e5f2c48f10c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 780698 - Part a: Give _run_make append_env and explicit_env arguments; r=gps
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -184,18 +184,19 @@ class MozbuildObject(object):
         """Convert a relative path in the source directory to a full path."""
         return os.path.join(self.topsrcdir, path)
     def _get_objdir_path(self, path):
         """Convert a relative path in the object directory to a full path."""
         return os.path.join(self.topobjdir, path)
     def _run_make(self, directory=None, filename=None, target=None, log=True,
-            srcdir=False, allow_parallel=True, line_handler=None, env=None,
-            ignore_errors=False, silent=True, print_directory=True):
+            srcdir=False, allow_parallel=True, line_handler=None,
+            append_env=None, explicit_env=None, ignore_errors=False,
+            silent=True, print_directory=True):
         """Invoke make.
         directory -- Relative directory to look for Makefile in.
         filename -- Explicit makefile to run.
         target -- Makefile target(s) to make. Can be a string or iterable of
         srcdir -- If True, invoke make from the source directory tree.
             Otherwise, make will be invoked from the object directory.
@@ -237,17 +238,18 @@ class MozbuildObject(object):
         fn = self._run_command_in_objdir
         if srcdir:
             fn = self._run_command_in_srcdir
         params = {
             'args': args,
             'line_handler': line_handler,
-            'explicit_env': env,
+            'append_env': append_env,
+            'explicit_env': explicit_env,
             'log_level': logging.INFO,
             'require_unix_environment': True,
             'ignore_errors': ignore_errors,
         if log:
             params['log_name'] = 'make'
@@ -319,16 +321,18 @@ class MozbuildObject(object):
         if explicit_env:
             use_env = explicit_env
             if append_env:
+        self.log(logging.DEBUG, 'process', {'env': use_env}, 'Environment: {env}')
         p = ProcessHandlerMixin(args, cwd=cwd, env=use_env,
             processOutputLine=[handleLine], universal_newlines=True)
         status = p.wait()
         if status != 0 and not ignore_errors:
             raise Exception('Process executed with non-0 exit code: %s' % args)
--- a/python/mozbuild/mozbuild/testing/mochitest.py
+++ b/python/mozbuild/mozbuild/testing/mochitest.py
@@ -58,17 +58,17 @@ class MochitestRunner(MozbuildObject):
             target = 'mochitest-chrome'
         elif suite == 'browser':
             target = 'mochitest-browser-chrome'
             raise Exception('None or unrecognized mochitest suite type.')
         env = {'TEST_PATH': parsed['normalized']}
-        self._run_make(directory='.', target=target, env=env)
+        self._run_make(directory='.', target=target, append_env=env)
     def _parse_test_path(self, test_path):
         is_dir = os.path.isdir(test_path)
         if is_dir and not test_path.endswith(os.path.sep):
             test_path += os.path.sep
         normalized = test_path