-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for iOS #1742
Comments
See https://maturin.rs/platform_support.
Sure, pull requests are welcome. Could you paste a |
Here you go. The UUID bits (e.g.
|
Update: it builds the extension, but the command line is even scarier than usual: export PREFIX=...
export OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path)
env SDKROOT="$OSX_SDKROOT" \
PYO3_CROSS_LIB_DIR="$PREFIX/build/lib.darwin-arm64-3.11/" \
CARGO_BUILD_TARGET="aarch64-apple-ios" \
CARGO_TARGET_AARCH64_APPLE_IOS_RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$IOS_SDKROOT -C link-arg=-arch -C link-arg=arm64 -C link-arg=-miphoneos-version-min=14.0 -C link-arg=-L -C link-arg=$PREFIX/build/lib.darwin-arm64-3.11/ -C link-arg=-lpython3.11" \
$PREFIX/Library/bin/maturin build I'm not sure if there's anything I can do to make it shorter. I'll check that the extension can be loaded and works, then I'll make the PR. |
Where can I download a precompiled iOS Python? |
I find the wheel tags for iOS is a bit strange. Maybe $ python3 -m pip debug --verbose
pip version: pip 23.1.1 from /private/var/containers/Bundle/Application/4FD43C4F-DF0E-4BF4-82F1-376AE6CFE10D/a-Shell.app/Library/lib/python3.11/site-packages/pip (python 3.11)
sys.version: 3.11.0 (heads/3.11-dirty:2af28c9018, Apr 23 2023, 19:57:14) [Clang 14.0.3 (clang-1403.0.22.14.1)]
sys.executable: python3
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: UTF-8
sys.platform: darwin
sys.implementation:
name: cpython
'cert' config value: global
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): /private/var/containers/Bundle/Application/4FD43C4F-DF0E-4BF4-82F1-376AE6CFE10D/a-Shell.app/Library/lib/python3.11/site-packages/pip/_vendor/certifi/cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
CacheControl==0.12.11
colorama==0.4.6
distlib==0.3.6
distro==1.8.0
msgpack==1.0.5
packaging==21.3
platformdirs==3.2.0
pyparsing==3.0.9
pyproject-hooks==1.0.0
requests==2.28.2
certifi==2022.12.07
chardet==5.1.0
idna==3.4
urllib3==1.26.15
rich==13.3.3 (Unable to locate actual module version, using vendor.txt specified version)
pygments==2.14.0
typing_extensions==4.5.0 (Unable to locate actual module version, using vendor.txt specified version)
resolvelib==1.0.1
setuptools==65.6.3 (Unable to locate actual module version, using vendor.txt specified version)
six==1.16.0
tenacity==8.2.2 (Unable to locate actual module version, using vendor.txt specified version)
tomli==2.0.1
webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 514
cp311-cp311-macosx_17_0_iphone15,2
cp311-cp311-macosx_16_0_iphone15,2
cp311-cp311-macosx_15_0_iphone15,2
cp311-cp311-macosx_14_0_iphone15,2
cp311-cp311-macosx_13_0_iphone15,2
cp311-cp311-macosx_12_0_iphone15,2
cp311-cp311-macosx_11_0_iphone15,2
cp311-cp311-macosx_10_16_universal2
cp311-cp311-macosx_10_15_universal2
cp311-cp311-macosx_10_14_universal2
cp311-cp311-macosx_10_13_universal2
cp311-cp311-macosx_10_12_universal2
cp311-cp311-macosx_10_11_universal2
cp311-cp311-macosx_10_10_universal2
cp311-cp311-macosx_10_9_universal2
cp311-cp311-macosx_10_8_universal2
cp311-cp311-macosx_10_7_universal2
cp311-cp311-macosx_10_6_universal2
cp311-cp311-macosx_10_5_universal2
cp311-cp311-macosx_10_4_universal2
cp311-abi3-macosx_17_0_iphone15,2
cp311-abi3-macosx_16_0_iphone15,2
cp311-abi3-macosx_15_0_iphone15,2
cp311-abi3-macosx_14_0_iphone15,2
cp311-abi3-macosx_13_0_iphone15,2
cp311-abi3-macosx_12_0_iphone15,2
cp311-abi3-macosx_11_0_iphone15,2
cp311-abi3-macosx_10_16_universal2
cp311-abi3-macosx_10_15_universal2
cp311-abi3-macosx_10_14_universal2
cp311-abi3-macosx_10_13_universal2
cp311-abi3-macosx_10_12_universal2
cp311-abi3-macosx_10_11_universal2
cp311-abi3-macosx_10_10_universal2
cp311-abi3-macosx_10_9_universal2
cp311-abi3-macosx_10_8_universal2
cp311-abi3-macosx_10_7_universal2
cp311-abi3-macosx_10_6_universal2
cp311-abi3-macosx_10_5_universal2
cp311-abi3-macosx_10_4_universal2
cp311-none-macosx_17_0_iphone15,2
cp311-none-macosx_16_0_iphone15,2
cp311-none-macosx_15_0_iphone15,2
cp311-none-macosx_14_0_iphone15,2
cp311-none-macosx_13_0_iphone15,2
cp311-none-macosx_12_0_iphone15,2
cp311-none-macosx_11_0_iphone15,2
cp311-none-macosx_10_16_universal2
cp311-none-macosx_10_15_universal2
cp311-none-macosx_10_14_universal2
cp311-none-macosx_10_13_universal2
cp311-none-macosx_10_12_universal2
cp311-none-macosx_10_11_universal2
cp311-none-macosx_10_10_universal2
cp311-none-macosx_10_9_universal2
cp311-none-macosx_10_8_universal2
cp311-none-macosx_10_7_universal2
cp311-none-macosx_10_6_universal2
cp311-none-macosx_10_5_universal2
cp311-none-macosx_10_4_universal2
cp310-abi3-macosx_17_0_iphone15,2
cp310-abi3-macosx_16_0_iphone15,2
cp310-abi3-macosx_15_0_iphone15,2
cp310-abi3-macosx_14_0_iphone15,2
cp310-abi3-macosx_13_0_iphone15,2
cp310-abi3-macosx_12_0_iphone15,2
cp310-abi3-macosx_11_0_iphone15,2
cp310-abi3-macosx_10_16_universal2
cp310-abi3-macosx_10_15_universal2
cp310-abi3-macosx_10_14_universal2
cp310-abi3-macosx_10_13_universal2
cp310-abi3-macosx_10_12_universal2
cp310-abi3-macosx_10_11_universal2
cp310-abi3-macosx_10_10_universal2
cp310-abi3-macosx_10_9_universal2
cp310-abi3-macosx_10_8_universal2
cp310-abi3-macosx_10_7_universal2
cp310-abi3-macosx_10_6_universal2
cp310-abi3-macosx_10_5_universal2
cp310-abi3-macosx_10_4_universal2
cp39-abi3-macosx_17_0_iphone15,2
cp39-abi3-macosx_16_0_iphone15,2
cp39-abi3-macosx_15_0_iphone15,2
cp39-abi3-macosx_14_0_iphone15,2
cp39-abi3-macosx_13_0_iphone15,2
cp39-abi3-macosx_12_0_iphone15,2
cp39-abi3-macosx_11_0_iphone15,2
cp39-abi3-macosx_10_16_universal2
cp39-abi3-macosx_10_15_universal2
cp39-abi3-macosx_10_14_universal2
cp39-abi3-macosx_10_13_universal2
cp39-abi3-macosx_10_12_universal2
cp39-abi3-macosx_10_11_universal2
cp39-abi3-macosx_10_10_universal2
cp39-abi3-macosx_10_9_universal2
cp39-abi3-macosx_10_8_universal2
cp39-abi3-macosx_10_7_universal2
cp39-abi3-macosx_10_6_universal2
cp39-abi3-macosx_10_5_universal2
cp39-abi3-macosx_10_4_universal2
cp38-abi3-macosx_17_0_iphone15,2
cp38-abi3-macosx_16_0_iphone15,2
cp38-abi3-macosx_15_0_iphone15,2
cp38-abi3-macosx_14_0_iphone15,2
cp38-abi3-macosx_13_0_iphone15,2
cp38-abi3-macosx_12_0_iphone15,2
cp38-abi3-macosx_11_0_iphone15,2
cp38-abi3-macosx_10_16_universal2
cp38-abi3-macosx_10_15_universal2
cp38-abi3-macosx_10_14_universal2
cp38-abi3-macosx_10_13_universal2
cp38-abi3-macosx_10_12_universal2
cp38-abi3-macosx_10_11_universal2
cp38-abi3-macosx_10_10_universal2
cp38-abi3-macosx_10_9_universal2
cp38-abi3-macosx_10_8_universal2
cp38-abi3-macosx_10_7_universal2
cp38-abi3-macosx_10_6_universal2
cp38-abi3-macosx_10_5_universal2
cp38-abi3-macosx_10_4_universal2
cp37-abi3-macosx_17_0_iphone15,2
cp37-abi3-macosx_16_0_iphone15,2
cp37-abi3-macosx_15_0_iphone15,2
cp37-abi3-macosx_14_0_iphone15,2
cp37-abi3-macosx_13_0_iphone15,2
cp37-abi3-macosx_12_0_iphone15,2
cp37-abi3-macosx_11_0_iphone15,2
cp37-abi3-macosx_10_16_universal2
cp37-abi3-macosx_10_15_universal2
cp37-abi3-macosx_10_14_universal2
cp37-abi3-macosx_10_13_universal2
cp37-abi3-macosx_10_12_universal2
cp37-abi3-macosx_10_11_universal2
cp37-abi3-macosx_10_10_universal2
cp37-abi3-macosx_10_9_universal2
cp37-abi3-macosx_10_8_universal2
cp37-abi3-macosx_10_7_universal2
cp37-abi3-macosx_10_6_universal2
cp37-abi3-macosx_10_5_universal2
cp37-abi3-macosx_10_4_universal2
cp36-abi3-macosx_17_0_iphone15,2
cp36-abi3-macosx_16_0_iphone15,2
cp36-abi3-macosx_15_0_iphone15,2
cp36-abi3-macosx_14_0_iphone15,2
cp36-abi3-macosx_13_0_iphone15,2
cp36-abi3-macosx_12_0_iphone15,2
cp36-abi3-macosx_11_0_iphone15,2
cp36-abi3-macosx_10_16_universal2
cp36-abi3-macosx_10_15_universal2
cp36-abi3-macosx_10_14_universal2
cp36-abi3-macosx_10_13_universal2
cp36-abi3-macosx_10_12_universal2
cp36-abi3-macosx_10_11_universal2
cp36-abi3-macosx_10_10_universal2
cp36-abi3-macosx_10_9_universal2
cp36-abi3-macosx_10_8_universal2
cp36-abi3-macosx_10_7_universal2
cp36-abi3-macosx_10_6_universal2
cp36-abi3-macosx_10_5_universal2
cp36-abi3-macosx_10_4_universal2
cp35-abi3-macosx_17_0_iphone15,2
cp35-abi3-macosx_16_0_iphone15,2
cp35-abi3-macosx_15_0_iphone15,2
cp35-abi3-macosx_14_0_iphone15,2
cp35-abi3-macosx_13_0_iphone15,2
cp35-abi3-macosx_12_0_iphone15,2
cp35-abi3-macosx_11_0_iphone15,2
cp35-abi3-macosx_10_16_universal2
cp35-abi3-macosx_10_15_universal2
cp35-abi3-macosx_10_14_universal2
cp35-abi3-macosx_10_13_universal2
cp35-abi3-macosx_10_12_universal2
cp35-abi3-macosx_10_11_universal2
cp35-abi3-macosx_10_10_universal2
cp35-abi3-macosx_10_9_universal2
cp35-abi3-macosx_10_8_universal2
cp35-abi3-macosx_10_7_universal2
cp35-abi3-macosx_10_6_universal2
cp35-abi3-macosx_10_5_universal2
cp35-abi3-macosx_10_4_universal2
cp34-abi3-macosx_17_0_iphone15,2
cp34-abi3-macosx_16_0_iphone15,2
cp34-abi3-macosx_15_0_iphone15,2
cp34-abi3-macosx_14_0_iphone15,2
cp34-abi3-macosx_13_0_iphone15,2
cp34-abi3-macosx_12_0_iphone15,2
cp34-abi3-macosx_11_0_iphone15,2
cp34-abi3-macosx_10_16_universal2
cp34-abi3-macosx_10_15_universal2
cp34-abi3-macosx_10_14_universal2
cp34-abi3-macosx_10_13_universal2
cp34-abi3-macosx_10_12_universal2
cp34-abi3-macosx_10_11_universal2
cp34-abi3-macosx_10_10_universal2
cp34-abi3-macosx_10_9_universal2
cp34-abi3-macosx_10_8_universal2
cp34-abi3-macosx_10_7_universal2
cp34-abi3-macosx_10_6_universal2
cp34-abi3-macosx_10_5_universal2
cp34-abi3-macosx_10_4_universal2
cp33-abi3-macosx_17_0_iphone15,2
cp33-abi3-macosx_16_0_iphone15,2
cp33-abi3-macosx_15_0_iphone15,2
cp33-abi3-macosx_14_0_iphone15,2
cp33-abi3-macosx_13_0_iphone15,2
cp33-abi3-macosx_12_0_iphone15,2
cp33-abi3-macosx_11_0_iphone15,2
cp33-abi3-macosx_10_16_universal2
cp33-abi3-macosx_10_15_universal2
cp33-abi3-macosx_10_14_universal2
cp33-abi3-macosx_10_13_universal2
cp33-abi3-macosx_10_12_universal2
cp33-abi3-macosx_10_11_universal2
cp33-abi3-macosx_10_10_universal2
cp33-abi3-macosx_10_9_universal2
cp33-abi3-macosx_10_8_universal2
cp33-abi3-macosx_10_7_universal2
cp33-abi3-macosx_10_6_universal2
cp33-abi3-macosx_10_5_universal2
cp33-abi3-macosx_10_4_universal2
cp32-abi3-macosx_17_0_iphone15,2
cp32-abi3-macosx_16_0_iphone15,2
cp32-abi3-macosx_15_0_iphone15,2
cp32-abi3-macosx_14_0_iphone15,2
cp32-abi3-macosx_13_0_iphone15,2
cp32-abi3-macosx_12_0_iphone15,2
cp32-abi3-macosx_11_0_iphone15,2
cp32-abi3-macosx_10_16_universal2
cp32-abi3-macosx_10_15_universal2
cp32-abi3-macosx_10_14_universal2
cp32-abi3-macosx_10_13_universal2
cp32-abi3-macosx_10_12_universal2
cp32-abi3-macosx_10_11_universal2
cp32-abi3-macosx_10_10_universal2
cp32-abi3-macosx_10_9_universal2
cp32-abi3-macosx_10_8_universal2
cp32-abi3-macosx_10_7_universal2
cp32-abi3-macosx_10_6_universal2
cp32-abi3-macosx_10_5_universal2
cp32-abi3-macosx_10_4_universal2
py311-none-macosx_17_0_iphone15,2
py311-none-macosx_16_0_iphone15,2
py311-none-macosx_15_0_iphone15,2
py311-none-macosx_14_0_iphone15,2
py311-none-macosx_13_0_iphone15,2
py311-none-macosx_12_0_iphone15,2
py311-none-macosx_11_0_iphone15,2
py311-none-macosx_10_16_universal2
py311-none-macosx_10_15_universal2
py311-none-macosx_10_14_universal2
py311-none-macosx_10_13_universal2
py311-none-macosx_10_12_universal2
py311-none-macosx_10_11_universal2
py311-none-macosx_10_10_universal2
py311-none-macosx_10_9_universal2
py311-none-macosx_10_8_universal2
py311-none-macosx_10_7_universal2
py311-none-macosx_10_6_universal2
py311-none-macosx_10_5_universal2
py311-none-macosx_10_4_universal2
py3-none-macosx_17_0_iphone15,2
py3-none-macosx_16_0_iphone15,2
py3-none-macosx_15_0_iphone15,2
py3-none-macosx_14_0_iphone15,2
py3-none-macosx_13_0_iphone15,2
py3-none-macosx_12_0_iphone15,2
py3-none-macosx_11_0_iphone15,2
py3-none-macosx_10_16_universal2
py3-none-macosx_10_15_universal2
py3-none-macosx_10_14_universal2
py3-none-macosx_10_13_universal2
py3-none-macosx_10_12_universal2
py3-none-macosx_10_11_universal2
py3-none-macosx_10_10_universal2
py3-none-macosx_10_9_universal2
py3-none-macosx_10_8_universal2
py3-none-macosx_10_7_universal2
py3-none-macosx_10_6_universal2
py3-none-macosx_10_5_universal2
py3-none-macosx_10_4_universal2
py310-none-macosx_17_0_iphone15,2
py310-none-macosx_16_0_iphone15,2
py310-none-macosx_15_0_iphone15,2
py310-none-macosx_14_0_iphone15,2
py310-none-macosx_13_0_iphone15,2
py310-none-macosx_12_0_iphone15,2
py310-none-macosx_11_0_iphone15,2
py310-none-macosx_10_16_universal2
py310-none-macosx_10_15_universal2
py310-none-macosx_10_14_universal2
py310-none-macosx_10_13_universal2
py310-none-macosx_10_12_universal2
py310-none-macosx_10_11_universal2
py310-none-macosx_10_10_universal2
py310-none-macosx_10_9_universal2
py310-none-macosx_10_8_universal2
py310-none-macosx_10_7_universal2
py310-none-macosx_10_6_universal2
py310-none-macosx_10_5_universal2
py310-none-macosx_10_4_universal2
py39-none-macosx_17_0_iphone15,2
py39-none-macosx_16_0_iphone15,2
py39-none-macosx_15_0_iphone15,2
py39-none-macosx_14_0_iphone15,2
py39-none-macosx_13_0_iphone15,2
py39-none-macosx_12_0_iphone15,2
py39-none-macosx_11_0_iphone15,2
py39-none-macosx_10_16_universal2
py39-none-macosx_10_15_universal2
py39-none-macosx_10_14_universal2
py39-none-macosx_10_13_universal2
py39-none-macosx_10_12_universal2
py39-none-macosx_10_11_universal2
py39-none-macosx_10_10_universal2
py39-none-macosx_10_9_universal2
py39-none-macosx_10_8_universal2
py39-none-macosx_10_7_universal2
py39-none-macosx_10_6_universal2
py39-none-macosx_10_5_universal2
py39-none-macosx_10_4_universal2
py38-none-macosx_17_0_iphone15,2
py38-none-macosx_16_0_iphone15,2
py38-none-macosx_15_0_iphone15,2
py38-none-macosx_14_0_iphone15,2
py38-none-macosx_13_0_iphone15,2
py38-none-macosx_12_0_iphone15,2
py38-none-macosx_11_0_iphone15,2
py38-none-macosx_10_16_universal2
py38-none-macosx_10_15_universal2
py38-none-macosx_10_14_universal2
py38-none-macosx_10_13_universal2
py38-none-macosx_10_12_universal2
py38-none-macosx_10_11_universal2
py38-none-macosx_10_10_universal2
py38-none-macosx_10_9_universal2
py38-none-macosx_10_8_universal2
py38-none-macosx_10_7_universal2
py38-none-macosx_10_6_universal2
py38-none-macosx_10_5_universal2
py38-none-macosx_10_4_universal2
py37-none-macosx_17_0_iphone15,2
py37-none-macosx_16_0_iphone15,2
py37-none-macosx_15_0_iphone15,2
py37-none-macosx_14_0_iphone15,2
py37-none-macosx_13_0_iphone15,2
py37-none-macosx_12_0_iphone15,2
py37-none-macosx_11_0_iphone15,2
py37-none-macosx_10_16_universal2
py37-none-macosx_10_15_universal2
py37-none-macosx_10_14_universal2
py37-none-macosx_10_13_universal2
py37-none-macosx_10_12_universal2
py37-none-macosx_10_11_universal2
py37-none-macosx_10_10_universal2
py37-none-macosx_10_9_universal2
py37-none-macosx_10_8_universal2
py37-none-macosx_10_7_universal2
py37-none-macosx_10_6_universal2
py37-none-macosx_10_5_universal2
py37-none-macosx_10_4_universal2
py36-none-macosx_17_0_iphone15,2
py36-none-macosx_16_0_iphone15,2
py36-none-macosx_15_0_iphone15,2
py36-none-macosx_14_0_iphone15,2
py36-none-macosx_13_0_iphone15,2
py36-none-macosx_12_0_iphone15,2
py36-none-macosx_11_0_iphone15,2
py36-none-macosx_10_16_universal2
py36-none-macosx_10_15_universal2
py36-none-macosx_10_14_universal2
py36-none-macosx_10_13_universal2
py36-none-macosx_10_12_universal2
py36-none-macosx_10_11_universal2
py36-none-macosx_10_10_universal2
py36-none-macosx_10_9_universal2
py36-none-macosx_10_8_universal2
py36-none-macosx_10_7_universal2
py36-none-macosx_10_6_universal2
py36-none-macosx_10_5_universal2
py36-none-macosx_10_4_universal2
py35-none-macosx_17_0_iphone15,2
py35-none-macosx_16_0_iphone15,2
py35-none-macosx_15_0_iphone15,2
py35-none-macosx_14_0_iphone15,2
py35-none-macosx_13_0_iphone15,2
py35-none-macosx_12_0_iphone15,2
py35-none-macosx_11_0_iphone15,2
py35-none-macosx_10_16_universal2
py35-none-macosx_10_15_universal2
py35-none-macosx_10_14_universal2
py35-none-macosx_10_13_universal2
py35-none-macosx_10_12_universal2
py35-none-macosx_10_11_universal2
py35-none-macosx_10_10_universal2
py35-none-macosx_10_9_universal2
py35-none-macosx_10_8_universal2
py35-none-macosx_10_7_universal2
py35-none-macosx_10_6_universal2
py35-none-macosx_10_5_universal2
py35-none-macosx_10_4_universal2
py34-none-macosx_17_0_iphone15,2
py34-none-macosx_16_0_iphone15,2
py34-none-macosx_15_0_iphone15,2
py34-none-macosx_14_0_iphone15,2
py34-none-macosx_13_0_iphone15,2
py34-none-macosx_12_0_iphone15,2
py34-none-macosx_11_0_iphone15,2
py34-none-macosx_10_16_universal2
py34-none-macosx_10_15_universal2
py34-none-macosx_10_14_universal2
py34-none-macosx_10_13_universal2
py34-none-macosx_10_12_universal2
py34-none-macosx_10_11_universal2
py34-none-macosx_10_10_universal2
py34-none-macosx_10_9_universal2
py34-none-macosx_10_8_universal2
py34-none-macosx_10_7_universal2
py34-none-macosx_10_6_universal2
py34-none-macosx_10_5_universal2
py34-none-macosx_10_4_universal2
py33-none-macosx_17_0_iphone15,2
py33-none-macosx_16_0_iphone15,2
py33-none-macosx_15_0_iphone15,2
py33-none-macosx_14_0_iphone15,2
py33-none-macosx_13_0_iphone15,2
py33-none-macosx_12_0_iphone15,2
py33-none-macosx_11_0_iphone15,2
py33-none-macosx_10_16_universal2
py33-none-macosx_10_15_universal2
py33-none-macosx_10_14_universal2
py33-none-macosx_10_13_universal2
py33-none-macosx_10_12_universal2
py33-none-macosx_10_11_universal2
py33-none-macosx_10_10_universal2
py33-none-macosx_10_9_universal2
py33-none-macosx_10_8_universal2
py33-none-macosx_10_7_universal2
py33-none-macosx_10_6_universal2
py33-none-macosx_10_5_universal2
py33-none-macosx_10_4_universal2
py32-none-macosx_17_0_iphone15,2
py32-none-macosx_16_0_iphone15,2
py32-none-macosx_15_0_iphone15,2
py32-none-macosx_14_0_iphone15,2
py32-none-macosx_13_0_iphone15,2
py32-none-macosx_12_0_iphone15,2
py32-none-macosx_11_0_iphone15,2
py32-none-macosx_10_16_universal2
py32-none-macosx_10_15_universal2
py32-none-macosx_10_14_universal2
py32-none-macosx_10_13_universal2
py32-none-macosx_10_12_universal2
py32-none-macosx_10_11_universal2
py32-none-macosx_10_10_universal2
py32-none-macosx_10_9_universal2
py32-none-macosx_10_8_universal2
py32-none-macosx_10_7_universal2
py32-none-macosx_10_6_universal2
py32-none-macosx_10_5_universal2
py32-none-macosx_10_4_universal2
py31-none-macosx_17_0_iphone15,2
py31-none-macosx_16_0_iphone15,2
py31-none-macosx_15_0_iphone15,2
py31-none-macosx_14_0_iphone15,2
py31-none-macosx_13_0_iphone15,2
py31-none-macosx_12_0_iphone15,2
py31-none-macosx_11_0_iphone15,2
py31-none-macosx_10_16_universal2
py31-none-macosx_10_15_universal2
py31-none-macosx_10_14_universal2
py31-none-macosx_10_13_universal2
py31-none-macosx_10_12_universal2
py31-none-macosx_10_11_universal2
py31-none-macosx_10_10_universal2
py31-none-macosx_10_9_universal2
py31-none-macosx_10_8_universal2
py31-none-macosx_10_7_universal2
py31-none-macosx_10_6_universal2
py31-none-macosx_10_5_universal2
py31-none-macosx_10_4_universal2
py30-none-macosx_17_0_iphone15,2
py30-none-macosx_16_0_iphone15,2
py30-none-macosx_15_0_iphone15,2
py30-none-macosx_14_0_iphone15,2
py30-none-macosx_13_0_iphone15,2
py30-none-macosx_12_0_iphone15,2
py30-none-macosx_11_0_iphone15,2
py30-none-macosx_10_16_universal2
py30-none-macosx_10_15_universal2
py30-none-macosx_10_14_universal2
py30-none-macosx_10_13_universal2
py30-none-macosx_10_12_universal2
py30-none-macosx_10_11_universal2
py30-none-macosx_10_10_universal2
py30-none-macosx_10_9_universal2
py30-none-macosx_10_8_universal2
py30-none-macosx_10_7_universal2
py30-none-macosx_10_6_universal2
py30-none-macosx_10_5_universal2
py30-none-macosx_10_4_universal2
cp311-none-any
py311-none-any
py3-none-any
py310-none-any
py39-none-any
py38-none-any
py37-none-any
py36-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any |
If you only want the binaries, you'll have to compiler it from here: https://github.com/holzschu/cpython/ For the tags, that looks like the result of |
While this is surprisingly only documented for replacing |
Hi,
|
N.B. PEP 730 – Adding iOS as a supported platform has been accepted. |
Hi @holzschu, would you mind providing some context on how you managed to compile for iOS using maturin? I'm trying to do the same but struggle finding a good starting point. |
Hi @marcpabst,
export PREFIX=...
export OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path)
env SDKROOT="$OSX_SDKROOT" \
PYO3_CROSS_LIB_DIR="$PREFIX/build/lib.darwin-arm64-3.11/" \
CARGO_BUILD_TARGET="aarch64-apple-ios" \
CARGO_TARGET_AARCH64_APPLE_IOS_RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$IOS_SDKROOT -C link-arg=-arch -C link-arg=arm64 -C link-arg=-miphoneos-version-min=14.0 -C link-arg=-L -C link-arg=$PREFIX/build/lib.darwin-arm64-3.11/ -C link-arg=-lpython3.11" \
$PREFIX/Library/bin/maturin build Let me know if this doesn't work for you. |
Thank you! I think I almost got it working with the
but I'm running into this error:
|
Weirdly, the error goes away when compiling in
|
Hi @holzschu, one more question: do you remember if you ended up with an Looking at https://peps.python.org/pep-0730/, there seem to be lots of limitations on iOS, how do you work them in your app? |
At the end of compiling, you will end up with a dynamic library. How it's named is not important. iOS likes to have its dynamic libraries encapsulated in Frameworks, but that's just a matter of moving things around and changing strings in the binary. I have a script to do that systematically: echo "Creating: " ${architecture}/Frameworks/${name}.framework
directory=build/${architecture}/Frameworks/
rm -rf $directory/$framework.framework
mkdir -p $directory
mkdir -p $directory/$framework.framework
libraryFile=build/${architecture}/${library}.cpython-311-darwin.so
cp $libraryFile $directory/$framework.framework/$framework
cp plists/basic_Info.plist $directory/$framework.framework/Info.plist
plutil -replace CFBundleExecutable -string $framework $directory/$framework.framework/Info.plist
plutil -replace CFBundleName -string $framework $directory/$framework.framework/Info.plist
# underscore is not allowed in CFBundleIdentifier:
signature=${framework//_/-}
plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$signature $directory/$framework.framework/Info.plist
# change framework id and libpython:
install_name_tool -change $libpython @rpath/${package}.framework/${package} $directory/$framework.framework/$framework
install_name_tool -id @rpath/$framework.framework/$framework $directory/$framework.framework/$framework
plutil -replace DTPlatformName -string "iphoneos" build/lib.darwin-arm64-3.11/Frameworks/$framework.framework/Info.plist
plutil -replace DTSDKName -string "iphoneos" build/lib.darwin-arm64-3.11/Frameworks/$framework.framework/Info.plist
plutil -replace DTPlatformVersion -string "14.0" build/lib.darwin-arm64-3.11/Frameworks/$framework.framework/Info.plist
plutil -replace MinimumOSVersion -string "14.0" build/lib.darwin-arm64-3.11/Frameworks/$framework.framework/Info.plist The basic idea is that a framework has the following structure: a directory, containing the dynamic library (renamed with no suffix) and an Info.plist file that describes the content of the framework. The
I also edited the code in charge of loading dynamic libraries in Python, so that instead of loading |
Thank you, that's very helpful! I think I'm at a point now where Python checks the right place for the library and loads it - but then immediately fails with This is what I use to build my ( export OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path)
export PYTHONDIR="/Users/marc/btest3/build/btest3/ios/xcode/Support/Python.xcframework/ios-arm64"
export PYO3_CROSS_PYTHON_VERSION=3.12
env SDKROOT="$OSX_SDKROOT" \
PYO3_CROSS_LIB_DIR="$PYTHONDIR" \
CARGO_TARGET_AARCH64_APPLE_IOS_RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$IOS_SDKROOT \
-C link-arg=-arch -C link-arg=arm64 -C link-arg=-miphoneos-version-min=14.0 -C link-arg=-L \
-C link-arg=$PYTHONDIR \
-C link-arg=-lpython3.12" \
maturin build --target aarch64-apple-ios --release which succesfully builds: 🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8
🐍 Not using a specific python interpreter
📡 Using build options features from pyproject.toml
...
Finished release [optimized] target(s) in 0.01s
📦 Built wheel for abi3 Python ≥ 3.8 to /Users/marc/guessing_game/target/wheels/guessing_game-0.1.0-cp38-abi3-ios_23_2_0_arm64.whl |
I made it work!! I think Briefcase is dynamically linking the Pythin intepreter (?), so I had to replace |
Hi,
I'm maintaining a Python distribution that runs on iOS (iPhones and iPads). Some of the packages in that distribution use maturin for building (as one does). Currently, my setup breaks with the following error:
Compiling for iOS is very similar to compiling for OSX; I'd like to expand maturin to add support for iOS.
The text was updated successfully, but these errors were encountered: