Skip to content

Commit 0e163ec

Browse files
authored
Use SwiftWasm 5.5.0, bump version to 0.12.0 (#266)
`async-http-client` package is now pinned to 1.6.4, as 1.7.0 and later versions caused issues with toolchain downloads (see swift-server/async-http-client#488 for more details). I've also updated toolchain downloader code to bubble up download errors, which previously were hidden and made it very hard to diagnose these issues. * Use SwiftWasm 5.5.0, bump version to 0.12.0 * Pin AHC to 1.8.0 * Pin AHC to 1.6.4, always remove downloaded archives * Fix `defer` build issue
1 parent 4514347 commit 0e163ec

File tree

9 files changed

+43
-27
lines changed

9 files changed

+43
-27
lines changed

Package.resolved

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
77
"state": {
88
"branch": null,
9-
"revision": "1081b0b0541f535ca088acdb56f5ca5598bc6247",
10-
"version": "1.6.3"
9+
"revision": "170fd536f931c0bffb58f37a53fc238e77f42258",
10+
"version": "1.6.4"
1111
}
1212
},
1313
{
@@ -132,8 +132,8 @@
132132
"repositoryURL": "https://github.com/apple/swift-nio.git",
133133
"state": {
134134
"branch": null,
135-
"revision": "6aa9347d9bc5bbfe6a84983aec955c17ffea96ef",
136-
"version": "2.33.0"
135+
"revision": "addf69cfe60376c325397c8926589415576b1dd1",
136+
"version": "2.34.0"
137137
}
138138
},
139139
{
@@ -195,8 +195,8 @@
195195
"repositoryURL": "https://github.com/vapor/vapor.git",
196196
"state": {
197197
"branch": null,
198-
"revision": "27119271502bf266be293be5325f0fb72435e8fd",
199-
"version": "4.49.2"
198+
"revision": "6a5a3b5244d39e2614382c77ddf62e63b712ad06",
199+
"version": "4.53.0"
200200
}
201201
},
202202
{

Package.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ let package = Package(
2121
.executable(name: "carton-release", targets: ["carton-release"]),
2222
],
2323
dependencies: [
24-
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.6.3"),
24+
.package(
25+
url: "https://github.com/swift-server/async-http-client.git",
26+
.upToNextMinor(from: "1.6.4")
27+
),
2528
.package(
2629
url: "https://github.com/apple/swift-argument-parser.git",
2730
from: "0.4.3"
2831
),
29-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"),
32+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.34.0"),
3033
.package(
3134
name: "SwiftPM",
3235
url: "https://github.com/apple/swift-package-manager.git",
@@ -37,7 +40,7 @@ let package = Package(
3740
.branch("release/5.5")
3841
),
3942
.package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.12.0"),
40-
.package(url: "https://github.com/vapor/vapor.git", from: "4.49.2"),
43+
.package(url: "https://github.com/vapor/vapor.git", from: "4.53.0"),
4144
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.1.0"),
4245
.package(url: "https://github.com/JohnSundell/Splash.git", from: "0.16.0"),
4346
.package(

Sources/CartonHelpers/DefaultToolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
public let defaultToolchainVersion = "wasm-5.5-SNAPSHOT-2021-11-16-a"
15+
public let defaultToolchainVersion = "wasm-5.5.0-RELEASE"

Sources/CartonHelpers/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
public let cartonVersion = "0.11.0"
15+
public let cartonVersion = "0.12.0"

Sources/SwiftToolchain/ToolchainInstallation.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,24 @@ extension ToolchainSystem {
4949
var subscriptions = [AnyCancellable]()
5050
let request = try HTTPClient.Request.get(url: url)
5151

52+
// Clean up the downloaded file (especially important for failed downloads, otherwise running
53+
// `carton` again will fail trying to pick up the broken download).
54+
defer {
55+
do {
56+
try fileSystem.removeFileTree(archivePath)
57+
} catch {
58+
terminal.write("Failed to remove downloaded file with error \(error)\n", inColor: .red)
59+
}
60+
}
61+
5262
_ = try tsc_await { (completion: @escaping (Result<(), Error>) -> ()) in
53-
client.execute(request: request, delegate: delegate).futureResult.whenComplete { _ in
54-
subject.send(completion: .finished)
63+
client.execute(request: request, delegate: delegate).futureResult.whenComplete {
64+
switch $0 {
65+
case .success:
66+
subject.send(completion: .finished)
67+
case let .failure(error):
68+
subject.send(completion: .failure(error))
69+
}
5570
}
5671

5772
subject
@@ -101,8 +116,6 @@ extension ToolchainSystem {
101116
terminal.logLookup("Unpacking the archive: ", arguments.joined(separator: " "))
102117
_ = try processDataOutput(arguments)
103118

104-
try fileSystem.removeFileTree(archivePath)
105-
106119
return installationPath
107120
}
108121

Tests/Fixtures/TestApp/Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/swiftwasm/JavaScriptKit",
77
"state": {
88
"branch": null,
9-
"revision": "b19e7c8b10a2750ed47753e31ed13613171f3294",
10-
"version": "0.10.1"
9+
"revision": "309e63c03d8116210ad0437f5d1f09a26d4de48b",
10+
"version": "0.11.1"
1111
}
1212
}
1313
]

Tests/Fixtures/TestApp/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let package = Package(
99
.executable(name: "TestApp", targets: ["TestApp"]),
1010
],
1111
dependencies: [
12-
.package(url: "https://github.com/swiftwasm/JavaScriptKit", from: "0.10.1"),
12+
.package(url: "https://github.com/swiftwasm/JavaScriptKit", from: "0.11.1"),
1313
],
1414
targets: [
1515
// Targets are the basic building blocks of a package. A target can define a module or a test

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "carton",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"description": "📦 Watcher, bundler, and test runner for your SwiftWasm apps ",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)