Bug 1269787 - Choose tier for GENERATED_FILES based on extension; r=glandium
authorMike Shal <mshal@mozilla.com>
Fri, 29 Apr 2016 13:41:41 -0400
changeset 296327 5022b4e0ae892727ac232f3d87304750d6ba0112
parent 296326 da1c47951c032e84a1a580aca25c4ca860098876
child 296328 436ce820c291a0e2f4491be4863b9fa204a172a8
push id30236
push usercbook@mozilla.com
push dateFri, 06 May 2016 12:19:04 +0000
treeherdermozilla-central@19a1743ceb2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1269787
milestone49.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 1269787 - Choose tier for GENERATED_FILES based on extension; r=glandium Some generated files will depend on other generated files, but still need to be in the export tier because they are C++ headers. MozReview-Commit-ID: AFvp92lF0xy
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -502,17 +502,24 @@ class RecursiveMakeBackend(CommonBackend
                 else:
                     backend_file.write('%s := %s\n' % (k, v))
         elif isinstance(obj, HostDefines):
             self._process_defines(obj, backend_file, which='HOST_DEFINES')
         elif isinstance(obj, Defines):
             self._process_defines(obj, backend_file)
 
         elif isinstance(obj, GeneratedFile):
-            tier = 'misc' if any(isinstance(f, ObjDirPath) for f in obj.inputs) else 'export'
+            export_suffixes = (
+                '.c',
+                '.cpp',
+                '.h',
+                '.inc',
+                '.py',
+            )
+            tier = 'export' if any(f.endswith(export_suffixes) for f in obj.outputs) else 'misc'
             self._no_skip[tier].add(backend_file.relobjdir)
             first_output = obj.outputs[0]
             dep_file = "%s.pp" % first_output
             backend_file.write('%s:: %s\n' % (tier, first_output))
             for output in obj.outputs:
                 if output != first_output:
                     backend_file.write('%s: %s ;\n' % (output, first_output))
                 backend_file.write('GARBAGE += %s\n' % output)