Skip to content

Feat: iOS app bundle carries the stdlib and the python/ payload - #89

Merged
b-re-w merged 5 commits into
developfrom
work/ios-bundle
Oct 3, 2026
Merged

b-re-w merged 5 commits into
developfrom
work/ios-bundle

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

Closes #59

Feature added (SPEC L-11)

  • Plugin: IosPythonHomeLayout + per-slice stageIosPythonHome_* and stageIosPythonHomeForXcode (reads EFFECTIVE_PLATFORM_NAME/ARCHS, refuses a universal ARCHS naming ONLY_ACTIVE_ARCH); excludes test/, idlelib, tkinter, turtledemo, ensurepip, pycache.
  • tools/xcode/install-python.sh (set -euo pipefail): copies the stdlib to <app>/python-multiplatform-home/ and the payload (PYTHON_PAYLOAD_DIR or PYTHON_PAYLOAD_TASK) to <app>/python/; every extension module becomes Frameworks/<module>.framework with a .fwork placeholder (BeeWare/CPython AppleFrameworkLoader), signed.
  • iOS runtime: before Py_Initialize the bundled prefix is handed to CPython (Py_SetPythonHome); env PYTHONHOME still wins (simulator tests).
  • User-authored files touched minimally (separate commit): iosApp.xcodeproj replaces two broken Python phases with one install-python.sh phase; sample MainViewController gains a DEMO 8 bundle probe line.

Verification (coordinator, after merging develop): plugin 265/0, desktopTest 590/0, ksp artifact 35/0, app 70/0, compose 115/0; androidNative, iosSimulatorArm64 (main+test) compile OK; staging OK and universal ARCHS refused; xcodebuild OK; bundle: os.py + example_py present, 67 .fwork, 0 loose .so, json.framework + Python.framework, codesign --verify --deep --strict OK, 98 MB. On an iPhone 16 / iOS 26.5 simulator with no SIMCTL_CHILD* vars: DEMO 1 runtime | 3.14.7 · sys.platform=ios, proxies installed, and DEMO 8 bundle shows the payload greeting, _json.__file__ = …/PythonDemo.app/python-multiplatform-home/lib/python3.14/lib-dynload/_json.cpython-314-iphonesimulator.fwork, example_py.__file__ = …/PythonDemo.app/python/example_py/init.py, sys.prefix = …/PythonDemo.app/python-multiplatform-home, sys.executable = …/PythonDemo.app/PythonDemo.

b-re-w added 5 commits October 3, 2026 15:11
…le probe line to the sample (#59)

User-authored files, minimal edits flagged in the PR: the pbxproj replaces the two broken
Python phases with one install-python.sh phase; MainViewController gains one DEMO 8 line that
imports a stdlib extension and the payload so the bundle proof is observable.
Resolve SPEC: #77 took L-10, so the iOS bundle entry becomes L-11 (references renumbered).
Fix a nested-comment opener in IosPythonHome.kt's KDoc ('lib-dynload/*.so') that Kotlin
reads as an unclosed comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant