Bug 1384396 - Detect Watchman in configure; r?nalexander draft
authorGregory Szorc <gps@mozilla.com>
Tue, 25 Jul 2017 22:04:53 -0700
changeset 616114 562220381401ed811bda3c93af222b1f98b560e9
parent 616113 27a00bdf0e897dc1599f4a4e7067813346624e03
child 616115 b5e3adbfa892353ddbcbe7b06d1bfc8dea180c19
push id70592
push userbmo:gps@mozilla.com
push dateWed, 26 Jul 2017 18:28:45 +0000
reviewersnalexander
bugs1384396
milestone56.0a1
Bug 1384396 - Detect Watchman in configure; r?nalexander It is an optional build dependency. While we detect the version, we don't do any minimum version checking because nothing uses it... yet. MozReview-Commit-ID: 1tPo9AnD4fV
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -360,16 +360,29 @@ check_prog('GMAKE', possible_makes)
 def tup_progs(build_backends):
     for backend in build_backends:
         if 'Tup' in backend:
             return ['tup']
     return None
 
 tup = check_prog('TUP', tup_progs)
 
+# watchman detection
+# ==============================================================
+
+watchman = check_prog('WATCHMAN', ('watchman',), allow_missing=True)
+
+@depends_if(watchman)
+@checking('for watchman version')
+@imports('json')
+def watchman_version(watchman):
+    out = check_cmd_output(watchman, 'version')
+    res = json.loads(out)
+    return Version(res['version'])
+
 # Miscellaneous programs
 # ==============================================================
 check_prog('DOXYGEN', ('doxygen',), allow_missing=True)
 check_prog('XARGS', ('xargs',))
 
 @depends(target)
 def extra_programs(target):
     if target.kernel == 'Darwin':