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).
--- 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)'