Skip to content

Commit 6235673

Browse files
committed
Incremental: ensure we add post-compile jobs if no new compile jobs are found
rdar://74447605
1 parent 8f1d770 commit 6235673

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Sources/SwiftDriverExecution/MultiJobExecutor.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,15 @@ public final class MultiJobExecutor {
220220
if let newJobs = try incrementalCompilationState?
221221
.collectJobsDiscoveredToBeNeededAfterFinishing(job: job, result: result) {
222222
let newJobIndices = Self.addJobs(newJobs, to: &jobs, producing: &producerMap)
223-
needInputFor(indices: newJobIndices)
224-
}
225-
else {
226-
needInputFor(indices: postCompileIndices)
223+
if !newJobIndices.isEmpty {
224+
// We discovered new compile jobs to finish
225+
needInputFor(indices: newJobIndices)
226+
return
227+
}
227228
}
229+
// If we find no other compile jobs to finish, we should perform those
230+
// post-compile jobs.
231+
needInputFor(indices: postCompileIndices)
228232
}
229233
fileprivate func needInputFor<Indices: Collection>(indices: Indices)
230234
where Indices.Element == Int

0 commit comments

Comments
 (0)