Bug 1377524 - Add a version check for tup; r=chmanchester
authorMike Shal <mshal@mozilla.com>
Thu, 24 May 2018 14:54:04 -0400
changeset 476667 1d8897ccba51ec91df35ccfa116460246525d742
parent 476666 279077192f944954caeb9d122228bc130217a7c1
child 476668 27450c1a3366015f16b07aef93dc817281d6c2d5
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1377524
milestone62.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 1377524 - Add a version check for tup; r=chmanchester We have two checks here - first, to make sure that tup is a recent enough version, and second to make sure that we're using the ldpreload dependency checker. The FUSE dependency checker requires user namespaces to track dependencies when a subprocess uses full paths, and not all Linux distributions have user namespaces enabled by default. Additionally, the FUSE filesystem adds significant overhead for I/O intensive processes (such as linking libxul), which results in a bad user experience. MozReview-Commit-ID: H8l96dV7Qjx
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -398,16 +398,49 @@ 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)
 
+@depends_if(tup)
+@checking('for tup version')
+@imports('re')
+def tup_version(tup):
+    tup_min_version = '0.7.6'
+    out = check_cmd_output(tup, '--version',
+                           onerror=lambda: die('Failed to get tup version'))
+    m = re.search(r'tup v?([0-9]+\.[0-9]+\.[0-9]+)', out)
+
+    if not m:
+        raise FatalCheckError('Unknown version of tup: %s' % out)
+    ver = Version(m.group(1))
+
+    if ver < tup_min_version:
+        raise FatalCheckError('To use the tup backend you must have tup version '
+                              '%s or greater in your path' % tup_min_version)
+    return ver
+
+@depends_if(tup)
+@checking('for tup ldpreload dependency checker')
+def tup_is_ldpreload(tup):
+    out = check_cmd_output(tup, 'server',
+                           onerror=lambda: die('Failed to get tup dependency checker'))
+    if out.rstrip() != 'ldpreload':
+        raise FatalCheckError('To use the tup backend, please use a version '
+                              'of tup compiled with the ldpreload dependency '
+                              'checker. Either compile tup locally with '
+                              'CONFIG_TUP_SERVER=ldpreload in your tup.config '
+                              'file, or use the version from the toolchain '
+                              'task via |./mach artifact toolchain '
+                              '--from-build linux64-tup|')
+    return True
+
 # watchman detection
 # ==============================================================
 
 option(env='WATCHMAN', nargs=1, help='Path to the watchman program')
 
 @depends('WATCHMAN')
 @checking('for watchman', callback=lambda w: w.path if w else 'not found')
 def watchman(prog):