-
Notifications
You must be signed in to change notification settings - Fork 192
Add iOS builds #281
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
base: master
Are you sure you want to change the base?
Add iOS builds #281
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,49 @@ jobs: | |
with: | ||
path: ./wheelhouse/*.whl | ||
retention-days: 7 | ||
|
||
build_ios: | ||
name: Build wheels for iOS | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4.2.2 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5.5.0 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install -U pip | ||
# Use main branch until iOS support is released. | ||
# python -m pip install cibuildwheel==3.0.0 | ||
python -m pip install git+https://github.com/pypa/cibuildwheel.git | ||
|
||
- name: Build wheels | ||
run: python -m cibuildwheel | ||
env: | ||
IPHONEOS_DEPLOYMENT_TARGET: "23.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this one for, and why 23.0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. My other project depend on newer iOS SDK versions but I guess pymunk can down much lower than that. I think the minimum supported version in PEP730 is 12.0. |
||
CIBW_PLATFORM: ios | ||
CIBW_ARCHS: auto | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BEFORE_BUILD_IOS: | | ||
# download wheel and pretend that it's compatible with the current platform settings | ||
curl https://files.pythonhosted.org/packages/8b/f1/672d303ddf17c24fc83afd712316fda78dc6fce1cd53011b839483e1ecc8/cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl -L -o cffi-1.17.1-py3-none-any.whl && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So if cffi also build a ios wheel, then this hack would not be needed, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not quite - BeeWare actually already provides iOS wheels (which are necessary to run Pymunk because there is also a runtime dependency), but this is just for building the wheel. Here, cibuildwheel actually tries to install the iOS wheel, but we want the macOS wheel. The proper solution is for cibuildwheel to install host platform wheels for the build step instead of target platform wheel. |
||
pip install cffi-1.17.1-py3-none-any.whl && \ | ||
# install the rest of the dependencies | ||
python -m pip install setuptools wheel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like these are also in CIBW_BEFORE_BUILD just below? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, true! It was part of a matrix before, but I've moved it to an iOS only job so we really need |
||
CIBW_BEFORE_BUILD: | ||
python -m pip install setuptools wheel cffi | ||
CIBW_XBUILD_TOOLS : "curl pkg-config tar" | ||
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
with: | ||
name: cibw-wheels-ios-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
retention-days: 7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can set
PYMUNK_BUILD_SLIM: 1
here, just like done on wasm/Pypodide. It will exclude the examples from the wheel which if I understand it correctly are not useful anyway, or are they?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, you're right!