Skip to content

Triple: bring OS version mapping up to date#2153

Merged
nkcsgexi merged 2 commits into
swiftlang:mainfrom
nkcsgexi:177999453-2
Jun 15, 2026
Merged

Triple: bring OS version mapping up to date#2153
nkcsgexi merged 2 commits into
swiftlang:mainfrom
nkcsgexi:177999453-2

Conversation

@nkcsgexi

Copy link
Copy Markdown
Contributor

@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@nkcsgexi nkcsgexi changed the title Triple: bring OS version mapping to date Triple: bring OS version mapping up to date Jun 11, 2026
@jakepetroules jakepetroules self-requested a review June 11, 2026 23:20
Comment thread Sources/SwiftDriver/Utilities/Triple.swift Outdated
@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

#expect(iOSVersion("arm64-apple-ios19.0") == Triple.Version(26, 0, 0))
#expect(iOSVersion("arm64-apple-ios26.0") == Triple.Version(26, 0, 0))
#expect(iOSVersion("arm64-apple-ios18.0") == Triple.Version(18, 0, 0))
#expect(iOSVersion("arm64-apple-ios21.0") == Triple.Version(28, 0, 0))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this really the right behavior? If I pass arm64-apple-ios20.0 to clang, it errors out completely, rather than transforming it to an iOS 27 triple.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe it's better to translate these versions mechanically at the driver layer because the compiler will eventually diagnose them anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Additionally, there doesn't seem to be a great diagnostic engine at this layer in the driver that allows us to emit good diagnostics.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably another option is to keep the version as is if they fall into the invalid gap so that Swift and Clang can later diagnose. hmm

Rewrite `_iOSVersion` along the lines of LLVM's `getiOSVersion` for the
version-26 alignment: iOS & tvOS 19 -> 26, xrOS 1/2 -> iOS 17/18, xrOS 3 ->
26, watchOS 12 -> 26. Unlike LLVM, only the last pre-jump release
canonicalizes to 26; versions in the unshipped gap below 26 are left
unchanged rather than bumped into the 26+ space.
@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test Windows

@nkcsgexi nkcsgexi enabled auto-merge June 13, 2026 02:42
@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test Windows

1 similar comment
@nkcsgexi

Copy link
Copy Markdown
Contributor Author

@swift-ci please test Windows

@nkcsgexi nkcsgexi merged commit 953b322 into swiftlang:main Jun 15, 2026
25 of 26 checks passed
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