diff --git a/Sources/SwiftDriver/Incremental Compilation/IncrementalCompilationState.swift b/Sources/SwiftDriver/Incremental Compilation/IncrementalCompilationState.swift index 82434efdc..7f799a417 100644 --- a/Sources/SwiftDriver/Incremental Compilation/IncrementalCompilationState.swift +++ b/Sources/SwiftDriver/Incremental Compilation/IncrementalCompilationState.swift @@ -398,7 +398,7 @@ extension IncrementalCompilationState { reportIncrementalDecision("Tried to schedule 2nd wave input \(input.file.basename) again") } } - if skippedCompileJobs.isEmpty { + if !sources.isEmpty && skippedCompileJobs.isEmpty { for job in postCompileJobs { reportIncrementalDecision("Scheduling post 2nd wave \(job.descriptionForLifecycle)") scheduleASecondWaveJob(job) diff --git a/Tests/SwiftDriverTests/IncrementalCompilationTests.swift b/Tests/SwiftDriverTests/IncrementalCompilationTests.swift index 2fdb39337..8ade7a321 100644 --- a/Tests/SwiftDriverTests/IncrementalCompilationTests.swift +++ b/Tests/SwiftDriverTests/IncrementalCompilationTests.swift @@ -450,18 +450,16 @@ final class IncrementalCompilationTests: XCTestCase { "Incremental compilation decision: Skipping Compiling other.swift", "Starting Compiling main.swift", "Finished Compiling main.swift", + "interface of main.swiftdeps->interface of top-level name foo->implementation of other.swiftdeps", "Incremental compilation decision: Queuing because of dependencies discovered later: {compile: other.o <= other.swift}", - "Delaying Linking theModule pending discovering delayed dependencies", - "Scheduling 2nd wave Compiling other.swift", - "Scheduling post 2nd wave Linking theModule", - + "Incremental compilation decision: Delaying Linking theModule pending discovering delayed dependencies", + "Incremental compilation decision: Scheduling 2nd wave Compiling other.swift", + "Incremental compilation decision: Scheduling post 2nd wave Linking theModule", "Starting Compiling other.swift", "Finished Compiling other.swift", - "Incremental compilation decision: Scheduling post 2nd wave Linking theModule", "Starting Linking theModule", "Finished Linking theModule", - "Incremental compilation decision: Scheduling post 2nd wave Linking theModule", ]) } }