|
| 1 | +# Swift Platform Support: A Vision for Evolution |
| 2 | + |
| 3 | +The Swift programming language has evolved into a versatile and powerful tool |
| 4 | +for developers across a wide range of platforms. As the ecosystem continues to |
| 5 | +grow, it is essential to establish a clear and forward-looking vision for |
| 6 | +platform support. This vision has two main goals: |
| 7 | + |
| 8 | +1. To establish common terminology and definitions for platform support. |
| 9 | + |
| 10 | +2. To document a process for platforms to become officially supported in Swift. |
| 11 | + |
| 12 | +## Understanding Platforms in the Swift Ecosystem |
| 13 | + |
| 14 | +The term "platform" carries multiple interpretations. For our purposes, a |
| 15 | +platform represents the confluence of operating system, architecture, and |
| 16 | +environment where Swift code executes. Each platform is identified using a |
| 17 | +version-stripped LLVM `Triple`—a precise technical identifier that captures the |
| 18 | +essential characteristics of a host environment (e.g., |
| 19 | +`x86_64-unknown-windows-msvc`). |
| 20 | + |
| 21 | +## The Anatomy of a `Triple` |
| 22 | + |
| 23 | +At its core, a `Triple` comprises 11 distinct elements arranged in a specific |
| 24 | +pattern: |
| 25 | + |
| 26 | +``` |
| 27 | +[architecture][sub-architecture][extensions][endian]-[vendor]-[kernel/OS][version]-[libc/environment][abi][version]-[object format] |
| 28 | +``` |
| 29 | + |
| 30 | +This naming convention might initially appear complex, but it offers remarkable |
| 31 | +precision. When a public entity isn't associated with a toolchain, the |
| 32 | +placeholder `unknown` is used for the vendor field. Similarly, bare-metal |
| 33 | +environments—those without an operating system—employ `none` as their OS/kernel |
| 34 | +designation. |
| 35 | + |
| 36 | +While many of these fields may be elided, for use in Swift, the vendor and OS |
| 37 | +fields are always included, even if they are placeholder values. |
| 38 | + |
| 39 | +Consider these illustrative examples: |
| 40 | + |
| 41 | +- `armv7eb-unknown-linux-uclibceabihf-coff`: A Linux system running on ARMv7 in big-endian mode, with the µClibc library and PE/COFF object format. |
| 42 | +- `aarch64-unknown-windows-msvc-macho`: Windows NT on the ARM64 architecture using the MSVC runtime with Mach-O object format. |
| 43 | +- `riscv64gcv-apple-ios14-macabi`: An iOS 14 environment running on a RISC-V processor with specific ISA extensions. |
| 44 | + |
| 45 | +This nomenclature creates a shared language for discussing platform capabilities |
| 46 | +and constraints—an essential foundation for our support framework. |
| 47 | + |
| 48 | +## Distributions within Platforms |
| 49 | + |
| 50 | +A platform and distribution, while related, serve distinct roles in the Swift |
| 51 | +ecosystem. A platform refers to the broader combination of Operating System, |
| 52 | +architecture, and environment where Swift code executes and establishes the |
| 53 | +foundational compatibility and functionality of Swift. |
| 54 | + |
| 55 | +A distribution, on the other hand, represents a specific implementation or |
| 56 | +variant within a platform. For example, while Linux as a platform is supported, |
| 57 | +individual distributions such as Ubuntu, Fedora, or Amazon Linux require |
| 58 | +additional work to ensure that Swift integrates seamlessly. This includes |
| 59 | +addressing distribution-specific configurations, dependencies, and conventions. |
| 60 | + |
| 61 | +Distributions are treated similarly to platforms in that they require a |
| 62 | +designated owner. This owner is responsible for ensuring that Swift functions |
| 63 | +properly on the distribution, adheres to the distribution's standards, and |
| 64 | +remains a responsible citizen within that ecosystem. By assigning ownership, the |
| 65 | +Swift community ensures that each distribution receives the attention and |
| 66 | +stewardship necessary to maintain a high-quality experience for developers. |
| 67 | + |
| 68 | +## Platform Stewardship |
| 69 | + |
| 70 | +The health of each platform depends on active stewardship. Every platform in the |
| 71 | +Swift ecosystem requires a designated owner who reviews platform-specific |
| 72 | +changes and manages release activities. Platforms without active owners enter a |
| 73 | +dormant state, reverting to exploratory status until new leadership emerges. |
| 74 | + |
| 75 | +This ownership model ensures that platform support remains intentional rather |
| 76 | +than accidental—each supported environment has an advocate invested in its |
| 77 | +success. |
| 78 | + |
| 79 | +The Platform Steering Group will regularly review the list of supported |
| 80 | +platforms against the tier criteria below. While the Platform Steering Group |
| 81 | +reserves the right to update the list or the tier criteria at any time, it is |
| 82 | +expected that most such changes will be aligned with the Swift release cycle. |
| 83 | + |
| 84 | +## A Tiered Approach to Platform Support |
| 85 | + |
| 86 | +Swift's platform support strategy employs three distinct tiers, each |
| 87 | +representing a different level of maturity. The requirements for each tier build |
| 88 | +upon those of the previous tier. |
| 89 | + |
| 90 | +### Tier 1: "Supported" Platforms |
| 91 | + |
| 92 | +These are Swift's most mature environments, where the language must consistently |
| 93 | +build successfully and pass comprehensive test suites. Swift on these platforms |
| 94 | +offers the strongest guarantees of stability and performance. |
| 95 | + |
| 96 | +Platforms that are in Tier 1 should: |
| 97 | + |
| 98 | +- [ ] Digitally sign their release artifacts. |
| 99 | +- [ ] Include a Software Bill of Materials (SBOM). |
| 100 | + |
| 101 | +- [ ] Include at a minimum the following Swift libraries: |
| 102 | + |
| 103 | + - [ ] Swift Standard Library |
| 104 | + - [ ] Swift Supplemental Libraries |
| 105 | + - [ ] Swift Core Libraries |
| 106 | + - [ ] Swift Testing Frameworks (if applicable) |
| 107 | + |
| 108 | + (See [the Swift Runtime Libraries |
| 109 | + document](https://github.com/swiftlang/swift/blob/main/Runtimes/Readme.md) |
| 110 | + in [the Swift repository](https://github.com/swiftlang/swift).) |
| 111 | + |
| 112 | +- [ ] Maintain a three-version window of support, including: |
| 113 | + |
| 114 | + - [ ] At least one stable release. |
| 115 | + - [ ] The next planned release. |
| 116 | + - [ ] The development branch (`main`). |
| 117 | + |
| 118 | +- [ ] Have a clear, documented, story for debugging, to allow users to set up |
| 119 | + an environment where their products can be executed on a device or |
| 120 | + simulator and be debugged. |
| 121 | + |
| 122 | +- [ ] Have testing in CI, including PR testing. |
| 123 | + |
| 124 | +- [ ] Ship SDKs as regular release from [swift.org](https://swift.org) |
| 125 | + |
| 126 | +- [ ] Ensure that instructions needed to get started on the platform |
| 127 | + are publicly available, ideally on or linked to from |
| 128 | + [swift.org](https://swift.org). |
| 129 | + |
| 130 | +An important aspect of Tier 1 platforms is that maintenance of support |
| 131 | +of these platforms is the collective responsibility of the Swift |
| 132 | +project as a whole, rather than falling entirely on the platform |
| 133 | +owner. This means: |
| 134 | + |
| 135 | +- Contributions should not be accepted if they break a Tier 1 platform. |
| 136 | + |
| 137 | +- If a Tier 1 platform does break, whoever is responsible for the code |
| 138 | + that is breaking must work with the platform owner on some kind of |
| 139 | + resolution, which may mean backing out the relevant changes. |
| 140 | + |
| 141 | +- New features should aim to function on all Tier 1 |
| 142 | + platforms, subject to the availability of appropriate supporting |
| 143 | + functionality on each platform. |
| 144 | + |
| 145 | +- There is a presumption that a release of Swift will be blocked if a |
| 146 | + Tier 1 platform is currently broken. This is not a hard and fast |
| 147 | + rule, and can be overridden if it is in the interests of the Swift |
| 148 | + project as a whole. |
| 149 | + |
| 150 | +### Tier 1: "Supported" Toolchain Hosts |
| 151 | + |
| 152 | +Each toolchain host is an expensive addition to the testing matrix. |
| 153 | +In addition to the requirements above, a toolchain host platform should: |
| 154 | + |
| 155 | +- [ ] Have CI coverage for the toolchain, including PR testing. |
| 156 | + |
| 157 | +- [ ] Offer toolchain distributions from |
| 158 | + [swift.org](https://swift.org) as an official source, though |
| 159 | + other distributions may also be available. |
| 160 | + |
| 161 | +- [ ] Include the following toolchain components: |
| 162 | + |
| 163 | + - [ ] Swift compiler (`swiftc`). |
| 164 | + - [ ] C/C++ compiler (`clang`, `clang++`). |
| 165 | + - [ ] Assembler (LLVM integrated assembler, built into `clang`). |
| 166 | + - [ ] Linker (_typically_ `lld`). |
| 167 | + - [ ] Debugger (`lldb`). |
| 168 | + - [ ] Swift Package Manager (SwiftPM). |
| 169 | + - [ ] Language Server (`sourcekit-lsp`). |
| 170 | + - [ ] Debug Adapter (`lldb-dap`). |
| 171 | + |
| 172 | +- [ ] Code-sign individual tools as appropriate for the platform. |
| 173 | + |
| 174 | +Note that the bar for accepting a platform as a toolchain host is somewhat |
| 175 | +higher than the bar for accepting a non-toolchain-host platform. |
| 176 | + |
| 177 | +### Tier 2: "Experimental" Platforms |
| 178 | + |
| 179 | +Experimental platforms occupy the middle ground—they must maintain the ability |
| 180 | +to build but may experience occasional test failures. These platforms |
| 181 | +represent Swift's expanding frontier. |
| 182 | + |
| 183 | +Platforms in this tier should: |
| 184 | + |
| 185 | +- [ ] Ensure that dependencies beyond the platform SDK can build from source. |
| 186 | + |
| 187 | +- [ ] Provide provenance information to validate the software supply chain. |
| 188 | + |
| 189 | +- [ ] Include at a minimum the following Swift libraries: |
| 190 | + |
| 191 | + - [ ] Swift Standard Library |
| 192 | + - [ ] Swift Supplemental Libraries |
| 193 | + - [ ] Swift Core Libraries |
| 194 | + - [ ] Swift Testing Frameworks (if applicable) |
| 195 | + |
| 196 | + (See [the Swift Runtime Libraries |
| 197 | + document](https://github.com/swiftlang/swift/blob/main/Runtimes/Readme.md) |
| 198 | + in [the Swift repository](https://github.com/swiftlang/swift).) |
| 199 | + |
| 200 | +- [ ] Maintain at least a two-version window of support, including |
| 201 | + |
| 202 | + - [ ] The next planned release. |
| 203 | + - [ ] The development branch (`main`). |
| 204 | + |
| 205 | +Unlike Tier 1, the Swift project does not assume collective |
| 206 | +responsibility for experimental platforms. Platform owners should |
| 207 | +work with individual contributors to keep their platform in a |
| 208 | +buildable state. |
| 209 | + |
| 210 | +### Tier 3: "Exploratory" Platforms |
| 211 | + |
| 212 | +At the boundary of Swift's reach are exploratory platforms. |
| 213 | +Exploratory status offers an entry point for platforms taking their |
| 214 | +first steps into the Swift ecosystem. |
| 215 | + |
| 216 | +Platforms in this tier should: |
| 217 | + |
| 218 | +- [ ] Support reproducible builds without requiring external |
| 219 | + patches, though there is no requirement that these build completely |
| 220 | + or consistently. |
| 221 | + |
| 222 | +- [ ] Maintain support in the current development branch (`main`). |
| 223 | + |
| 224 | +The Swift Project does not assume collective responsibility for |
| 225 | +exploratory platforms. Platform owners are responsible for keeping |
| 226 | +their platform in a buildable state. |
| 227 | + |
| 228 | +## Platform Inclusion Process and Promotion |
| 229 | + |
| 230 | +Adding platform support begins with a formal request to the Platform Steering |
| 231 | +Group, accompanied by a platform owner nomination. This structured yet |
| 232 | +accessible approach balances Swift's need for stability with its aspiration for |
| 233 | +growth. |
| 234 | + |
| 235 | +The request should include: |
| 236 | + |
| 237 | +- [ ] The preferred name of the platform. |
| 238 | + |
| 239 | +- [ ] The name and contact details of the platform owner. |
| 240 | + |
| 241 | +- [ ] The support tier into which the platform should be placed. |
| 242 | + |
| 243 | +- [ ] Instructions to build Swift for the platform, assuming someone |
| 244 | + is starting from scratch, including any requirements for the |
| 245 | + build system. |
| 246 | + |
| 247 | +- [ ] A list of tier requirements that are currently _not_ met by the |
| 248 | + platform, including an explanation as to _why_ they are not met |
| 249 | + and what the proposal is to meet them, if any. |
| 250 | + |
| 251 | +- [ ] Whether there has been any discussion about provisioning of CI |
| 252 | + resources, and if so a copy of or link to that discussion. This |
| 253 | + is particularly relevant for a Tier 1 platform request. |
| 254 | + |
| 255 | +Note that it is _not_ the case that a platform _must_ meet every |
| 256 | +requirement of the requested tier in order to be placed into that |
| 257 | +tier. The Platform Steering Group will consider each case on its |
| 258 | +merits, and will make a decision based on the information at hand as |
| 259 | +well as the overall benefit to the Swift Project. It should be |
| 260 | +emphasized that the Platform Steering Group reserves the right to |
| 261 | +consider factors other than those listed here when making decisions |
| 262 | +about official platform support. |
| 263 | + |
| 264 | +The same process should be used to request a promotion to a higher |
| 265 | +tier. |
| 266 | + |
| 267 | +## Grandfathering and Demotion |
| 268 | + |
| 269 | +The following platforms are grandfathered into Tier 1 regardless of |
| 270 | +any text in this document: |
| 271 | + |
| 272 | +- All Apple platforms (macOS, iOS and so on). |
| 273 | +- Linux |
| 274 | +- Windows |
| 275 | + |
| 276 | +The Platform Steering Group reserves the right to demote any |
| 277 | +platform to a lower tier, but regards demotion as a last resort |
| 278 | +and will by preference work with platform owners to maintain |
| 279 | +support appropriate for their platform's existing tier. |
| 280 | + |
| 281 | +Note that if your platform is one of the above special cases, and |
| 282 | +there is some requirement in this document that is not being met, it |
| 283 | +is expected that either there is a very good reason for the |
| 284 | +requirement not being met, or that there is some plan to meet it in |
| 285 | +future. |
0 commit comments