File tree Expand file tree Collapse file tree 2 files changed +18
-15
lines changed
Sources/SwiftSDKGenerator Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,12 @@ struct DownloadableArtifacts: Sendable {
54
54
55
55
if hostTriple. os == . linux {
56
56
// Amazon Linux 2 is chosen for its best compatibility with all Swift-supported Linux hosts
57
- let linuxArchSuffix =
57
+ let hostArchSuffix =
58
58
hostTriple. arch == . aarch64 ? " - \( Triple . Arch. aarch64. linuxConventionName) " : " "
59
59
self . hostSwift = . init(
60
60
remoteURL: versions. swiftDownloadURL (
61
- subdirectory: " amazonlinux2 \( linuxArchSuffix ) " ,
62
- platform: " amazonlinux2 \( linuxArchSuffix ) " ,
61
+ subdirectory: " amazonlinux2 \( hostArchSuffix ) " ,
62
+ platform: " amazonlinux2 \( hostArchSuffix ) " ,
63
63
fileExtension: " tar.gz "
64
64
) ,
65
65
localPath: paths. artifactsCachePath
@@ -97,7 +97,9 @@ struct DownloadableArtifacts: Sendable {
97
97
self . targetSwift = . init(
98
98
remoteURL: versions. swiftDownloadURL ( ) ,
99
99
localPath: paths. artifactsCachePath
100
- . appending ( " target_swift_ \( versions. swiftVersion) _ \( targetTriple. triple) .tar.gz " ) ,
100
+ . appending (
101
+ " target_swift_ \( versions. swiftVersion) _ \( versions. swiftPlatform) _ \( targetTriple. archName) .tar.gz "
102
+ ) ,
101
103
isPrebuilt: true
102
104
)
103
105
}
Original file line number Diff line number Diff line change @@ -37,29 +37,30 @@ public struct VersionsConfiguration: Sendable {
37
37
var swiftPlatform : String {
38
38
switch self . linuxDistribution {
39
39
case let . ubuntu( ubuntu) :
40
- return " ubuntu \( ubuntu. version) \( self . linuxArchSuffix ) "
40
+ return " ubuntu \( ubuntu. version) "
41
41
case let . rhel( rhel) :
42
- return " \( rhel. rawValue) \( self . linuxArchSuffix ) "
42
+ return rhel. rawValue
43
43
}
44
44
}
45
45
46
+ var swiftPlatformAndSuffix : String {
47
+ return " \( self . swiftPlatform) \( self . linuxArchSuffix) "
48
+ }
49
+
46
50
func swiftDistributionName( platform: String ? = nil ) -> String {
47
- " swift- \( self . swiftVersion) - \( platform ?? self . swiftPlatform) "
51
+ return
52
+ " swift- \( self . swiftVersion) - \( platform ?? self . swiftPlatformAndSuffix) "
48
53
}
49
54
50
55
func swiftDownloadURL(
51
56
subdirectory: String ? = nil ,
52
57
platform: String ? = nil ,
53
58
fileExtension: String = " tar.gz "
54
59
) -> URL {
55
- let computedSubdirectory : String
56
- switch self . linuxDistribution {
57
- case let . ubuntu( ubuntu) :
58
- computedSubdirectory =
59
- " ubuntu \( ubuntu. version. replacingOccurrences ( of: " . " , with: " " ) ) \( self . linuxArchSuffix) "
60
- case let . rhel( rhel) :
61
- computedSubdirectory = rhel. rawValue
62
- }
60
+ let computedPlatform = platform ?? self . swiftPlatformAndSuffix
61
+ let computedSubdirectory =
62
+ subdirectory
63
+ ?? computedPlatform. replacingOccurrences ( of: " . " , with: " " )
63
64
64
65
return URL (
65
66
string: """
You can’t perform that action at this time.
0 commit comments