From 80587df07f614905e5406123bb592174c0ee5bd2 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 18 Sep 2025 16:58:21 -0700 Subject: [PATCH 1/5] Require Swift 6.0 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 3505925..37e259b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the Swift System open source project From 478da393fa0f8b2de63612f4bd076ab97e03daa6 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 18 Sep 2025 16:59:28 -0700 Subject: [PATCH 2/5] Use new names for Swift 6 mode --- Sources/System/Internals/Exports.swift | 2 +- Tests/SystemTests/FilePathTests/FilePathComponentsTest.swift | 2 +- Tests/SystemTests/FilePathTests/FilePathSyntaxTest.swift | 2 +- Tests/SystemTests/UtilTests.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/System/Internals/Exports.swift b/Sources/System/Internals/Exports.swift index d18102a..c7d9944 100644 --- a/Sources/System/Internals/Exports.swift +++ b/Sources/System/Internals/Exports.swift @@ -140,7 +140,7 @@ extension String { return #else - self.init(validatingUTF8: platformString) + self.init(validatingCString: platformString) #endif } diff --git a/Tests/SystemTests/FilePathTests/FilePathComponentsTest.swift b/Tests/SystemTests/FilePathTests/FilePathComponentsTest.swift index d72d59a..675b533 100644 --- a/Tests/SystemTests/FilePathTests/FilePathComponentsTest.swift +++ b/Tests/SystemTests/FilePathTests/FilePathComponentsTest.swift @@ -107,7 +107,7 @@ final class FilePathComponentsTest: XCTestCase { func expect( _ s: String, - _ file: StaticString = #file, + _ file: StaticString = #filePath, _ line: UInt = #line ) { if path == FilePath(s) { return } diff --git a/Tests/SystemTests/FilePathTests/FilePathSyntaxTest.swift b/Tests/SystemTests/FilePathTests/FilePathSyntaxTest.swift index 6e03189..0fdfbc2 100644 --- a/Tests/SystemTests/FilePathTests/FilePathSyntaxTest.swift +++ b/Tests/SystemTests/FilePathTests/FilePathSyntaxTest.swift @@ -850,7 +850,7 @@ final class FilePathSyntaxTest: XCTestCase { func expect( _ s: String, - _ file: StaticString = #file, + _ file: StaticString = #filePath, _ line: UInt = #line ) { if path == FilePath(s) { return } diff --git a/Tests/SystemTests/UtilTests.swift b/Tests/SystemTests/UtilTests.swift index bfd2134..e952320 100644 --- a/Tests/SystemTests/UtilTests.swift +++ b/Tests/SystemTests/UtilTests.swift @@ -34,7 +34,7 @@ class UtilTests: XCTestCase { func testCStringArray() { func check( _ array: [String], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { array._withCStringArray { carray in From 2ae0c650beceb41f8367ab6eddd9d9b1deb7dfe5 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 18 Sep 2025 17:01:26 -0700 Subject: [PATCH 3/5] Make shared state constant as intended. --- Tests/SystemTests/TestingInfrastructure.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/SystemTests/TestingInfrastructure.swift b/Tests/SystemTests/TestingInfrastructure.swift index c169a36..12610ff 100644 --- a/Tests/SystemTests/TestingInfrastructure.swift +++ b/Tests/SystemTests/TestingInfrastructure.swift @@ -37,7 +37,7 @@ extension Trace.Entry { #endif // ENABLE_MOCKING // To aid debugging, force failures to fatal error -internal var forceFatalFailures = false +internal let forceFatalFailures = false internal protocol TestCase { // TODO: want a source location stack, more fidelity, kinds of stack entries, etc From d8dd95176baf68c43edb3d2c8cbaa0c5d57db0d0 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 18 Sep 2025 17:26:43 -0700 Subject: [PATCH 4/5] adjust pull-request workflow --- .github/workflows/pull_request.yml | 50 ++++++++++++++++++------------ 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4c3a66c..cd2bef9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,21 +9,39 @@ jobs: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: - linux_os_versions: '["noble", "jammy", "focal"]' - linux_exclude_swift_versions: '[{"os_version": "focal", "swift_version": "nightly-main"}, {"os_version": "focal", "swift_version": "nightly-6.2"}, {"os_version": "focal", "swift_version": "6.2"}, {"os_version": "noble", "swift_version": "5.9"}, {"os_version": "noble", "swift_version": "5.10"}]' - enable_macos_checks: true - # FIXME: https://github.com/swiftlang/github-workflows/pull/140 - # Xcode 16.0 and 16.1 are not actually available - macos_exclude_xcode_versions: | - [ - {"xcode_version": "16.0"}, - {"xcode_version": "16.1"}, - ] swift_flags: "-Xbuild-tools-swiftc -DSYSTEM_CI" + enable_linux_checks: true + linux_os_versions: '["noble", "jammy", "focal"]' + linux_exclude_swift_versions: | + [ + {"swift_version": "5.9"}, + {"swift_version": "5.10"}, + {"os_version": "focal", "swift_version": "nightly-6.2"}, + {"os_version": "focal", "swift_version": "6.2"}, + {"os_version": "focal", "swift_version": "nightly-main"}, + ] + enable_macos_checks: true + macos_exclude_xcode_versions: '[]' + enable_windows_checks: true + windows_exclude_swift_versions: | + [ + {"swift_version": "5.9"}, + {"swift_version": "5.10"} + ] enable_linux_static_sdk_build: true - linux_static_sdk_exclude_swift_versions: '[{"os_version": "focal", "swift_version": "nightly-main"}, {"os_version": "focal", "swift_version": "nightly-6.2"}, {"os_version": "focal", "swift_version": "6.2"}]' + linux_static_sdk_exclude_swift_versions: | + [ + {"os_version": "focal", "swift_version": "nightly-6.2"}, + {"os_version": "focal", "swift_version": "6.2"}, + {"os_version": "focal", "swift_version": "nightly-main"}, + ] enable_wasm_sdk_build: true - wasm_exclude_swift_versions: '[{"os_version": "focal", "swift_version": "nightly-main"}, {"os_version": "focal", "swift_version": "nightly-6.2"}, {"os_version": "focal", "swift_version": "6.2"}]' + wasm_exclude_swift_versions: | + [ + {"os_version": "focal", "swift_version": "nightly-6.2"}, + {"os_version": "focal", "swift_version": "6.2"}, + {"os_version": "focal", "swift_version": "nightly-main"}, + ] build-abi-stable: name: Build ABI Stable @@ -34,13 +52,7 @@ jobs: enable_windows_checks: false # Only build macos_build_command: "xcrun swift build --build-tests" - # FIXME: https://github.com/swiftlang/github-workflows/pull/140 - # Xcode 16.0 and 16.1 are not actually available - macos_exclude_xcode_versions: | - [ - {"xcode_version": "16.0"}, - {"xcode_version": "16.1"}, - ] + macos_exclude_xcode_versions: '[]' # Enable availability to match ABI stable verion of system. swift_flags: "-Xbuild-tools-swiftc -DSYSTEM_CI -Xbuild-tools-swiftc -DSYSTEM_ABI_STABLE" From bc4e6e3bea6dc420e9ee071b5309a0765d5fe117 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 18 Sep 2025 17:37:49 -0700 Subject: [PATCH 5/5] Use Swift 5 language mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `MachPort` is fine with Swift 6.1 and up, but does not compile with Swift 6.0’s Swift 6 language mode. `import CSystem` is a problem in the Linux version (inconsistently imported as implementation-only.) The Wasm implementation seems not concurrency-safe. --- Package.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 37e259b..11a43f6 100644 --- a/Package.swift +++ b/Package.swift @@ -139,5 +139,6 @@ let package = Package( exclude: testsToExclude, cSettings: cSettings, swiftSettings: swiftSettings), - ]) - + ], + swiftLanguageVersions: [.v5] +)