Skip to content

Plugin: consumer iOS wiring (Python.xcframework + stdlib staging) (#90) - #320

Merged
b-re-w merged 1 commit into
developfrom
feat/plugin-ios-consumer
Oct 25, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/plugin-ios-consumer

Conversation

@b-re-w

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

Copy link
Copy Markdown
Member

Closes #90 (part 1: plugin and consumer fixture. Switching sample/ and removing the library-side duplicates is a follow-up PR, as the leader allowed.)

Approved design, DSL (A):

  • On a module with Kotlin/Native iOS targets only, the plugin registers:
    • downloadPython_ios: the pinned iOS support archive, written only to the consumer's build/python-standalone/. Its SHA-256 is baked into the plugin from python-checksums.properties (ios-3.15.0-pythonorg). A mismatch fails the build: a bad cached file is deleted and re-downloaded once, and the second copy must verify. There is no sigstore check in the consumer path; the pinned hash is the trust anchor.
    • preparePythonXcframework: a Sync into build/xcode-frameworks. It adds -framework Python -F to every iOS framework binary and makes the link tasks depend on it.
    • stageIosPythonHome_, stageIosPythonHome, stageIosPythonHomeForXcode: the same names and stdout contract as the library's.
    • installPythonXcodeScript: copies install-python.sh with :stageIosPythonHomeForXcode as its default task.
  • pythonBindings { ios { linkPythonFramework.set(false) } } turns off the linker options and the link dependency. I added the ios(Action) block function after the fixture showed that the block did not compile without it. IosConsumerWiringTest covers it.

Evidence (python-multiplatform-gradle-plugin/fixtures/ios-consumer, plugin only):

  • Plugin tests: 340/340. Artifact fixture desktopTest and the library's iOS compile pass.
  • linkDebugFrameworkIosSimulatorArm64 passes. With linkPythonFramework.set(false) the link fails with undefined _Py* symbols (mutant). The archive and xcframework land under the fixture's build/.
  • xcodebuild of the simulator app succeeds. The bundle contains python-multiplatform-home/lib and python/probe_payload.py.
  • On the simulator: IOS_CONSUMER_PROBE stdlib=ok ext=ok payload=ok (json, _json via .fwork, probe_payload).

Found on the way: the KSP processor emits an unresolved reference for a root-package function. That is #319; the fixture uses a package.

…ework and stdlib staging (#90)

On a module with Kotlin/Native iOS targets the plugin registers downloadPython_ios (the pinned iOS
support archive, into the consumer's build/ only, verified against a SHA-256 baked in from
python-checksums.properties; a mismatch fails the build), preparePythonXcframework (Sync into
build/xcode-frameworks plus -framework Python -F<slice> on every iOS framework binary and the link
dependency; pythonBindings { ios { linkPythonFramework.set(false) } } turns it off),
stageIosPythonHome_<slice> / stageIosPythonHome / stageIosPythonHomeForXcode (the library's names and
stdout contract), and installPythonXcodeScript (install-python.sh with the consumer's task baked in).
fixtures/ios-consumer builds a simulator app from the plugin alone and probes stdlib, an extension
module and the payload from the bundle.
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