Skip to content

Commit 3208036

Browse files
authored
Avoid host triple computation in BuildParameters.forTriple() (#6906)
We know the triple here, so we shouldn't have to recompute from scratch. (cherry picked from commit 389edb7)
1 parent 1c6ef57 commit 3208036

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SPMBuildCore/BuildParameters.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,13 @@ public struct BuildParameters: Encodable {
305305
testEntryPointPath = nil
306306
}
307307

308+
var hostDestination = try Destination.hostDestination()
309+
hostDestination.targetTriple = destinationTriple
310+
308311
return try .init(
309312
dataPath: self.dataPath.parentDirectory.appending(components: ["plugins", "tools"]),
310313
configuration: self.configuration,
311-
toolchain: try UserToolchain(destination: Destination.hostDestination()),
314+
toolchain: try UserToolchain(destination: hostDestination),
312315
hostTriple: self.hostTriple,
313316
destinationTriple: destinationTriple,
314317
flags: BuildFlags(),

0 commit comments

Comments
 (0)