mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user