Bug 1386040 - Write .purgecaches sentinels during |mach watch|. r=gps
Right now, the "restart flow" that combines |mach watch| with the
Quick-Restart Firefox for Desktop shortcut key is frustrated by
inconsistencies writing the .purgecaches sentinels for the
application. This commit uses recent work from
https://bugzilla.mozilla.org/show_bug.cgi?id=1368699 to write the
sentinels each time |mach watch| updates the object directory.
MozReview-Commit-ID: 62Aa85oT1SE
--- a/python/mozbuild/mozbuild/faster_daemon.py
+++ b/python/mozbuild/mozbuild/faster_daemon.py
@@ -16,16 +16,19 @@ import time
import mozbuild.util
import mozpack.path as mozpath
from mozpack.manifests import (
InstallManifest,
)
from mozpack.copier import (
FileCopier,
)
+from mozbuild.backend import (
+ get_backend_class,
+)
# Watchman integration cribbed entirely from
# https://github.com/facebook/watchman/blob/19aebfebb0b5b0b5174b3914a879370ffc5dac37/python/bin/watchman-wait
import pywatchman
def print_line(prefix, m, now=None):
now = now or datetime.datetime.utcnow()
@@ -270,11 +273,19 @@ class Daemon(object):
partial_copier = FileCopier()
for output in all_outputs:
partial_copier.add(output, self.file_copier[output])
self.incremental_copy(partial_copier, force=True, verbose=verbose)
yield change
def watch(self, verbose=True):
+ try:
+ active_backend = self.config_environment.substs.get('BUILD_BACKENDS', [None])[0]
+ if active_backend:
+ backend_cls = get_backend_class(active_backend)(self.config_environment)
+ except Exception:
+ backend_cls = None
+
for change in self.output_changes(verbose=verbose):
- pass
-
+ # Try to run the active build backend's post-build step, if possible.
+ if backend_cls:
+ backend_cls.post_build(self.config_environment, None, 1, False, 0)