From df16fcae1d850e3816524c96c4f4c4d05cbdc1d1 Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Sun, 21 Jan 2024 21:17:29 -0800 Subject: [PATCH] Fix explicit modules incremental build failure when only the clang module of a mixed-source module requires rebuild After reading a prior intermodule dependency graph in an incremental explicit module build, the driver loops over each module in the graph to check if it is up to date. The check which is intended to skip the main (Swift) module was including a clang module with the same name as well, if it existed. If this clang module was the only one to be updated in an incremental compile, we wouldn't regenerate its pcm, and compilation would later fail since it wasn't up to date. rdar://121352768 --- .../IncrementalDependencyAndInputSetup.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftDriver/IncrementalCompilation/IncrementalDependencyAndInputSetup.swift b/Sources/SwiftDriver/IncrementalCompilation/IncrementalDependencyAndInputSetup.swift index e09fd069b..89297c777 100644 --- a/Sources/SwiftDriver/IncrementalCompilation/IncrementalDependencyAndInputSetup.swift +++ b/Sources/SwiftDriver/IncrementalCompilation/IncrementalDependencyAndInputSetup.swift @@ -211,7 +211,7 @@ extension IncrementalCompilationState.IncrementalDependencyAndInputSetup { buildRecordInfo: BuildRecordInfo, reporter: IncrementalCompilationState.Reporter?) throws -> Bool { for module in graph.modules { - if module.key.moduleName == graph.mainModuleName { + if module.key == .swift(graph.mainModuleName) { continue } if try !verifyModuleDependencyUpToDate(moduleID: module.key,