From fb39e1dbb260acc7df55281fd62888856c06836b Mon Sep 17 00:00:00 2001 From: "teravest@chromium.org" Date: Fri, 12 Dec 2014 22:16:58 +0000 Subject: [PATCH] Always emit original sources from scan_sources. scan_sources.py should always emit the original source files passed as input, even if it cannot find them. This is necessary to create a proper dependency arc from the build rule "mojo_nacl" to the generated source "libmojo.cc" from the "monacl_codegen" build rule.. It's not sufficient to convey this source dependency through ninja depfiles. This is because the emitted dependency in the mojo_nacl.ninja from "mojo_nacl" to "monacl_codegen" is order-only and depenencies are scanned before order-only dependencies are run (https://github.com/martine/ninja/issues/760). BUG=https://code.google.com/p/chromium/issues/detail?id=440451 TEST=manually modified libmojo.cc.tmpl and rebuilt mojo_nacl. R=bradnelson@google.com, ncbray@chromium.org Review URL: https://codereview.chromium.org/798733002 git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@14212 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2 --- build/scan_sources.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build/scan_sources.py b/build/scan_sources.py index 83f3f20db..2c2fe41d2 100755 --- a/build/scan_sources.py +++ b/build/scan_sources.py @@ -258,7 +258,7 @@ def Run(self): if added_dir: self.resolver.RemoveOneDirectory(scan_dir) scan_name = self.PopIfAvail() - return sorted(self.added_set) + return self.added_set def DoMain(argv): @@ -288,7 +288,14 @@ def DoMain(argv): for filename in files: workQ.PushIfNew(filename) - sorted_list = workQ.Run() + sources_set = workQ.Run() + + # If any of the original files requested aren't found, add them anyway. + # This is so that source files that will be generated are still returned in + # the program output. + sources_set = sources_set.union(set(files)) + + sorted_list = sorted(sources_set) return '\n'.join(sorted_list) + '\n'