Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 5.9 support #412

Merged
merged 16 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,33 @@ on:
push:
branches: [main]
pull_request:
branches: "**"
branches: [main]

jobs:
swift-test:
strategy:
matrix:
include:
- os: macos-12
swift_version: 5.7
xcode: /Applications/Xcode_14.0.app/Contents/Developer
- os: macos-13
swift_version: 5.8
xcode: /Applications/Xcode_14.3.app/Contents/Developer
- os: macos-13 # TODO: macos-14 runner expected in October-December 2023
swift_version: 5.9
swift_version: "5.9"
xcode: /Applications/Xcode_15.0.app/Contents/Developer
- os: ubuntu-20.04
swift_version:
- os: ubuntu-22.04
swift_version: "5.9"
name: Build on ${{ matrix.os }} with Swift ${{ matrix.swift_version }}
timeout-minutes: 40
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: swift-actions/setup-swift@v1
if: ${{ !startsWith(matrix.os, 'macos') }}
with:
swift-version: ${{ matrix.swift_version }}

- name: Select Xcode version
if: startsWith(matrix.os, 'macos')
run: sudo xcode-select --switch ${{ matrix.xcode }}

- name: Cleanup pre-installed SwiftLint
run: rm -f '/usr/local/bin/swiftlint'

- name: Install dependencies for macOS
run: brew bundle
if: startsWith(matrix.os, 'macos')
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.20.0 (5 Aug 2023)
# 0.20.0 (30 Sep 2023)

This release adds SwiftWasm 5.9 toolchain support.

Expand Down
11 changes: 5 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -21,17 +21,16 @@ let package = Package(
),
.package(
url: "https://github.com/apple/swift-argument-parser.git",
.upToNextMinor(from: "1.0.3")
.upToNextMinor(from: "1.2.3")
),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.34.0"),
.package(
name: "SwiftPM",
url: "https://github.com/apple/swift-package-manager.git",
.branch("release/5.8")
branch: "release/5.9"
),
.package(
url: "https://github.com/apple/swift-tools-support-core.git",
.branch("release/5.8")
branch: "release/5.9"
),
.package(url: "https://github.com/vapor/vapor.git", from: "4.57.1"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "2.2.0"),
Expand Down Expand Up @@ -71,7 +70,7 @@ let package = Package(
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "SwiftPMDataModel-auto", package: "SwiftPM"),
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
"CartonHelpers",
"WasmTransformer",
]
Expand Down
122 changes: 0 additions & 122 deletions [email protected]

This file was deleted.

6 changes: 0 additions & 6 deletions Sources/CartonHelpers/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,11 @@ extension Sequence {
}

/// A type that can be executed as part of a nested tree of commands.
#if swift(<5.9)
public protocol AsyncParsableCommand: ParsableCommand {
mutating func run() async throws
}
#else
extension AsyncParsableCommand {
public mutating func run() throws {
throw CleanExit.helpRequest(self)
}
}
#endif

public protocol AsyncMain {
associatedtype Command: ParsableCommand
Expand Down
12 changes: 1 addition & 11 deletions Sources/CartonHelpers/DefaultToolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,4 @@
// limitations under the License.

// TODO: make this `public let defaultToolchainVersion = "wasm-5.9.0-RELEASE"`
// After a stable wasm-5.9 is released
public let defaultToolchainVersion: String = {
// On macOS 14 (Sonoma) it's not possible to use Xcode older then 15.0
// Therefore Swift 5.9 is required on Sonoma
if #available(macOS 14, *) {
return "wasm-5.9-SNAPSHOT-2023-08-01-a"
}else{
// Use the latest stable release otherwise
return "wasm-5.8.0-RELEASE"
}
}()
public let defaultToolchainVersion = "wasm-5.9-SNAPSHOT-2023-12-12-a"
2 changes: 1 addition & 1 deletion Sources/CartonKit/Model/Template.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ extension Template {
) throws {
try fileSystem.writeFileContents(project.path.appending(component: "Package.swift")) {
var content = """
// swift-tools-version:5.9
// swift-tools-version:5.8
import PackageDescription
let package = Package(
name: "\(project.name)",\n
Expand Down
5 changes: 0 additions & 5 deletions Sources/SwiftToolchain/Toolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,8 @@ public final class Toolchain {
switch target.type {
case .regular, .executable:
return RelativePath("Sources").appending(component: target.name).pathString
#if swift(>=5.9)
case .test, .system, .binary, .macro, .plugin:
return nil
#else
case .test, .system, .binary, .plugin:
return nil
#endif
}
}
return path
Expand Down
Loading