Bug 1416052 - Pass TOPSRCDIR into client.mk; r=nalexander
authorGregory Szorc <gps@mozilla.com>
Thu, 09 Nov 2017 15:50:32 -0800
changeset 391808 7ffce7d50018208119d937c48f99c108b501b397
parent 391807 13e44d942d707d7bf7a2de4ebed8da9f6759a347
child 391809 a88781c8655a63e602b46db80d0ff141f8cab9b4
push id32904
push usernerli@mozilla.com
push dateWed, 15 Nov 2017 09:56:19 +0000
treeherdermozilla-central@0b135d7d8cef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1416052
milestone59.0a1
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 1416052 - Pass TOPSRCDIR into client.mk; r=nalexander MozReview-Commit-ID: B5TfneZRan7
client.mk
python/mozbuild/mozbuild/controller/building.py
--- a/client.mk
+++ b/client.mk
@@ -27,24 +27,16 @@ endif
 
 
 CWD := $(CURDIR)
 
 ifeq "$(CWD)" "/"
 CWD   := /.
 endif
 
-ifndef TOPSRCDIR
-ifeq (,$(wildcard client.mk))
-TOPSRCDIR := $(patsubst %/,%,$(dir $(MAKEFILE_LIST)))
-else
-TOPSRCDIR := $(CWD)
-endif
-endif
-
 PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
 
 CONFIG_GUESS := $(shell $(TOPSRCDIR)/build/autoconf/config.guess)
 
 ####################################
 # Sanity checks
 
 # Windows checks.
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1313,16 +1313,19 @@ class BuildDriver(MozbuildObject):
             self._run_make(target='install-test-files', pass_thru=True,
                            print_directory=False)
         else:
             install_test_files(mozpath.normpath(self.topsrcdir), self.topobjdir,
                                '_tests', test_objs)
 
     def _run_client_mk(self, target=None, line_handler=None, jobs=0,
                        verbose=None, keep_going=False, append_env=None):
+        append_env = dict(append_env or {})
+        append_env['TOPSRCDIR'] = self.topsrcdir
+
         return self._run_make(srcdir=True,
                               filename='client.mk',
                               allow_parallel=False,
                               ensure_exit_code=False,
                               print_directory=False,
                               target=target,
                               line_handler=line_handler,
                               log=False,