[Driver] Handle cases where swiftdeps could not be loaded even after a build.

If a build fails in the middle, we try to determine which other files need
to be rebuilt. However, we may not be able to do that as precisely if the
dependency graph itself is incomplete. In this case, just be conservative
and assume we need to rebuild everything. We may want to revisit this in
the future with a more-aggressive-but-still-safe bound.

This was manifesting itself as an assertion failure, trying to pull
information from the graph that wasn't there.

rdar://problem/19640006

Swift SVN r24823
This commit is contained in:
Jordan Rose
2015-01-29 21:59:19 +00:00
parent 68b756bf90
commit 72e5ceca80
2 changed files with 37 additions and 2 deletions

View File

@@ -143,6 +143,7 @@ int Compilation::performJobsInList(const JobList &JL, PerformJobsState &State) {
// always have to run the job, but it doesn't affect any other jobs. If
// there should be one but it's not present or can't be loaded, we have to
// run all the jobs.
// FIXME: We can probably do better here!
Job::Condition Condition = Job::Condition::Always;
StringRef DependenciesFile =
Cmd->getOutput().getAdditionalOutputForType(types::TY_SwiftDeps);
@@ -369,8 +370,10 @@ int Compilation::performJobsInList(const JobList &JL, PerformJobsState &State) {
if (!State.ScheduledCommands.count(Cmd))
continue;
State.UnfinishedCommands.insert({Cmd, DepGraph.isMarked(Cmd)});
bool isCascading = true;
if (getIncrementalBuildEnabled())
isCascading = DepGraph.isMarked(Cmd);
State.UnfinishedCommands.insert({Cmd, isCascading});
}
}