Skip to content

Bump minimum support version to Swift 5.10 #57

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 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Bump minimum support version to Swift 5.10
  • Loading branch information
Kyle-Ye committed Apr 2, 2024
commit d3d34008168e5c7c10c2ef7e153b774988fa53e0
21 changes: 7 additions & 14 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.1" # Swift 5.9.2
- os: macos-14
xcode-version: "15.3" # Swift 5.10
runs-on: ${{ matrix.os }}
env:
OPENSWIFTUI_WERROR: 1
OPENSWIFTUI_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 1
OPENSWIFTUI_SWIFT_LOG: 0
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
Expand All @@ -36,15 +41,3 @@ jobs:
--build-path .build-compatibility-test-debug
env:
OPENSWIFTUI_COMPATIBILITY_TEST: 1
# - name: Run compatibility tests on OpenSwiftUI + iOS
# run: |
# swift test \
# --build-path .build-compatibility-test-debug
# env:
# OPENSWIFTUI_COMPATIBILITY_TEST: 0
# - name: Run compatibility tests on SwiftUI + iOS
# run: |
# swift test \
# --build-path .build-compatibility-test-debug
# env:
# OPENSWIFTUI_COMPATIBILITY_TEST: 1
19 changes: 12 additions & 7 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-14
xcode-version: "15.3" # Swift 5.10
runs-on: ${{ matrix.os }}
env:
OPENSWIFTUI_WERROR: 1
OPENSWIFTUI_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 1
OPENSWIFTUI_COMPATIBILITY_TEST: 0
OPENSWIFTUI_SWIFT_LOG: 0
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
Expand All @@ -29,15 +35,14 @@ jobs:
xcodebuild build \
-scheme OpenSwiftUI \
-configuration Debug \
-skipMacroValidation -skipPackagePluginValidation \
-destination "platform=iOS-Simulator" \
# OpenSwiftUI-Package is not listed currently
# OTHER_SWIFT_FLAGS="-warnings-as-errors" \ AccessLevelOnImport will cause build warning via xcodebuild
-skipMacroValidation \
-skipPackagePluginValidation
- name: Build and run tests in debug mode
run: |
xcodebuild test \
-scheme OpenSwiftUI \
-configuration Debug \
-skipMacroValidation -skipPackagePluginValidation \
-destination "platform=iOS-Simulator" \
# OTHER_SWIFT_FLAGS="-warnings-as-errors"
-skipMacroValidation \
-skipPackagePluginValidation
10 changes: 8 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-14
xcode-version: "15.3" # Swift 5.10
runs-on: ${{ matrix.os }}
env:
OPENSWIFTUI_WERROR: 1
OPENSWIFTUI_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 1
OPENSWIFTUI_COMPATIBILITY_TEST: 0
OPENSWIFTUI_SWIFT_LOG: 0
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ["5.9.2"]
swift_version: ["5.10"]
runs-on: ubuntu-22.04
env:
OPENSWIFTUI_WERROR: 1
OPENSWIFTUI_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 0
OPENSWIFTUI_COMPATIBILITY_TEST: 0
OPENSWIFTUI_SWIFT_LOG: 1
container: swift:${{ matrix.swift_version }}-jammy
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ["wasm-5.9.1-RELEASE"]
swift_version: ["5.10-SNAPSHOT-2024-03-30-a"] # "5.10-RELEASE" is not release for WASM, tracked via https://github.com/swiftwasm/swift/issues/5570
os: [ubuntu-22.04]
include:
- swift_version: "wasm-5.9.1-RELEASE"
extra_params: "-Xswiftc -Xfrontend -Xswiftc -disable-round-trip-debug-types" # https://github.com/swiftwasm/swift/issues/5563#issuecomment-1913533592
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: swiftwasm/setup-swiftwasm@v1
with:
swift-version: ${{ matrix.swift_version }}
swift-version: wasm-${{ matrix.swift_version }}
- name: build
run: |
swift build --triple wasm32-unknown-wasi ${{ matrix.extra_params }}
Expand Down
13 changes: 7 additions & 6 deletions Package.resolved

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

7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import Foundation
Expand All @@ -18,6 +18,7 @@ func envEnable(_ key: String, default defaultValue: Bool = false) -> Bool {
}

let isXcodeEnv = Context.environment["__CFBundleIdentifier"] == "com.apple.dt.Xcode"
let development = envEnable("OPENSWIFTUI_DEVELOPMENT", default: false)

// Xcode use clang as linker which supports "-iframework" while SwiftPM use swiftc as linker which supports "-Fsystem"
let systemFrameworkSearchFlag = isXcodeEnv ? "-iframework" : "-Fsystem"
Expand All @@ -27,7 +28,7 @@ var sharedSwiftSettings: [SwiftSetting] = [
.define("OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS"),
]

let warningsAsErrorsCondition = envEnable("OPENSWIFTUI_WERROR", default: isXcodeEnv)
let warningsAsErrorsCondition = envEnable("OPENSWIFTUI_WERROR", default: isXcodeEnv && development)
if warningsAsErrorsCondition {
sharedSwiftSettings.append(.unsafeFlags(["-warnings-as-errors"]))
}
Expand Down Expand Up @@ -167,7 +168,7 @@ let swiftTestingCondition = envEnable("OPENSWIFTUI_SWIFT_TESTING", default: true
if swiftTestingCondition {
package.dependencies.append(
// Fix it to be 0.3.0 before we bump to Swift 5.10
.package(url: "https://github.com/apple/swift-testing", exact: "0.3.0")
.package(url: "https://github.com/apple/swift-testing", exact: "0.6.0")
)
openSwiftUITestTarget.dependencies.append(
.product(name: "Testing", package: "swift-testing")
Expand Down