beeware / Python-Apple-support

A meta-package for building a version of Python that can be embedded into a macOS, iOS, tvOS or watchOS project.
MIT License
1.1k stars 159 forks source link

Use dynamically generated binary modules, rather than static linking #161

Closed freakboy3742 closed 1 year ago

freakboy3742 commented 2 years ago

As part of introducing support for binary modules on mobile, we need to revert the previous practice of statically linking the Python standard library.

This restructures the format of the support packages to only include:

  1. Python.xcframework, a multi-platform static library; and
  2. A copy of the Python standard library, as a standalone folder. This folder contains a lib-dynload subfolder that contains the binary modules for the standard library. On iOS/tvOS/watchOS, there are 2 binaries for each module - one for the "on metal" version, and one for the "on simulator" version. The simulator modules are "fat", containing both x86_64 and ARM64 binaries (same as is done on macOS).

XZ/BZip2/OpenSSL are not included in the distributed support package any more, as they are statically linked into their corresponding binary modules, and are therefore not needed for compilation of the final app.

Refs beeware/briefcase#471.

PR Checklist: