Skip to content

Add missing availability annotations to TestClock and TestInstant#409

Open
azarovalex wants to merge 2 commits into
apple:mainfrom
azarovalex:fix-missing-availability-annotations
Open

Add missing availability annotations to TestClock and TestInstant#409
azarovalex wants to merge 2 commits into
apple:mainfrom
azarovalex:fix-missing-availability-annotations

Conversation

@azarovalex
Copy link
Copy Markdown

@azarovalex azarovalex commented Apr 15, 2026

Summary

  • When the platforms: field was removed from Package.swift in favor of availability annotations (Move platform requirements to availability annotations #348), TestClock and TestInstant protocols in AsyncSequenceValidation/Clock.swift were missed.
  • Without platforms:, SwiftPM's default deployment target depends on the toolchain. Nightly/dev toolchains (used by ci.swift.org) default to macOS 10.13, which is below the macOS 10.15 minimum for async/await. Xcode release toolchains default to a higher target, which is why this doesn't reproduce locally with a stock swift build.
  • This has kept ci.swift.org macOS builds red since Move platform requirements to availability annotations #348 landed (April 2025).
  • Adds @available(AsyncAlgorithms 1.0, *) to both protocols, matching every other public declaration in the module.

Reproducing locally

swift build -Xswiftc -target -Xswiftc x86_64-apple-macos10.13

Test plan

  • swift build succeeds locally
  • Build with explicit macOS 10.13 target succeeds after fix
  • ci.swift.org macOS CI passes

When the `platforms:` field was removed from Package.swift in favor of
availability annotations (042e1c4), `TestClock` and `TestInstant` were
missed. Without `platforms:`, SwiftPM defaults to macOS 10.13, causing
compilation failures for these protocols that use async/await.
@azarovalex azarovalex marked this pull request as draft April 15, 2026 16:36
@azarovalex azarovalex marked this pull request as ready for review April 15, 2026 17:38
@phausler
Copy link
Copy Markdown
Member

@swift-ci please test

The compiler crashes on `MultiProducerSingleConsumerAsyncChannel.Source!`
(IUO on an unbound generic member inside a closure). Spell out the
generic arguments to sidestep the bug.
)
let channel = channelAndSource.takeChannel()
var source: MultiProducerSingleConsumerAsyncChannel.Source! = consume channelAndSource.source
var source: MultiProducerSingleConsumerAsyncChannel<Int, Never>.Source! = consume channelAndSource.source
Copy link
Copy Markdown
Author

@azarovalex azarovalex Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is (hopefully) a workaround for compiler crash: swiftlang/swift#88530

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my fix for compiler crash was merged but "nighly" docker image used by CI is quite old so let's just keep this change

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.

3 participants