File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Tools/build-swiftly-release Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ struct SwiftlyUserAgentMiddleware: ClientMiddleware {
110
110
111
111
/// An `HTTPRequestExecutor` backed by a shared `HTTPClient`. This makes actual network requests.
112
112
public final class HTTPRequestExecutorImpl : HTTPRequestExecutor {
113
- let httpClient : HTTPClient
113
+ public let httpClient : HTTPClient
114
114
115
115
public init ( ) {
116
116
var proxy : HTTPClient . Configuration . Proxy ?
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import AsyncHTTPClient
3
3
import Foundation
4
4
import SwiftlyCore
5
5
import SystemPackage
6
+ import NIOPosix
6
7
7
8
#if os(macOS)
8
9
import MacOSPlatform
@@ -150,8 +151,9 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
150
151
try ? await fs. remove ( atPath: libArchivePath)
151
152
152
153
// Download libarchive
154
+ let httpExecutor = HTTPRequestExecutorImpl ( )
153
155
let libarchiveRequest = HTTPClientRequest ( url: " https://github.com/libarchive/libarchive/releases/download/v \( libArchiveVersion) /libarchive- \( libArchiveVersion) .tar.gz " )
154
- let libarchiveResponse = try await HTTPClient . shared . execute ( libarchiveRequest, timeout: . seconds( 60 ) )
156
+ let libarchiveResponse = try await httpExecutor . httpClient . execute ( libarchiveRequest, timeout: . seconds( 60 ) )
155
157
guard libarchiveResponse. status == . ok else {
156
158
throw Error ( message: " Download failed with status: \( libarchiveResponse. status) " )
157
159
}
@@ -180,8 +182,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
180
182
}
181
183
182
184
let swiftVersion = swiftVerMatch. output. 1
183
-
184
- let httpExecutor = HTTPRequestExecutorImpl ( )
185
+ print ( " Get toolchains " )
185
186
guard let swiftRelease = ( try await httpExecutor. getReleaseToolchains ( ) ) . first ( where: { $0. name == swiftVersion } ) else {
186
187
throw Error ( message: " Unable to find swift release using swift.org API: \( swiftVersion) " )
187
188
}
You can’t perform that action at this time.
0 commit comments