Skip to content

Commit c519a8d

Browse files
authored
Merge pull request #2042 from nkcsgexi/exclude-package
PrebuiltModules: exclude discovered package interface when generating prebuilt modules
2 parents d64755f + 5289584 commit c519a8d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Sources/SwiftDriver/Jobs/PrebuiltModulesJob.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,16 @@ public struct SDKPrebuiltModuleInputsCollector {
529529
}
530530

531531
private func sanitizeInterfaceMap(_ map: [String: [PrebuiltModuleInput]]) -> [String: [PrebuiltModuleInput]] {
532-
return map.filter {
532+
return map.compactMapValues { inputs in
533+
// Filter out .package.swiftinterface files
534+
return inputs.filter { input in
535+
!(input.path.file.extension == "swiftinterface" &&
536+
input.path.file.basenameWithoutExt.hasSuffix(".package"))
537+
}
538+
}.filter { key, value in
533539
// Remove modules without associated .swiftinterface files and diagnose.
534-
if $0.value.isEmpty {
535-
diagEngine.emit(.warning("\($0.key) has no associated .swiftinterface files"),
540+
if value.isEmpty {
541+
diagEngine.emit(.warning("\(key) has no associated .swiftinterface files"),
536542
location: nil)
537543
return false
538544
}

0 commit comments

Comments
 (0)