Bug 1380132 - Part 2 - Set MOZ_DEVELOPER_OBJ_DIR before launching Firefox. r=gps draft
authorHaik Aftandilian <haftandilian@mozilla.com>
Wed, 12 Jul 2017 17:01:56 -0700
changeset 609175 7d621a1dc7ced33a2c00e906970401e152a70189
parent 609172 5995030b43f49f9dca6911adb93b887fc7661b0e
child 609176 8aed9762c421bfab7ec12288daad0aebba86c346
push id68534
push userhaftandilian@mozilla.com
push dateFri, 14 Jul 2017 23:38:36 +0000
reviewersgps
bugs1380132
milestone56.0a1
Bug 1380132 - Part 2 - Set MOZ_DEVELOPER_OBJ_DIR before launching Firefox. r=gps MozReview-Commit-ID: CvSUt2KueHr
layout/tools/reftest/runreftest.py
python/mozbuild/mozbuild/mach_commands.py
testing/mochitest/runtests.py
testing/xpcshell/runxpcshelltests.py
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -375,16 +375,18 @@ class RefTest(object):
         return test_environment(**kwargs)
 
     def buildBrowserEnv(self, options, profileDir):
         browserEnv = self.environment(
             xrePath=options.xrePath, debugger=options.debugger)
         browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
         if hasattr(options, "topsrcdir"):
             browserEnv["MOZ_DEVELOPER_REPO_DIR"] = options.topsrcdir
+        if hasattr(options, "topobjdir"):
+            browserEnv["MOZ_DEVELOPER_OBJ_DIR"] = options.topobjdir
 
         if mozinfo.info["asan"]:
             # Disable leak checking for reftests for now
             if "ASAN_OPTIONS" in browserEnv:
                 browserEnv["ASAN_OPTIONS"] += ":detect_leaks=0"
             else:
                 browserEnv["ASAN_OPTIONS"] = "detect_leaks=0"
 
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1320,16 +1320,17 @@ class RunProgram(MachCommandBase):
                 path = os.path.join(self.topobjdir, 'tmp', 'scratch_user')
                 if not os.path.isdir(path):
                     os.makedirs(path)
                 args.append('-profile')
                 args.append(path)
 
         extra_env = {
             'MOZ_DEVELOPER_REPO_DIR': self.topsrcdir,
+            'MOZ_DEVELOPER_OBJ_DIR': self.topobjdir,
         }
 
         if not enable_crash_reporter:
             extra_env['MOZ_CRASHREPORTER_DISABLE'] = '1'
         else:
             extra_env['MOZ_CRASHREPORTER'] = '1'
 
         if disable_e10s:
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1586,16 +1586,18 @@ toolbar#nav-bar {
             env=env,
             debugger=debugger,
             dmdPath=options.dmdPath,
             lsanPath=lsanPath,
             ubsanPath=ubsanPath)
 
         if hasattr(options, "topsrcdir"):
             browserEnv["MOZ_DEVELOPER_REPO_DIR"] = options.topsrcdir
+        if hasattr(options, "topobjdir"):
+            browserEnv["MOZ_DEVELOPER_OBJ_DIR"] = options.topobjdir
 
         # These variables are necessary for correct application startup; change
         # via the commandline at your own risk.
         browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
 
         # interpolate environment passed with options
         try:
             browserEnv.update(
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -945,16 +945,18 @@ class XPCShellTests(object):
         self.env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
         # Don't permit remote connections by default.
         # MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
         # enable non-local connections for the purposes of local testing.
         # Don't override the user's choice here.  See bug 1049688.
         self.env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
         if self.mozInfo.get("topsrcdir") is not None:
             self.env["MOZ_DEVELOPER_REPO_DIR"] = self.mozInfo["topsrcdir"].encode()
+        if self.mozInfo.get("topobjdir") is not None:
+            self.env["MOZ_DEVELOPER_OBJ_DIR"] = self.mozInfo["topobjdir"].encode()
 
         # Disable the content process sandbox for the xpcshell tests. They
         # currently attempt to do things like bind() sockets, which is not
         # compatible with the sandbox.
         self.env["MOZ_DISABLE_CONTENT_SANDBOX"] = "1"
 
     def buildEnvironment(self):
         """