From 35831325eaeaa9992c95d1356050ef50eb7f7f00 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 09:40:07 -0700 Subject: [PATCH 1/9] Conditionalize the testing targets for non-windows targets to avoid the TaskDriver requirements --- Package.swift | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index c82f577f..484723c8 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,20 @@ import CompilerPluginSupport // Availability Macros +let supportedTestingPlatforms: [Platform] = [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .freebsd, + .openbsd, + .wasi +] + let availabilityMacros: [SwiftSetting] = [ .enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"), .enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"), @@ -39,14 +53,16 @@ let package = Package( dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation"], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") - ] + ], + condition: .when(platforms: supportedTestingPlatforms) ), .testTarget( name: "AsyncAlgorithmsTests", dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation", "AsyncAlgorithms_XCTest"], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") - ] + ], + condition: .when(platforms: supportedTestingPlatforms) ), ] ) From ac3175bc0137aa01b1df33b98209b99a9d978265 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 09:45:06 -0700 Subject: [PATCH 2/9] Some driveby formatting fixes and remove the freebsd target since that is not supported in swiftpm yet --- Package.swift | 13 ++++++++----- .../Buffer/AsyncBufferSequence.swift | 2 +- .../Buffer/BoundedBufferStorage.swift | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 484723c8..8555d158 100644 --- a/Package.swift +++ b/Package.swift @@ -14,14 +14,17 @@ let supportedTestingPlatforms: [Platform] = [ .macCatalyst, .android, .linux, - .freebsd, .openbsd, - .wasi + .wasi, ] let availabilityMacros: [SwiftSetting] = [ - .enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"), - .enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"), + .enableExperimentalFeature( + "AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0" + ), + .enableExperimentalFeature( + "AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0" + ), ] let package = Package( @@ -69,7 +72,7 @@ let package = Package( if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { package.dependencies += [ - .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"), + .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0") ] } else { package.dependencies += [ diff --git a/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift b/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift index adbee9f7..a966405e 100644 --- a/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift +++ b/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift @@ -80,7 +80,7 @@ public struct AsyncBufferSequence: AsyncSequence // to specify that the element is actually Sendable since the draining mechanism passes // through the isolation that is in nature sending but cannot be marked as such for the // isolated next method. - // In practice the users of this type are safe from isolation crossing since the Element + // In practice the users of this type are safe from isolation crossing since the Element // is as sendable as it is required by the base sequences the buffer is constructed from. enum StorageType { case transparent(Base.AsyncIterator) diff --git a/Sources/AsyncAlgorithms/Buffer/BoundedBufferStorage.swift b/Sources/AsyncAlgorithms/Buffer/BoundedBufferStorage.swift index 10eaa923..d9ae62ad 100644 --- a/Sources/AsyncAlgorithms/Buffer/BoundedBufferStorage.swift +++ b/Sources/AsyncAlgorithms/Buffer/BoundedBufferStorage.swift @@ -109,7 +109,6 @@ final class BoundedBufferStorage: Sendable where Base: Send case .none: break case .resumeConsumer(let continuation, let result): - continuation.resume(returning: result) } } From 5313447f4e79ae9f05deec2eb62bf0ddb21309a7 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 10:03:17 -0700 Subject: [PATCH 3/9] Rework validation import conditions to dependency conditionals --- Package.swift | 53 +++++++++++-------- Package@swift-5.8.swift | 38 +++++++++++-- Tests/AsyncAlgorithmsTests/TestChunk.swift | 5 ++ Tests/AsyncAlgorithmsTests/TestTimer.swift | 5 ++ .../TestValidationTests.swift | 5 ++ 5 files changed, 80 insertions(+), 26 deletions(-) diff --git a/Package.swift b/Package.swift index 8555d158..c3bbab01 100644 --- a/Package.swift +++ b/Package.swift @@ -3,28 +3,13 @@ import PackageDescription import CompilerPluginSupport -// Availability Macros - -let supportedTestingPlatforms: [Platform] = [ - .macOS, - .iOS, - .tvOS, - .watchOS, - .visionOS, - .macCatalyst, - .android, - .linux, - .openbsd, - .wasi, -] - let availabilityMacros: [SwiftSetting] = [ .enableExperimentalFeature( "AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0" ), .enableExperimentalFeature( "AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0" - ), + ) ] let package = Package( @@ -56,17 +41,41 @@ let package = Package( dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation"], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") - ], - condition: .when(platforms: supportedTestingPlatforms) + ] ), .testTarget( name: "AsyncAlgorithmsTests", - dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation", "AsyncAlgorithms_XCTest"], + dependencies: [ + .target(name: "AsyncAlgorithms"), + .target(name: "AsyncSequenceValidation", condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ])), + .target(name: "AsyncAlgorithms_XCTest", condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ])) + ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") - ], - condition: .when(platforms: supportedTestingPlatforms) - ), + ] + ) ] ) diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index b34c676a..33a76d88 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -6,8 +6,12 @@ import CompilerPluginSupport // Availability Macros let availabilityMacros: [SwiftSetting] = [ - .enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"), - .enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"), + .enableExperimentalFeature( + "AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0" + ), + .enableExperimentalFeature( + "AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0" + ), ] let package = Package( @@ -43,7 +47,33 @@ let package = Package( ), .testTarget( name: "AsyncAlgorithmsTests", - dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation", "AsyncAlgorithms_XCTest"], + dependencies: [ + .target(name: "AsyncAlgorithms"), + .target(name: "AsyncSequenceValidation", condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ])), + .target(name: "AsyncAlgorithms_XCTest", condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ])) + ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") ] @@ -53,7 +83,7 @@ let package = Package( if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { package.dependencies += [ - .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"), + .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0") ] } else { package.dependencies += [ diff --git a/Tests/AsyncAlgorithmsTests/TestChunk.swift b/Tests/AsyncAlgorithmsTests/TestChunk.swift index 8cd5e8e8..7557f16d 100644 --- a/Tests/AsyncAlgorithmsTests/TestChunk.swift +++ b/Tests/AsyncAlgorithmsTests/TestChunk.swift @@ -10,6 +10,9 @@ //===----------------------------------------------------------------------===// import XCTest + +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + import AsyncSequenceValidation import AsyncAlgorithms @@ -334,3 +337,5 @@ final class TestChunk: XCTestCase { } } } + +#endif \ No newline at end of file diff --git a/Tests/AsyncAlgorithmsTests/TestTimer.swift b/Tests/AsyncAlgorithmsTests/TestTimer.swift index b54647ca..5a90b916 100644 --- a/Tests/AsyncAlgorithmsTests/TestTimer.swift +++ b/Tests/AsyncAlgorithmsTests/TestTimer.swift @@ -10,6 +10,9 @@ //===----------------------------------------------------------------------===// import XCTest + +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + import AsyncAlgorithms import AsyncSequenceValidation @@ -57,3 +60,5 @@ final class TestTimer: XCTestCase { } } } + +#endif \ No newline at end of file diff --git a/Tests/AsyncAlgorithmsTests/TestValidationTests.swift b/Tests/AsyncAlgorithmsTests/TestValidationTests.swift index b4b646f2..5a09151d 100644 --- a/Tests/AsyncAlgorithmsTests/TestValidationTests.swift +++ b/Tests/AsyncAlgorithmsTests/TestValidationTests.swift @@ -10,6 +10,9 @@ //===----------------------------------------------------------------------===// import XCTest + +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + import AsyncAlgorithms import AsyncSequenceValidation @testable import AsyncAlgorithms_XCTest @@ -354,3 +357,5 @@ struct LaggingAsyncSequence: AsyncSequence { self.clock = clock } } + +#endif \ No newline at end of file From 9733c33e675d5dd85f13c6f5a1767e70d474d1ae Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 10:06:22 -0700 Subject: [PATCH 4/9] Additional formatting fixes --- Package.swift | 54 ++++++++++--------- Tests/AsyncAlgorithmsTests/TestTimer.swift | 2 +- .../TestValidationTests.swift | 2 +- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Package.swift b/Package.swift index c3bbab01..08ccd058 100644 --- a/Package.swift +++ b/Package.swift @@ -47,30 +47,36 @@ let package = Package( name: "AsyncAlgorithmsTests", dependencies: [ .target(name: "AsyncAlgorithms"), - .target(name: "AsyncSequenceValidation", condition: .when(platforms: [ - .macOS, - .iOS, - .tvOS, - .watchOS, - .visionOS, - .macCatalyst, - .android, - .linux, - .openbsd, - .wasi - ])), - .target(name: "AsyncAlgorithms_XCTest", condition: .when(platforms: [ - .macOS, - .iOS, - .tvOS, - .watchOS, - .visionOS, - .macCatalyst, - .android, - .linux, - .openbsd, - .wasi - ])) + .target( + name: "AsyncSequenceValidation", + condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ]) + ), + .target( + name: "AsyncAlgorithms_XCTest", + condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ]) + ) ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") diff --git a/Tests/AsyncAlgorithmsTests/TestTimer.swift b/Tests/AsyncAlgorithmsTests/TestTimer.swift index 5a90b916..05160097 100644 --- a/Tests/AsyncAlgorithmsTests/TestTimer.swift +++ b/Tests/AsyncAlgorithmsTests/TestTimer.swift @@ -61,4 +61,4 @@ final class TestTimer: XCTestCase { } } -#endif \ No newline at end of file +#endif diff --git a/Tests/AsyncAlgorithmsTests/TestValidationTests.swift b/Tests/AsyncAlgorithmsTests/TestValidationTests.swift index 5a09151d..f64dd2c5 100644 --- a/Tests/AsyncAlgorithmsTests/TestValidationTests.swift +++ b/Tests/AsyncAlgorithmsTests/TestValidationTests.swift @@ -358,4 +358,4 @@ struct LaggingAsyncSequence: AsyncSequence { } } -#endif \ No newline at end of file +#endif From 5032560f3da1d43453956040308f39ec2bd5124a Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 10:16:50 -0700 Subject: [PATCH 5/9] Exclude 5.9 workflows and enable macOS testing scheme for CI --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 855cedbb..2d53eb65 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,6 +9,9 @@ jobs: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: + linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}]" + windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}]" + enable_macos_checks: true enable_wasm_sdk_build: true wasm_sdk_build_command: swift build -Xcc -D_WASI_EMULATED_PTHREAD From a3097cbceeb8d6ac7230bbaa9398868a13b4e9cb Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 10:22:11 -0700 Subject: [PATCH 6/9] Additional ifdefing out non windows targets for sequence diagram testing and more formatting fixes --- Package.swift | 4 +- Package@swift-5.8.swift | 54 ++++++++++--------- Tests/AsyncAlgorithmsTests/TestBuffer.swift | 4 ++ Tests/AsyncAlgorithmsTests/TestDebounce.swift | 2 + Tests/AsyncAlgorithmsTests/TestMerge.swift | 4 ++ Tests/AsyncAlgorithmsTests/TestThrottle.swift | 2 + 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/Package.swift b/Package.swift index 08ccd058..2be60d86 100644 --- a/Package.swift +++ b/Package.swift @@ -48,7 +48,7 @@ let package = Package( dependencies: [ .target(name: "AsyncAlgorithms"), .target( - name: "AsyncSequenceValidation", + name: "AsyncSequenceValidation", condition: .when(platforms: [ .macOS, .iOS, @@ -63,7 +63,7 @@ let package = Package( ]) ), .target( - name: "AsyncAlgorithms_XCTest", + name: "AsyncAlgorithms_XCTest", condition: .when(platforms: [ .macOS, .iOS, diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index 33a76d88..7e7239f6 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -49,30 +49,36 @@ let package = Package( name: "AsyncAlgorithmsTests", dependencies: [ .target(name: "AsyncAlgorithms"), - .target(name: "AsyncSequenceValidation", condition: .when(platforms: [ - .macOS, - .iOS, - .tvOS, - .watchOS, - .visionOS, - .macCatalyst, - .android, - .linux, - .openbsd, - .wasi - ])), - .target(name: "AsyncAlgorithms_XCTest", condition: .when(platforms: [ - .macOS, - .iOS, - .tvOS, - .watchOS, - .visionOS, - .macCatalyst, - .android, - .linux, - .openbsd, - .wasi - ])) + .target( + name: "AsyncSequenceValidation", + condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ]) + ), + .target( + name: "AsyncAlgorithms_XCTest", + condition: .when(platforms: [ + .macOS, + .iOS, + .tvOS, + .watchOS, + .visionOS, + .macCatalyst, + .android, + .linux, + .openbsd, + .wasi + ]) + ) ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") diff --git a/Tests/AsyncAlgorithmsTests/TestBuffer.swift b/Tests/AsyncAlgorithmsTests/TestBuffer.swift index 83026953..bf7a07bd 100644 --- a/Tests/AsyncAlgorithmsTests/TestBuffer.swift +++ b/Tests/AsyncAlgorithmsTests/TestBuffer.swift @@ -108,6 +108,7 @@ final class TestBuffer: XCTestCase { XCTAssertNil(pastFailure) } +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_given_a_base_sequence_when_bufferingOldest_then_the_policy_is_applied() async { validate { "X-12- 34- 5 |" @@ -171,6 +172,7 @@ final class TestBuffer: XCTestCase { "X,,,,,,[45^]" } } +#endif func test_given_a_buffered_with_unbounded_sequence_when_cancelling_consumer_then_the_iteration_finishes_and_the_base_is_cancelled() @@ -325,6 +327,7 @@ final class TestBuffer: XCTestCase { await fulfillment(of: [finished], timeout: 1.0) } +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_given_a_base_sequence_when_bounded_with_limit_0_then_the_policy_is_transparent() async { validate { "X-12- 34 -5|" @@ -332,4 +335,5 @@ final class TestBuffer: XCTestCase { "X-12- 34 -5|" } } +#endif } diff --git a/Tests/AsyncAlgorithmsTests/TestDebounce.swift b/Tests/AsyncAlgorithmsTests/TestDebounce.swift index 317f0bca..9cc54d63 100644 --- a/Tests/AsyncAlgorithmsTests/TestDebounce.swift +++ b/Tests/AsyncAlgorithmsTests/TestDebounce.swift @@ -13,6 +13,7 @@ import XCTest import AsyncAlgorithms final class TestDebounce: XCTestCase { +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_delayingValues() throws { guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { throw XCTSkip("Skipped due to Clock/Instant/Duration availability") @@ -67,6 +68,7 @@ final class TestDebounce: XCTestCase { "----|" } } +#endif func test_Rethrows() async throws { guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { diff --git a/Tests/AsyncAlgorithmsTests/TestMerge.swift b/Tests/AsyncAlgorithmsTests/TestMerge.swift index a2779e3d..a44c1dcf 100644 --- a/Tests/AsyncAlgorithmsTests/TestMerge.swift +++ b/Tests/AsyncAlgorithmsTests/TestMerge.swift @@ -170,6 +170,7 @@ final class TestMerge2: XCTestCase { XCTAssertEqual(collected.intersection(expected), expected) } +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_merge_makes_sequence_with_ordered_elements_when_sources_follow_a_timeline() { validate { "a-c-e-g-|" @@ -178,6 +179,7 @@ final class TestMerge2: XCTestCase { "abcdefgh|" } } +#endif func test_merge_finishes_when_iteration_task_is_cancelled() async { let source1 = Indefinite(value: "test1") @@ -508,6 +510,7 @@ final class TestMerge3: XCTestCase { XCTAssertEqual(collected.intersection(expected), expected) } +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_merge_makes_sequence_with_ordered_elements_when_sources_follow_a_timeline() { validate { "a---e---|" @@ -517,6 +520,7 @@ final class TestMerge3: XCTestCase { "abcdefgh|" } } +#endif func test_merge_finishes_when_iteration_task_is_cancelled() async { let source1 = Indefinite(value: "test1") diff --git a/Tests/AsyncAlgorithmsTests/TestThrottle.swift b/Tests/AsyncAlgorithmsTests/TestThrottle.swift index bf027233..d4103dab 100644 --- a/Tests/AsyncAlgorithmsTests/TestThrottle.swift +++ b/Tests/AsyncAlgorithmsTests/TestThrottle.swift @@ -13,6 +13,7 @@ import XCTest import AsyncAlgorithms final class TestThrottle: XCTestCase { +#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_rate_0() throws { guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { throw XCTSkip("Skipped due to Clock/Instant/Duration availability") @@ -188,4 +189,5 @@ final class TestThrottle: XCTestCase { "a--d--g--j--[l|]" } } +#endif } From 4a9a91be37f395a0cde58c233670fdae805fccc1 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 10:28:14 -0700 Subject: [PATCH 7/9] Yet more formatting... --- Package.swift | 8 ++++---- Package@swift-5.8.swift | 6 +++--- Tests/AsyncAlgorithmsTests/TestBuffer.swift | 8 ++++---- Tests/AsyncAlgorithmsTests/TestChunk.swift | 2 +- Tests/AsyncAlgorithmsTests/TestDebounce.swift | 4 ++-- Tests/AsyncAlgorithmsTests/TestMerge.swift | 8 ++++---- Tests/AsyncAlgorithmsTests/TestThrottle.swift | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Package.swift b/Package.swift index 2be60d86..b12d7e14 100644 --- a/Package.swift +++ b/Package.swift @@ -9,7 +9,7 @@ let availabilityMacros: [SwiftSetting] = [ ), .enableExperimentalFeature( "AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0" - ) + ), ] let package = Package( @@ -59,7 +59,7 @@ let package = Package( .android, .linux, .openbsd, - .wasi + .wasi, ]) ), .target( @@ -74,14 +74,14 @@ let package = Package( .android, .linux, .openbsd, - .wasi + .wasi, ]) ) ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") ] - ) + ), ] ) diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index 7e7239f6..8161e475 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -61,7 +61,7 @@ let package = Package( .android, .linux, .openbsd, - .wasi + .wasi, ]) ), .target( @@ -76,9 +76,9 @@ let package = Package( .android, .linux, .openbsd, - .wasi + .wasi, ]) - ) + ), ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") diff --git a/Tests/AsyncAlgorithmsTests/TestBuffer.swift b/Tests/AsyncAlgorithmsTests/TestBuffer.swift index bf7a07bd..42dd2f1a 100644 --- a/Tests/AsyncAlgorithmsTests/TestBuffer.swift +++ b/Tests/AsyncAlgorithmsTests/TestBuffer.swift @@ -108,7 +108,7 @@ final class TestBuffer: XCTestCase { XCTAssertNil(pastFailure) } -#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + #if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_given_a_base_sequence_when_bufferingOldest_then_the_policy_is_applied() async { validate { "X-12- 34- 5 |" @@ -172,7 +172,7 @@ final class TestBuffer: XCTestCase { "X,,,,,,[45^]" } } -#endif + #endif func test_given_a_buffered_with_unbounded_sequence_when_cancelling_consumer_then_the_iteration_finishes_and_the_base_is_cancelled() @@ -327,7 +327,7 @@ final class TestBuffer: XCTestCase { await fulfillment(of: [finished], timeout: 1.0) } -#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + #if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_given_a_base_sequence_when_bounded_with_limit_0_then_the_policy_is_transparent() async { validate { "X-12- 34 -5|" @@ -335,5 +335,5 @@ final class TestBuffer: XCTestCase { "X-12- 34 -5|" } } -#endif + #endif } diff --git a/Tests/AsyncAlgorithmsTests/TestChunk.swift b/Tests/AsyncAlgorithmsTests/TestChunk.swift index 7557f16d..b9a5956b 100644 --- a/Tests/AsyncAlgorithmsTests/TestChunk.swift +++ b/Tests/AsyncAlgorithmsTests/TestChunk.swift @@ -338,4 +338,4 @@ final class TestChunk: XCTestCase { } } -#endif \ No newline at end of file +#endif diff --git a/Tests/AsyncAlgorithmsTests/TestDebounce.swift b/Tests/AsyncAlgorithmsTests/TestDebounce.swift index 9cc54d63..94dae286 100644 --- a/Tests/AsyncAlgorithmsTests/TestDebounce.swift +++ b/Tests/AsyncAlgorithmsTests/TestDebounce.swift @@ -13,7 +13,7 @@ import XCTest import AsyncAlgorithms final class TestDebounce: XCTestCase { -#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + #if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_delayingValues() throws { guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { throw XCTSkip("Skipped due to Clock/Instant/Duration availability") @@ -68,7 +68,7 @@ final class TestDebounce: XCTestCase { "----|" } } -#endif + #endif func test_Rethrows() async throws { guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { diff --git a/Tests/AsyncAlgorithmsTests/TestMerge.swift b/Tests/AsyncAlgorithmsTests/TestMerge.swift index a44c1dcf..03650ec4 100644 --- a/Tests/AsyncAlgorithmsTests/TestMerge.swift +++ b/Tests/AsyncAlgorithmsTests/TestMerge.swift @@ -170,7 +170,7 @@ final class TestMerge2: XCTestCase { XCTAssertEqual(collected.intersection(expected), expected) } -#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + #if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_merge_makes_sequence_with_ordered_elements_when_sources_follow_a_timeline() { validate { "a-c-e-g-|" @@ -179,7 +179,7 @@ final class TestMerge2: XCTestCase { "abcdefgh|" } } -#endif + #endif func test_merge_finishes_when_iteration_task_is_cancelled() async { let source1 = Indefinite(value: "test1") @@ -510,7 +510,7 @@ final class TestMerge3: XCTestCase { XCTAssertEqual(collected.intersection(expected), expected) } -#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + #if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_merge_makes_sequence_with_ordered_elements_when_sources_follow_a_timeline() { validate { "a---e---|" @@ -520,7 +520,7 @@ final class TestMerge3: XCTestCase { "abcdefgh|" } } -#endif + #endif func test_merge_finishes_when_iteration_task_is_cancelled() async { let source1 = Indefinite(value: "test1") diff --git a/Tests/AsyncAlgorithmsTests/TestThrottle.swift b/Tests/AsyncAlgorithmsTests/TestThrottle.swift index d4103dab..0d21cd5a 100644 --- a/Tests/AsyncAlgorithmsTests/TestThrottle.swift +++ b/Tests/AsyncAlgorithmsTests/TestThrottle.swift @@ -13,7 +13,7 @@ import XCTest import AsyncAlgorithms final class TestThrottle: XCTestCase { -#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) + #if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread) func test_rate_0() throws { guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { throw XCTSkip("Skipped due to Clock/Instant/Duration availability") @@ -189,5 +189,5 @@ final class TestThrottle: XCTestCase { "a--d--g--j--[l|]" } } -#endif + #endif } From 170549c3d8e780f50b7d3186f1f1fd8a98aaaa57 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 10:33:25 -0700 Subject: [PATCH 8/9] perhaps the last remaining formatting failure? --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index b12d7e14..45c5abca 100644 --- a/Package.swift +++ b/Package.swift @@ -76,7 +76,7 @@ let package = Package( .openbsd, .wasi, ]) - ) + ), ], swiftSettings: availabilityMacros + [ .enableExperimentalFeature("StrictConcurrency=complete") From 8869779fe4fb1dbbae4a42449f541167f13b8287 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Mon, 8 Sep 2025 16:22:12 -0700 Subject: [PATCH 9/9] Disable macOS testing since those resources are not allocated --- .github/workflows/pull_request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2d53eb65..115ea4e4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -11,7 +11,6 @@ jobs: with: linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}]" windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}]" - enable_macos_checks: true enable_wasm_sdk_build: true wasm_sdk_build_command: swift build -Xcc -D_WASI_EMULATED_PTHREAD