Skip to content

Update dependencies, add support for SwiftWasm 5.5 #263

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

Merged
merged 19 commits into from
Nov 18, 2021
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
22 changes: 8 additions & 14 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,25 @@ jobs:
strategy:
matrix:
include:
- os: macos-10.15
swift_version: 5.2
xcode: /Applications/Xcode_11.7.app/Contents/Developer
- os: macos-10.15
swift_version: 5.3
xcode: /Applications/Xcode_12.app/Contents/Developer
- os: macos-11
swift_version: 5.4
xcode: /Applications/Xcode_12.5.app/Contents/Developer
# - os: macos-11
# swift_version: 5.5
# xcode: /Applications/Xcode_13.0.app/Contents/Developer
xcode: /Applications/Xcode_12.5.1.app/Contents/Developer
- os: macos-11
swift_version: 5.5
xcode: /Applications/Xcode_13.1.app/Contents/Developer
- os: ubuntu-18.04
swift_version: 5.4
swift_version: 5.5
- os: ubuntu-20.04
swift_version: 5.4
swift_version: 5.5
name: Build on ${{ matrix.os }} with Swift ${{ matrix.swift_version }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

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

- name: Cleanup pre-installed SwiftLint
run: rm -f '/usr/local/bin/swiftlint'
Expand All @@ -45,10 +39,10 @@ jobs:
if: startsWith(matrix.os, 'macos')

- name: Install dependencies for Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo ./install_ubuntu_deps.sh
curl https://get.wasmer.io -sSfL | sh
if: startsWith(matrix.os, 'ubuntu')

- name: Build the project
run: swift build
Expand Down
28 changes: 14 additions & 14 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -21,24 +21,25 @@ let package = Package(
.executable(name: "carton-release", targets: ["carton-release"]),
],
dependencies: [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.2.2"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.6.3"),
.package(
url: "https://github.com/apple/swift-argument-parser.git",
.upToNextMinor(from: "0.3.0")
from: "0.4.3"
),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"),
.package(
name: "SwiftPM",
url: "https://github.com/apple/swift-package-manager.git",
.branch("release/5.4")
.branch("release/5.5")
),
.package(
url: "https://github.com/apple/swift-tools-support-core.git",
.branch("release/5.4")
.branch("release/5.5")
),
.package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.12.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.29.3"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.49.2"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.1.0"),
.package(url: "https://github.com/JohnSundell/Splash.git", from: "0.14.0"),
.package(url: "https://github.com/JohnSundell/Splash.git", from: "0.16.0"),
.package(
url: "https://github.com/swiftwasm/WasmTransformer",
.upToNextMinor(from: "0.0.3")
Expand All @@ -48,7 +49,7 @@ let package = Package(
// Targets are the basic building blocks of a package. A target can define a module
// or a test suite. Targets can depend on other targets in this package, and on
// products in packages which this package depends on.
.target(
.executableTarget(
name: "Carton",
dependencies: [
"CartonCLI",
Expand All @@ -74,6 +75,7 @@ let package = Package(
name: "SwiftToolchain",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "SwiftPMDataModel", package: "SwiftPM"),
"CartonHelpers",
openCombineProduct,
Expand All @@ -91,7 +93,7 @@ let package = Package(
),
// This target is used only for release automation tasks and
// should not be installed by `carton` users.
.target(
.executableTarget(
name: "carton-release",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
Expand Down
113 changes: 0 additions & 113 deletions Package@swift-5.2.swift

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ development workflow such as toolchain and SDK installations.

### Requirements

- macOS 10.15 and Xcode 11.4 or later.
- [Swift 5.2 or later](https://swift.org/download/) and Ubuntu 18.04 or 20.04 for Linux users.
- macOS 11 and Xcode 12.5.1 or later. macOS 10.15 may work, but is untested.
- [Swift 5.4 or later](https://swift.org/download/) and Ubuntu 18.04 or 20.04 for Linux users.

### Installation

Expand Down
2 changes: 1 addition & 1 deletion Sources/CartonHelpers/DefaultToolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.

public let defaultToolchainVersion = "wasm-5.4.0-RELEASE"
public let defaultToolchainVersion = "wasm-5.5-SNAPSHOT-2021-11-16-a"
44 changes: 7 additions & 37 deletions Sources/SwiftToolchain/Manifest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,6 @@ public enum PackageType: String {

// MARK: Custom Decodable Wrappers

// TODO: Remove this struct when we move to `Swift 5.4`
/// A temprary wrapper for decoding `PackageDependencyDescription` since
/// `productFilter` is not available in dumped JSON with pre-5.4 compilers.
struct DumpedPackageDependencyDescription: Decodable {
var dependendy: PackageDependencyDescription

private enum CodingKeys: CodingKey {
case name, url, requirement, productFilter
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let name = try container.decode(String.self, forKey: .name)
let url = try container.decode(String.self, forKey: .url)
let requirement = try container.decode(
PackageDependencyDescription.Requirement.self,
forKey: .requirement
)
let productFilter = try? container.decode(ProductFilter.self, forKey: .productFilter)
dependendy = PackageDependencyDescription(
name: name,
url: url,
requirement: requirement,
productFilter: productFilter ?? .nothing
)
}
}

/// A wrapper around `Manifest` needed for decoding from `dump-package` output,
/// since when encoding several (required for initialization) keys are skipped.
/// When decoding this wrapper, callers must provide an `unencodedKey` in the
Expand Down Expand Up @@ -122,31 +94,29 @@ struct DumpedManifest: Decodable {
[SwiftLanguageVersion]?.self,
forKey: .swiftLanguageVersions
)
// TODO: Change to `PackageDependencyDescription` when we move to `Swift 5.4`
let dependencies = try container.decode(
[DumpedPackageDependencyDescription].self,
[PackageDependencyDescription].self,
forKey: .dependencies
)
let products = try container.decode([ProductDescription].self, forKey: .products)
let targets = try container.decode([TargetDescription].self, forKey: .targets)
let platforms = try container.decode([PlatformDescription].self, forKey: .platforms)
// TODO: Change to non-optional when we move to `Swift 5.4`
// `packageKind` is not available in dumped JSON with pre-5.4 compilers.
let packageKind = try? container.decode(PackageReference.Kind.self, forKey: .packageKind)
let packageKind = try container.decode(PackageReference.Kind.self, forKey: .packageKind)

manifest = Manifest(
name: name,
platforms: platforms,
path: unencoded.path,
url: unencoded.url,
packageKind: packageKind,
packageLocation: unencoded.path.parentDirectory.pathString,
platforms: platforms,
version: unencoded.version,
toolsVersion: toolsVersion,
packageKind: packageKind ?? .root,
pkgConfig: pkgConfig,
providers: providers,
cLanguageStandard: cLanguageStandard,
cxxLanguageStandard: cxxLanguageStandard,
swiftLanguageVersions: swiftLanguageVersions,
dependencies: dependencies.map(\.dependendy),
dependencies: dependencies,
products: products,
targets: targets
)
Expand Down
Loading