Skip to content

Commit 9456d16

Browse files
authored
[Build] BuildPlan: Use Destination instead of BuildTriple to form… (#7881)
… per-module plugin output directory ### Motivation: This is an NFC since there are no observable differences here from user perspective, just a different mechanism is used to get the same information. ### Modifications: - `computeDestinations` provides a destination that should be used to invoke build tool plugins per module. ### Result: Removes one of the last places where `BuildTriple` was still used.
1 parent b2ff126 commit 9456d16

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/Build/BuildPlan/BuildPlan.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ public class BuildPlan: SPMBuildCore.BuildPlan {
351351
if let pluginConfiguration, !buildParameters.shouldSkipBuilding {
352352
let pluginInvocationResults = try await Self.invokeBuildToolPlugins(
353353
for: module,
354+
destination: destination,
354355
configuration: pluginConfiguration,
355356
buildParameters: toolsBuildParameters,
356357
modulesGraph: graph,
@@ -752,6 +753,7 @@ extension BuildPlan {
752753
/// structures for later showing to the user, and not added directly to the diagnostics engine.
753754
static func invokeBuildToolPlugins(
754755
for module: ResolvedModule,
756+
destination: BuildParameters.Destination,
755757
configuration: PluginConfiguration,
756758
buildParameters: BuildParameters,
757759
modulesGraph: ModulesGraph,
@@ -786,7 +788,7 @@ extension BuildPlan {
786788
components: [
787789
package.identity.description,
788790
module.name,
789-
module.buildTriple.rawValue,
791+
destination == .host ? "tools" : "destination",
790792
plugin.name,
791793
]
792794
)

Tests/SPMBuildCoreTests/PluginInvocationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,7 @@ final class PluginInvocationTests: XCTestCase {
13561356

13571357
let results = try await BuildPlan.invokeBuildToolPlugins(
13581358
for: module,
1359+
destination: .target,
13591360
configuration: pluginConfiguration,
13601361
buildParameters: buildParameters,
13611362
modulesGraph: graph,

0 commit comments

Comments
 (0)