bug 1495798 - shut down sccache server in mozharness after all build steps. r=firefox-build-system-reviewers,gps
authorTed Mielczarek <ted@mielczarek.org>
Tue, 09 Oct 2018 18:27:26 +0000
changeset 498767 47bcc150ba0b3f2e23209d7b9590799769eef1b3
parent 498766 bcfb279c5ee80bda24addb09d3110e0b30ee3e17
child 498768 c35bab726b030312c53f48a654d5fcc2e1264ac2
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, gps
bugs1495798
milestone64.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 1495798 - shut down sccache server in mozharness after all build steps. r=firefox-build-system-reviewers,gps In builds that use sccache, the sccache server would be shut down at the end of the build step in client.mk. Unfortunately in rusttest builds the check step winds up compiling more Rust code which restarts the sccache server but without the proper configuration. This patch moves sccache shutdown to a post-script step in mozharness so that the server will stay running through the check step. Differential Revision: https://phabricator.services.mozilla.com/D7651
client.mk
testing/mozharness/mozharness/mozilla/building/buildbase.py
--- a/client.mk
+++ b/client.mk
@@ -150,22 +150,16 @@ endif
 build::  $(OBJDIR)/Makefile $(OBJDIR)/config.status
 	+$(MOZ_MAKE)
 
 ifdef MOZ_AUTOMATION
 build::
 	+$(MOZ_MAKE) automation/build
 endif
 
-ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
-build::
-	# Terminate sccache server. This prints sccache stats.
-	-$(MOZBUILD_MANAGE_SCCACHE_DAEMON) --stop-server
-endif
-
 # This makefile doesn't support parallel execution. It does pass
 # MOZ_MAKE_FLAGS to sub-make processes, so they will correctly execute
 # in parallel.
 .NOTPARALLEL:
 
 .PHONY: \
     build \
     configure
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1689,16 +1689,26 @@ or run without that action (ie: --no-{ac
             self.mkdir_p(env['UPLOAD_PATH'])
 
     def _post_fatal(self, message=None, exit_code=None):
         if not self.return_code:  # only overwrite return_code if it's 0
             self.error('setting return code to 2 because fatal was called')
             self.return_code = 2
 
     @PostScriptRun
+    def _shutdown_sccache(self):
+        '''If sccache was in use for this build, shut down the sccache server.'''
+        if os.environ.get('USE_SCCACHE') == '1':
+            topsrcdir = self.query_abs_dirs()['abs_src_dir']
+            sccache = os.path.join(topsrcdir, 'sccache2', 'sccache')
+            if self._is_windows():
+                sccache += '.exe'
+            self.run_command([sccache, '--stop-server'], cwd=topsrcdir)
+
+    @PostScriptRun
     def _summarize(self):
         """ If this is run in automation, ensure the return code is valid and
         set it to one if it's not. Finally, log any summaries we collected
         from the script run.
         """
         if self.config.get("is_automation"):
             # let's ignore all mention of tbpl status until this
             # point so it will be easier to manage