Skip to content

Commit 6603491

Browse files
committed
Revert "[Planning] Avoid batching compile job twice"
This reverts commit 7ba9d48.
1 parent 5cc1fb1 commit 6603491

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Sources/SwiftDriver/Jobs/Planning.swift

+10-11
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,16 @@ extension Driver {
9090
incrementalCompilationState = nil
9191
}
9292

93-
let batchedJobs: [Job]
94-
// If the jobs are batched during the incremental build, reuse the computation rather than computing the batches again.
95-
if let incrementalState = incrementalCompilationState {
96-
batchedJobs = incrementalState.mandatoryJobsInOrder + incrementalState.jobsAfterCompiles
97-
} else {
98-
batchedJobs = try formBatchedJobs(jobsInPhases.allJobs,
99-
showJobLifecycle: showJobLifecycle,
100-
jobCreatingPch: jobsInPhases.allJobs.first(where: {$0.kind == .generatePCH}))
101-
}
102-
103-
return (batchedJobs, incrementalCompilationState)
93+
return try (
94+
// For compatibility with swiftpm, the driver produces batched jobs
95+
// for every job, even when run in incremental mode, so that all jobs
96+
// can be returned from `planBuild`.
97+
// But in that case, don't emit lifecycle messages.
98+
formBatchedJobs(jobsInPhases.allJobs,
99+
showJobLifecycle: showJobLifecycle && incrementalCompilationState == nil,
100+
jobCreatingPch: jobsInPhases.allJobs.first(where: {$0.kind == .generatePCH})),
101+
incrementalCompilationState
102+
)
104103
}
105104

106105
/// If performing an explicit module build, compute an inter-module dependency graph.

0 commit comments

Comments
 (0)