Skip to content

Commit a8e3b5b

Browse files
authored
PrepareHandler: Dedupe top-level labels (#96)
1 parent fc8b6a0 commit a8e3b5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/SourceKitBazelBSP/RequestHandlers/PrepareHandler.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ final class PrepareHandler {
102102
let labelsToBuild: [String]
103103
let extraArgs: [String]
104104
if initializedConfig.baseConfig.compileTopLevel {
105-
labelsToBuild = platformInfo.map { $0.topLevelParentLabel }
105+
// We might get repeat labels in this case, so we need to dedupe them.
106+
let topLevelLabelsToBuild = Set(platformInfo.map { $0.topLevelParentLabel })
107+
labelsToBuild = topLevelLabelsToBuild.sorted()
106108
extraArgs = [] // Not applicable in this case
107109
} else {
108110
guard platformInfo.count == 1 else {

0 commit comments

Comments
 (0)