@@ -199,16 +199,16 @@ public final class SwiftTool {
199
199
public let scratchDirectory : AbsolutePath
200
200
201
201
/// Path to the shared security directory
202
- public let sharedSecurityDirectory : AbsolutePath ?
202
+ public let sharedSecurityDirectory : AbsolutePath
203
203
204
204
/// Path to the shared cache directory
205
- public let sharedCacheDirectory : AbsolutePath ?
205
+ public let sharedCacheDirectory : AbsolutePath
206
206
207
207
/// Path to the shared configuration directory
208
- public let sharedConfigurationDirectory : AbsolutePath ?
208
+ public let sharedConfigurationDirectory : AbsolutePath
209
209
210
210
/// Path to the cross-compilation Swift SDKs directory.
211
- public let sharedSwiftSDKsDirectory : AbsolutePath ?
211
+ public let sharedSwiftSDKsDirectory : AbsolutePath
212
212
213
213
/// Cancellator to handle cancellation of outstanding work when handling SIGINT
214
214
public let cancellator : Cancellator
@@ -747,11 +747,11 @@ public final class SwiftTool {
747
747
let hostTriple = hostToolchain. targetTriple
748
748
749
749
// Create custom toolchain if present.
750
- if let customDestination = options. locations. customCompileDestination {
750
+ if let customDestination = self . options. locations. customCompileDestination {
751
751
let swiftSDKs = try SwiftSDK . decode (
752
752
fromFile: customDestination,
753
- fileSystem: fileSystem,
754
- observabilityScope: observabilityScope
753
+ fileSystem: self . fileSystem,
754
+ observabilityScope: self . observabilityScope
755
755
)
756
756
if swiftSDKs. count == 1 {
757
757
swiftSDK = swiftSDKs [ 0 ]
@@ -768,13 +768,13 @@ public final class SwiftTool {
768
768
{
769
769
swiftSDK = targetSwiftSDK
770
770
} else if let swiftSDKSelector = options. build. swiftSDKSelector {
771
- swiftSDK = try SwiftSDKBundle . selectBundle (
772
- fromBundlesAt: sharedSwiftSDKsDirectory,
773
- fileSystem: fileSystem,
774
- matching: swiftSDKSelector,
775
- hostTriple: hostTriple,
776
- observabilityScope: observabilityScope
771
+ let store = SwiftSDKBundleStore (
772
+ swiftSDKsDirectory: self . sharedSwiftSDKsDirectory,
773
+ fileSystem: self . fileSystem,
774
+ observabilityScope: self . observabilityScope,
775
+ outputHandler: { print ( $0. description) }
777
776
)
777
+ swiftSDK = try store. selectBundle ( matching: swiftSDKSelector, hostTriple: hostTriple)
778
778
} else {
779
779
// Otherwise use the host toolchain.
780
780
swiftSDK = hostSwiftSDK
@@ -824,7 +824,7 @@ public final class SwiftTool {
824
824
case ( false , . local) :
825
825
cachePath = self . scratchDirectory
826
826
case ( false , . shared) :
827
- cachePath = self . sharedCacheDirectory . map { Workspace . DefaultLocations. manifestsDirectory ( at: $0 ) }
827
+ cachePath = Workspace . DefaultLocations. manifestsDirectory ( at: self . sharedCacheDirectory )
828
828
}
829
829
830
830
var extraManifestFlags = self . options. build. manifestFlags
@@ -876,7 +876,7 @@ private func findPackageRoot(fileSystem: FileSystem) -> AbsolutePath? {
876
876
return root
877
877
}
878
878
879
- private func getSharedSecurityDirectory( options: GlobalOptions , fileSystem: FileSystem ) throws -> AbsolutePath ? {
879
+ private func getSharedSecurityDirectory( options: GlobalOptions , fileSystem: FileSystem ) throws -> AbsolutePath {
880
880
if let explicitSecurityDirectory = options. locations. securityDirectory {
881
881
// Create the explicit security path if necessary
882
882
if !fileSystem. exists ( explicitSecurityDirectory) {
@@ -889,7 +889,7 @@ private func getSharedSecurityDirectory(options: GlobalOptions, fileSystem: File
889
889
}
890
890
}
891
891
892
- private func getSharedConfigurationDirectory( options: GlobalOptions , fileSystem: FileSystem ) throws -> AbsolutePath ? {
892
+ private func getSharedConfigurationDirectory( options: GlobalOptions , fileSystem: FileSystem ) throws -> AbsolutePath {
893
893
if let explicitConfigurationDirectory = options. locations. configurationDirectory {
894
894
// Create the explicit config path if necessary
895
895
if !fileSystem. exists ( explicitConfigurationDirectory) {
@@ -902,7 +902,7 @@ private func getSharedConfigurationDirectory(options: GlobalOptions, fileSystem:
902
902
}
903
903
}
904
904
905
- private func getSharedCacheDirectory( options: GlobalOptions , fileSystem: FileSystem ) throws -> AbsolutePath ? {
905
+ private func getSharedCacheDirectory( options: GlobalOptions , fileSystem: FileSystem ) throws -> AbsolutePath {
906
906
if let explicitCacheDirectory = options. locations. cacheDirectory {
907
907
// Create the explicit cache path if necessary
908
908
if !fileSystem. exists ( explicitCacheDirectory) {
0 commit comments