Skip to content

Commit 07a07b8

Browse files
authored
Merge pull request #509 from nkcsgexi/74447605
Incremental: ensure we add post-compile jobs if no new compile jobs are found
2 parents 5adec4a + 2191989 commit 07a07b8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/SwiftDriver/IncrementalCompilation/IncrementalCompilationState.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class IncrementalCompilationState {
3030

3131
/// Track required jobs that haven't finished so the build record can record the corresponding
3232
/// input statuses.
33-
private var unfinishedJobs: Set<Job>
33+
private var unfinishedCompileJobs: Set<Job>
3434

3535
/// Keyed by primary input. As required compilations are discovered after the first wave, these shrink.
3636
private var skippedCompileGroups = [TypedVirtualPath: CompileJobGroup]()
@@ -101,7 +101,7 @@ public class IncrementalCompilationState {
101101

102102
self.skippedCompileGroups = initial.skippedCompileGroups
103103
self.mandatoryJobsInOrder = initial.mandatoryJobsInOrder
104-
self.unfinishedJobs = Set(self.mandatoryJobsInOrder)
104+
self.unfinishedCompileJobs = Set(self.mandatoryJobsInOrder.filter{$0.kind.isCompile})
105105
self.jobsAfterCompiles = jobsInPhases.afterCompiles
106106
self.moduleDependencyGraph = initial.graph
107107
self.driver = driver
@@ -210,7 +210,7 @@ extension IncrementalCompilationState {
210210
job finishedJob: Job, result: ProcessResult
211211
) throws -> [Job]? {
212212
return try confinementQueue.sync {
213-
unfinishedJobs.remove(finishedJob)
213+
unfinishedCompileJobs.remove(finishedJob)
214214

215215
guard case .terminated = result.exitStatus else {
216216
return []
@@ -228,8 +228,8 @@ extension IncrementalCompilationState {
228228
}
229229
}
230230
let newJobs = try getJobs(for: invalidatedInputs)
231-
unfinishedJobs.formUnion(newJobs)
232-
if unfinishedJobs.isEmpty {
231+
unfinishedCompileJobs.formUnion(newJobs)
232+
if unfinishedCompileJobs.isEmpty {
233233
// no more compilations are possible
234234
return nil
235235
}

0 commit comments

Comments
 (0)