Skip to content

Commit 191c4df

Browse files
authored
Replace uses of package with @_spi(SwiftPMInternal) (#7265)
There are certain build configurations that currently fail due to the use of `package`. We can use `@_spi(SwiftPMInternal)` in the meantime.
1 parent 3baeee5 commit 191c4df

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

Sources/Basics/Collections/IdentifiableSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public struct IdentifiableSet<Element: Identifiable>: Collection {
6767
}
6868

6969
public func intersection(_ otherSequence: some Sequence<Element>) -> Self {
70-
var keysToRemove = Set(self.storage.keys).subtracting(otherSequence.map(\.id))
70+
let keysToRemove = Set(self.storage.keys).subtracting(otherSequence.map(\.id))
7171
var result = Self()
7272
for key in keysToRemove {
7373
result.storage.removeValue(forKey: key)

Sources/Build/BuildPlan/BuildPlan.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ public class BuildPlan: SPMBuildCore.BuildPlan {
225225
/// source files as well as directories to which any changes should cause us to reevaluate the build plan.
226226
public let prebuildCommandResults: [ResolvedTarget.ID: [PrebuildCommandResult]]
227227

228-
package private(set) var derivedTestTargetsMap: [ResolvedProduct.ID: [ResolvedTarget]] = [:]
228+
@_spi(SwiftPMInternal)
229+
public private(set) var derivedTestTargetsMap: [ResolvedProduct.ID: [ResolvedTarget]] = [:]
229230

230231
/// Cache for pkgConfig flags.
231232
private var pkgConfigCache = [SystemLibraryTarget: (cFlags: [String], libs: [String])]()

Sources/PackageGraph/PackageGraph.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public struct PackageGraph {
180180
}
181181

182182
/// Computes a map from each executable target in any of the root packages to the corresponding test targets.
183-
package func computeTestTargetsForExecutableTargets() throws -> [ResolvedTarget.ID: [ResolvedTarget]] {
183+
func computeTestTargetsForExecutableTargets() throws -> [ResolvedTarget.ID: [ResolvedTarget]] {
184184
var result = [ResolvedTarget.ID: [ResolvedTarget]]()
185185

186186
let rootTargets = IdentifiableSet(rootPackages.flatMap { $0.targets })

Sources/SPMTestSupport/MockBuildTestHelper.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Basics
14+
15+
@_spi(SwiftPMInternal)
1416
import Build
17+
1518
import PackageModel
1619
import SPMBuildCore
1720
import TSCUtility

Tests/FunctionalTests/PluginTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Basics
14-
import PackageGraph
14+
@testable import PackageGraph
1515
import PackageLoading
1616
import PackageModel
1717
@testable import SPMBuildCore

0 commit comments

Comments
 (0)