Bug 928364 - Remove unified source dependencies completely, they're useless. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 24 Oct 2013 08:06:01 +0900
changeset 168108 fcd779a72dd331d34594461ac4651d390f4af416
parent 168107 36981d3a0d3b185f623daa70261b3267b44bd41a
child 168109 8af00774f330a30ac400cd847783cbe698fd3c95
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs928364
milestone27.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 928364 - Remove unified source dependencies completely, they're useless. r=gps The backend.RecursiveMakeBackend.built business ensures config.status reruns when moz.build changes, which is the only thing that would affect unified sources. Rerunning config.status updates unified sources if they need to be updated. Once updated, normal object dependencies will ensure they are rebuilt. Those same dependencies will ensure they are rebuilt when one of the C/C++ sources they include change. IOW, unified sources don't need any explicit dependencies generated by the backend.
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -575,21 +575,20 @@ class RecursiveMakeBackend(CommonBackend
                                                       sorted(files))):
                 just_the_filenames = list(filter_out_dummy(unified_group))
                 yield '%s%d.cpp' % (unified_prefix, i), just_the_filenames
 
         all_sources = ' '.join(source for source, _ in unified_files())
         makefile.add_statement('%s := %s\n' % (unified_files_makefile_variable,
                                                all_sources))
 
-        regen_cmds = ['for f in $(filter %.cpp,$^); do echo "#include \\"$$f\\""; done > $@']
         for unified_file, source_filenames in unified_files():
-            rule = makefile.create_rule([unified_file])
-            rule.add_dependencies(extra_dependencies + source_filenames)
-            rule.add_commands(regen_cmds)
+            if extra_dependencies:
+                rule = makefile.create_rule([unified_file])
+                rule.add_dependencies(extra_dependencies)
 
             # The rule we just defined is only for cases where the cpp files get
             # blown away and we need to regenerate them.  The rule doesn't correctly
             # handle source files being added/removed/renamed.  Therefore, we
             # generate them here also to make sure everything's up-to-date.
             with self._write_file(os.path.join(output_directory, unified_file)) as f:
                 f.write('\n'.join(['#include "%s"' % s for s in source_filenames]))