apple / apple/swift-openapi-generator
Add visionOS to `@available` annotations where we use them
- Dominant language
- Swift
- Stars
- 2k
- Forks
- 182
- Avg merge
- 13h 28m
- Merged PRs (30d)
- 5
Description
While the current Linux toolchains are happy to have visionOS in the `platforms:` in Package.swift, it seems they don't it being mentioned in the list of platforms in an `@available` annotation yet.
We tried to add it to the URLSession transport in https://github.com/apple/swift-openapi-urlsession/pull/41. This succeeds in the latest Xcode release (15.0.1), but it fails in our Linux CI.
```
/code/Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift:1010:53: error: unrecognized platform name 'visionOS'
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
```
Note, this is only a warning but, because we compile with `-warnings-as-errors`, it gets promoted by the CI, and there's no current way to selectively opt-out of errors on a per-error or per-file basis.
We'll backlog this issue to post-1.0 and pick it up when we have it available for use in the Linux toolchain.
Contributor guide
Research direction
Start by locating the generated or maintained @available annotations and review the Package.swift platform declarations; the issue cites BufferedStream/BufferedStream.swift as an example from the URLSession transport. Add visionOS only once the Linux toolchain accepts it, then verify that Linux CI passes with warnings treated as errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100