Skip to content

Commit

Permalink
Always emit original sources from scan_sources.
Browse files Browse the repository at this point in the history
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 (ninja-build/ninja#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
  • Loading branch information
teravest@chromium.org committed Dec 12, 2014
1 parent 053e4bc commit fb39e1d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build/scan_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'


Expand Down

0 comments on commit fb39e1d

Please sign in to comment.