Skip to content

Commit 0c6acf3

Browse files
authored
Binary dependencies of C/C++ modules break build planning (#8056)
Fix a regression where the build planning phase will early terminate if SwiftPM packages contain binary targets that C/C++ products refer to, #8055. ### Motivation: When running `swift build` on SwiftPM packages with binary targets that C++ products refer to, they will early terminate during the build planning phase with the following error: ```swift error: InternalError(description: "Internal error. Please file a bug at https://github.com/swiftlang/swift-package-manager/issues with this info. unknown module: <ResolvedModule: Python, binary>") ``` ### Modifications: Remove the guard, so we do not fail ~~if the module dependency does not yet exist in the build plan's target map, which I think is normal~~ on binary targets that C++ products refer to, since they don't have build descriptions. ### Result: When running `swift build` on SwiftPM packages with binary targets that C++ products refer to, the build planning phase will proceed successfully without error. --------- Signed-off-by: furby™ <[email protected]>
1 parent cc0af87 commit 0c6acf3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Sources/Build/BuildManifest/LLBuildManifestBuilder+Clang.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,10 @@ extension LLBuildManifestBuilder {
5454

5555
case .library(.automatic), .library(.static), .plugin:
5656
for module in product.modules {
57-
guard let dependencyDescription = self.plan.description(
57+
let dependencyDescription = self.plan.description(
5858
for: module,
5959
context: product.type == .plugin ? .host : target.destination
60-
) else
61-
{
62-
throw InternalError("unknown module: \(module)")
63-
}
60+
)
6461
addStaticTargetInputs(dependencyDescription)
6562
}
6663
case .test:

0 commit comments

Comments
 (0)