Bug 1594194 - make rebuild_check.py work better for massive file changes; r=dmajor
authorNathan Froyd <froydnj@mozilla.com>
Tue, 05 Nov 2019 21:26:33 +0000
changeset 500710 940c2d856ed68773fac1d2f2d2688acc44a37e56
parent 500709 b611a31d62cc23b4d10967880f6ed7b74b971063
child 500711 3553317add3e8bfeb682263747ceb98c83a991a3
push id99782
push usernfroyd@mozilla.com
push dateTue, 05 Nov 2019 22:00:04 +0000
treeherderautoland@940c2d856ed6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1594194
milestone72.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 1594194 - make rebuild_check.py work better for massive file changes; r=dmajor For files with lots of dependencies (i.e. libxul), printing out the entire list of changed files can be tedious. Instead, let's pick some reasonable limit for the number of files we'll explicitly show, and indicate that there are more files (but not print them out) for cases that exceed that limit. Differential Revision: https://phabricator.services.mozilla.com/D51913
config/rebuild_check.py
--- a/config/rebuild_check.py
+++ b/config/rebuild_check.py
@@ -26,26 +26,43 @@ def rebuild_check(args):
         return
 
     newer = []
     removed = []
     for dep in deps:
         deptime = mtime(dep)
         if deptime < 0:
             removed.append(dep)
-        elif mtime(dep) > t:
+        elif deptime > t:
             newer.append(dep)
 
+    def format_filelist(filelist):
+        if not filelist:
+            return None
+
+        limit = 5
+        length = len(filelist)
+        if length < limit:
+            return ', '.join(filelist)
+
+        truncated = filelist[:limit]
+        remaining = length - limit
+
+        return '%s (and %d other files)' % (', '.join(truncated), remaining)
+
+    newer = format_filelist(newer)
+    removed = format_filelist(removed)
+
     if newer and removed:
         print('Rebuilding %s because %s changed and %s was removed' % (
-            target, ', '.join(newer), ', '.join(removed)))
+            target, newer, removed))
     elif newer:
-        print('Rebuilding %s because %s changed' % (target, ', '.join(newer)))
+        print('Rebuilding %s because %s changed' % (target, newer))
     elif removed:
         print('Rebuilding %s because %s was removed' % (
-            target, ', '.join(removed)))
+            target, removed))
     else:
         print('Rebuilding %s for an unknown reason' % target)
 
 
 if __name__ == '__main__':
     import sys
     rebuild_check(sys.argv[1:])