Bug 1058297 - Allow opting-out of "build complete" spam. r=gps
authorMatthew Gregan <kinetik>
Mon, 25 Aug 2014 15:50:00 +1200
changeset 201730 0e73004b33f28c954c1f269193ebafff50351cb1
parent 201729 4a3a302f1f31b99182436597840fdbe35389c65c
child 201767 2ccb65865db7d4e0fc17bce50a2af70e30d6f107
push id48252
push usermgregan@mozilla.com
push dateWed, 27 Aug 2014 00:02:19 +0000
treeherdermozilla-inbound@0e73004b33f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1058297
milestone34.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 1058297 - Allow opting-out of "build complete" spam. r=gps
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -396,17 +396,18 @@ class Build(MachCommandBase):
         ccache_end = monitor.ccache_stats()
 
         if ccache_start and ccache_end:
             ccache_diff = ccache_end - ccache_start
             if ccache_diff:
                 self.log(logging.INFO, 'ccache',
                          {'msg': ccache_diff.hit_rate_message()}, "{msg}")
 
-        if monitor.elapsed > 300:
+        moz_nospam = os.environ.get('MOZ_NOSPAM')
+        if monitor.elapsed > 300 and not moz_nospam:
             # Display a notification when the build completes.
             # This could probably be uplifted into the mach core or at least
             # into a helper API. It is here as an experimentation to see how it
             # is received.
             try:
                 if sys.platform.startswith('darwin'):
                     try:
                         notifier = which.which('terminal-notifier')