Bug 1424417 - Use dry-run flag for backend.mk files; r=glandium
authorMike Shal <mshal@mozilla.com>
Wed, 13 Dec 2017 11:31:16 -0500
changeset 397003 009736d494879776d596a84c204739e45092f23e
parent 397002 19283f36ef75e6a5f9413c65fe0f6a179a23bc96
child 397004 b753cd005e89dfb476f3a19d68820d5f4f779200
push id57229
push usermshal@mozilla.com
push dateWed, 20 Dec 2017 16:49:21 +0000
treeherderautoland@009736d49487 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1424417
milestone59.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 1424417 - Use dry-run flag for backend.mk files; r=glandium For cases like BackendMakefile where we don't have access to BuildBackend._write_file(), we need to make sure that FileAvoidWrite uses the dry-run flag in order to avoid writing out files during a config.status --dry-run. MozReview-Commit-ID: ApsSQPySImt
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -196,27 +196,27 @@ class BackendMakeFile(object):
     invalidate all make targets across the whole tree! This would effectively
     undermine incremental builds as any mozbuild change would cause the entire
     tree to rebuild!
 
     The solution is to not update the mtimes of backend.mk files unless they
     actually change. We use FileAvoidWrite to accomplish this.
     """
 
-    def __init__(self, srcdir, objdir, environment, topsrcdir, topobjdir):
+    def __init__(self, srcdir, objdir, environment, topsrcdir, topobjdir, dry_run):
         self.topsrcdir = topsrcdir
         self.srcdir = srcdir
         self.objdir = objdir
         self.relobjdir = mozpath.relpath(objdir, topobjdir)
         self.environment = environment
         self.name = mozpath.join(objdir, 'backend.mk')
 
         self.xpt_name = None
 
-        self.fh = FileAvoidWrite(self.name, capture_diff=True)
+        self.fh = FileAvoidWrite(self.name, capture_diff=True, dry_run=dry_run)
         self.fh.write('# THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT.\n')
         self.fh.write('\n')
 
     def write(self, buf):
         self.fh.write(buf)
 
     def write_once(self, buf):
         if isinstance(buf, unicode):
@@ -428,17 +428,17 @@ class RecursiveMakeBackend(CommonBackend
                        makefile_in=self._makefile_in_count,
                        makefile_out=self._makefile_out_count)
         return summary
 
     def _get_backend_file_for(self, obj):
         if obj.objdir not in self._backend_files:
             self._backend_files[obj.objdir] = \
                 BackendMakeFile(obj.srcdir, obj.objdir, obj.config,
-                    obj.topsrcdir, self.environment.topobjdir)
+                    obj.topsrcdir, self.environment.topobjdir, self.dry_run)
         return self._backend_files[obj.objdir]
 
     def consume_object(self, obj):
         """Write out build files necessary to build with recursive make."""
 
         if not isinstance(obj, ContextDerived):
             return False