Commits

Jordan Rose committed c0b577dff4c
[Driver] Check the mtimes of external dependencies when building. After we've added all files that are explicitly out of date, check the set of external dependencies in the graph and see if any of them have been modified more recently than the oldest object file (or, if an object file is missing, the corresponding source file; see previous commit). If so, mark that external dependency as dirty and schedule anything touched by that. In practice, due to the way external dependencies are collected, this will almost always lead to a full rebuild. However, the way this is structured is semantically correct even if that were not the case: an external dependency is a cascading dependency like any other. One particular point of information: normal cascading dependencies can be discovered retroactively, i.e. after a particular source file has already been compiled. Can that happen for external dependencies? In theory, yes, due to the leakiness of imports within a module. (If a.swift loads a module with an extension on String, that extension will be visible to b.swift in the same module, even though it shouldn't be.) But that's true even if the external dependency /hasn't/ changed. Given that it's something we consider a flaw (if low-priority: rdar://problem/16154294), and that it would be harmless in most actual circumstances, I don't think we should actually force a full rebuild if one file's imports change. This completes rdar://problem/19270920 Swift SVN r24337