Bug 1396730 - Log "checking watchman" before checking for watchman. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 30 Aug 2017 17:25:30 +0900
changeset 421558 af0542b1cd926434206071a03b1fc8553737ff13
parent 421557 4f8769251cec1d748485ea50063bfa0ff6520837
child 421559 57865ef80d4fd8a2fb07465d99691f2a27c39bd8
push id82
push userfmarier@mozilla.com
push dateFri, 08 Sep 2017 01:10:49 +0000
reviewerschmanchester
bugs1396730, 1395079
milestone57.0a1
Bug 1396730 - Log "checking watchman" before checking for watchman. r=chmanchester When discussing bug 1395079 before it was filed, config.log didn't show "checking watchman" while it should have. We fix this here. This also makes it printed out in the configure output (obviously), but mach buffers that, so when configure runs through mach, it doesn't actually show up until the result is printed out, or, if the user interrupts configure with CTRL+C (which is better than not showing up at all in the latter case).
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -366,44 +366,40 @@ def tup_progs(build_backends):
 tup = check_prog('TUP', tup_progs)
 
 # watchman detection
 # ==============================================================
 
 option(env='WATCHMAN', nargs=1, help='Path to the watchman program')
 
 @depends('WATCHMAN')
-def watchman_info(prog):
+@checking('for watchman', callback=lambda w: w.path if w else 'not found')
+def watchman(prog):
     if not prog:
         prog = find_program('watchman')
 
     if not prog:
         return
 
     # `watchman version` will talk to the Watchman daemon service.
     # This can hang due to permissions problems. e.g.
     # https://github.com/facebook/watchman/issues/376. So use
     # `watchman --version` to prevent a class of failures.
     out = check_cmd_output(prog, '--version', onerror=lambda: None)
     if out is None:
         return
 
     return namespace(path=prog, version=Version(out.strip()))
 
-@depends_if(watchman_info)
-@checking('for watchman')
-def watchman(w):
-    return w.path
-
-@depends_if(watchman_info)
+@depends_if(watchman)
 @checking('for watchman version')
 def watchman_version(w):
     return w.version
 
-set_config('WATCHMAN', watchman)
+set_config('WATCHMAN', watchman.path)
 
 @depends_all(hg_version, hg_config, watchman)
 @checking('for watchman Mercurial integration')
 @imports('os')
 def watchman_hg(hg_version, hg_config, watchman):
     if hg_version < Version('3.8'):
         return 'no (Mercurial 3.8+ required)'