Skip to content

Add Linux support using Synchronization.Mutex - #74

Merged
twittemb merged 2 commits into
mainfrom
feature/linux-compatibility
Oct 4, 2026
Merged

twittemb merged 2 commits into
mainfrom
feature/linux-compatibility

Conversation

@twittemb

@twittemb twittemb commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Enable AsyncExtensions builds and tests on Linux by replacing Darwin-only locking with Synchronization.Mutex. A reference-backed ManagedCriticalState preserves shared state between iterator copies and callbacks, with compiler-checked conditional Sendable conformance. Remove the unused Combine test import and import Dispatch explicitly for the buffered timer.

Breaking requirements: Swift 6.1+, iOS/tvOS 18+, macOS 15+, and watchOS 11+. Swift 5 language mode is retained. Swift 6.0.3 was excluded after reproducing a compiler crash in generic Mutex initialization during Linux debug builds.

Add Ubuntu 22.04 CI with Swift 6.1.3 and 6.4.0, document Linux usage, and test that throwing critical regions preserve mutations and release the lock. Make the lazy-sequence cancellation test await its child task so XCTest finishes after all expectations and assertions complete. Related: #38.

Validation

  • macOS arm64, Swift 6.4: release build and all 200 tests passed.
  • Ubuntu 22.04 arm64, Swift 6.1.3: release build and all 200 tests passed.
  • Ubuntu 22.04 arm64, Swift 6.4: release build and all 200 tests passed.
  • Cancellation regression: all 200 tests passed locally, plus 20 consecutive focused test runs.
  • GitHub Actions at 3b41b88: Ubuntu 22.04 x86_64 release builds and all 200 tests passed on Swift 6.1.3 and 6.4.0; macOS build and test jobs also passed, in both push and pull-request workflows. PR workflow results.
  • Workflow YAML parsed and git diff --check passed.

Checklist

  • this PR is based on the main branch and is up-to-date, if not please rebase your branch on the top of main
  • the commits inside this PR have explicit commit messages
  • unit tests cover the new feature or the bug fix
  • the feature is documented in the README.md if it makes sense
  • the CHANGELOG is up-to-date

Preserve shared critical-state ownership with a reference-backed Mutex wrapper and compiler-checked Sendable conformance. Remove the unused Combine test import and make Dispatch explicit.

Require Swift 6.1 and iOS/tvOS 18, macOS 15, and watchOS 11 while retaining Swift 5 language mode. Swift 6.0.3 crashes when compiling generic Mutex storage in Linux debug builds.

Add Ubuntu CI for Swift 6.1.3 and 6.4.0 and verify throwing critical regions release the lock. All 200 tests and release builds passed on macOS and Linux arm64.
@twittemb
twittemb merged commit b4adff5 into main Oct 4, 2026
8 checks passed
@lhoward

lhoward commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Great. Can you tag a release? Thank you, I'm very happy not to have to maintain a fork anymore.

@twittemb

twittemb commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Done -> 0.7

@lhoward

lhoward commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Done -> 0.7

Legend. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants