@@ -3,7 +3,7 @@ Title: Adding iOS as a supported platform
3
3
Author: Russell Keith-Magee <
[email protected] >
4
4
Sponsor: Ned Deily <
[email protected] >
5
5
Discussions-To: https://discuss.python.org/t/pep730-adding-ios-as-a-supported-platform/35854
6
- Status: Accepted
6
+ Status: Final
7
7
Type: Standards Track
8
8
Content-Type: text/x-rst
9
9
Created: 09-Oct-2023
@@ -170,9 +170,9 @@ devices.
170
170
171
171
``sys.implementation._multiarch `` will describe the ABI and CPU architecture:
172
172
173
- * ``"iphoneos- arm64" `` for ARM64 devices
174
- * ``"iphonesimulator- arm64" `` for ARM64 simulators
175
- * ``"iphonesimulator- x86_64" `` for x86_64 simulators
173
+ * ``"arm64-iphoneos " `` for ARM64 devices
174
+ * ``"arm64-iphonesimulator " `` for ARM64 simulators
175
+ * ``"x86_64-iphonesimulator " `` for x86_64 simulators
176
176
177
177
``platform ``
178
178
''''''''''''
@@ -181,7 +181,8 @@ devices.
181
181
the values returned by the ``platform `` module will match those returned by
182
182
``os.uname() ``, with the exception of:
183
183
184
- * ``platform.system() `` - ``"iOS" ``, instead of the default ``"Darwin" ``
184
+ * ``platform.system() `` - ``"iOS" `` or ``iPadOS `` (depending on the hardware in
185
+ use), instead of ``"Darwin" ``
185
186
186
187
* ``platform.release() `` - the iOS version number, as a string (e.g.,
187
188
``"16.6.1" ``), instead of the Darwin kernel version.
@@ -190,11 +191,11 @@ In addition, a ``platform.ios_ver()`` method will be added. This mirrors
190
191
``platform.mac_ver() ``, which can be used to provide macOS version information.
191
192
``ios_ver() `` will return a namedtuple that contains the following:
192
193
194
+ * ``system `` - the OS name (``iOS `` or ``iPadOS ``, depending on hardware)
193
195
* ``release `` - the iOS version, as a string (e.g., ``"16.6.1" ``).
194
- * ``min_release `` - the minimum supported iOS version, as a string (e.g.,
195
- ``"12.0" ``)
196
196
* ``model `` - the model identifier of the device, as a string (e.g.,
197
- ``"iPhone13,2" ``). On simulators, this will return ``"iPhoneSimulator" ``.
197
+ ``"iPhone13,2" ``). On simulators, this will return ``"iPhone" `` or ``"iPad" ``,
198
+ depending on the simulator device.
198
199
* ``is_simulator `` - a boolean indicating if the device is a simulator.
199
200
200
201
``os ``
@@ -214,7 +215,7 @@ This approach treats the ``os`` module as a "raw" interface to system APIs, and
214
215
'''''''''''''
215
216
216
217
The ``sysconfig `` module will use the minimum iOS version as part of
217
- ``sysconfig.get_platform() `` (e.g., ``"ios-12.0-iphoneos- arm64" ``). The
218
+ ``sysconfig.get_platform() `` (e.g., ``"ios-12.0-arm64-iphoneos " ``). The
218
219
``sysconfigdata_name `` and Config makefile will follow the same patterns as
219
220
existing platforms (using ``sys.platform ``, ``sys.implementation._multiarch ``
220
221
etc.) to construct identifiers.
@@ -238,7 +239,7 @@ into a Framework location. This finder will only be installed if ``sys.platform
238
239
This finder will convert a Python module name (e.g., ``foo.bar._whiz ``) into a
239
240
unique Framework name by using the full module name as the framework name (i.e.,
240
241
``foo.bar._whiz.framework ``). A framework is a directory; the finder will look
241
- for `` _whiz.dylib `` in that directory.
242
+ for a binary named `` foo.bar._whiz `` in that directory.
242
243
243
244
Compilation
244
245
-----------
@@ -302,16 +303,16 @@ provided for each ABI-arch combination.
302
303
303
304
iOS wheels will use tags:
304
305
305
- * ``ios_12_0_iphoneos_arm64 ``
306
- * ``ios_12_0_iphonesimulator_arm64 ``
307
- * ``ios_12_0_iphonesimulator_x86_64 ``
306
+ * ``ios_12_0_arm64_iphoneos ``
307
+ * ``ios_12_0_arm64_iphonesimulator ``
308
+ * ``ios_12_0_x86_64_iphonesimulator ``
308
309
309
310
In these tags, "12.0" is the minimum supported iOS version. As with macOS, the
310
311
tag will incorporate the minimum iOS version that is selected when the wheel is
311
312
compiled; a wheel compiled with a minimum iOS version of 15.0 would use the
312
- ``ios_15_0_iphone * `` tags. At time of writing, iOS 12.0 exposes most significant
313
- iOS features, while reaching near 100% of devices; this will be used as a floor
314
- for iOS version matching.
313
+ ``ios_15_0_ * `` tags. At time of writing, iOS 12.0 exposes most significant iOS
314
+ features, while reaching near 100% of devices; this will be used as a floor for
315
+ iOS version matching.
315
316
316
317
These wheels can include binary modules in-situ (i.e., co-located with the
317
318
Python source, in the same way as wheels for a desktop platform); however, they
@@ -322,14 +323,18 @@ build step.
322
323
PEP 11 Update
323
324
-------------
324
325
325
- :pep: `11 ` will be updated to include the three iOS ABIs:
326
+ :pep: `11 ` will be updated to include two of the iOS ABIs:
326
327
327
- * ``aarch64-apple-ios ``
328
- * ``aarch64-apple-ios-simulator ``
329
- * ``x86_64-apple-ios-simulator ``
328
+ * ``arm64-apple-ios ``
329
+ * ``arm64-apple-ios-simulator ``
330
330
331
331
Ned Deily will serve as the initial core team contact for these ABIs.
332
332
333
+ The ``x86_64-apple-ios-simulator `` target will be supported on a best-effort
334
+ basis, but will not be targeted for tier 3 support. This is due to the impending
335
+ deprecation of x86_64 as a simulation platform, combined with the difficulty of
336
+ commissioning x86_64 macOS hardware at this time.
337
+
333
338
Backwards Compatibility
334
339
=======================
335
340
@@ -436,6 +441,8 @@ The decision was made to use ``arm64-apple-ios`` and
436
441
5. While *some * iOS packages will use Rust, *all * iOS packages will use Apple's
437
442
tooling.
438
443
444
+ The initially accepted version of this document used the ``aarch64 `` form as the PEP 11 identifier; this was corrected during finalization.
445
+
439
446
"Universal" wheel format
440
447
------------------------
441
448
@@ -523,21 +530,16 @@ involve building a very specific user-facing app that would be closer to an
523
530
IDLE-style IDE experience. Therefore, the decision was made to only focus on
524
531
"embedded mode" as a target for mobile distribution.
525
532
526
- Open Issues
527
- ===========
528
-
529
- x86_64 buildbot availability
530
- ----------------------------
533
+ x86_64 simulator support
534
+ ------------------------
531
535
532
536
Apple no longer sells x86_64 hardware. As a result, commissioning an x86_64
533
- buildbot may not be possible . It is possible to run macOS binaries in x86_64
537
+ buildbot can be difficult . It is possible to run macOS binaries in x86_64
534
538
compatibility mode on ARM64 hardware; however, this isn't ideal for testing
535
- purposes.
536
-
537
- If native x86_64 Mac hardware cannot be sourced for buildbot purposes, it may be
538
- necessary to exclude the x86_64 simulator platform in Tier 3. Given the
539
- anticipated deprecation of x86_64 as a macOS development platform, this doesn't
540
- pose a significant impediment to adoption or long term maintenance.
539
+ purposes. Therefore, the x86_64 Simulator (``x86_64-apple-ios-simulator ``) will
540
+ not be added as a Tier 3 target. It is highly likely that iOS support will work
541
+ on the x86_64 without any modification; this only impacts on the *official * Tier
542
+ 3 status.
541
543
542
544
On-device testing
543
545
-----------------
@@ -551,6 +553,29 @@ Cloud solution doesn't provide on-device testing. They rely on the fact that the
551
553
API is consistent between device and simulator, and ARM64 simulator testing is
552
554
sufficient to reveal CPU-specific issues.
553
555
556
+ Ordering of ``_multiarch `` tags
557
+ -------------------------------
558
+
559
+ The initially accepted version of this document used ``<platform>-<arch> ``
560
+ ordering (e.g., ``iphoneos-arm64 ``) for ``sys.implementation._multiarch `` (and
561
+ related values, such as wheel tags). The final merged version uses the
562
+ ``<arch>-<platform> `` ordering (e.g., ``arm64-iphoneos ``). This is for
563
+ consistency with compiler triples on other platforms (especially Linux), which
564
+ specify the architecture before the operating system.
565
+
566
+ Values returned by ``platform.ios_ver() ``
567
+ -----------------------------------------
568
+
569
+ The initially accepted version of this document didn't include a ``system ``
570
+ identifier. This was added during the implementation phase to support the implementation of ``platform.system() ``.
571
+
572
+ The initially accepted version of this document also described that
573
+ ``min_release `` would be returned in the ``ios_ver() `` result. The final version
574
+ omits the ``min_release `` value, as it is not significant at runtime; it only
575
+ impacts on binary compatibility. The minimum version *is * included in the value
576
+ returned by ``sysconfig.get_platform() ``, as this is used to define wheel (and
577
+ other binary) compatibility.
578
+
554
579
Copyright
555
580
=========
556
581
0 commit comments