Repository navigation
[depends][target][python] build as a real iOS platform - #28808
Conversation
|
Decision: APPROVE Issues: none Evidence:
Review Details
|
|
Don't want to make you rework the whole thing but this seems to be a bit too much hacky... I think we could reduce a bit the python patch. first in tools/depends/target/config.site.in we don't enforce the host if it's provide by package in tools/depends/target/python3/Makefile we force the host to match ios triplet then the python patch is much more smaller something like only to support the static compilation that should be upstream properly: remove the --enable-framework and avoid duplicate -mios-version-min : |
was hesitant to touch that, but if everyone is ok with it, I'll change happily. Yeah, once we can pass proper host, the patch would be smaller. |
Maybe to clean for v23 as the impact is much more broader @garbear |
|
We need a policy decision on this. It's correct, true? Correctness is required. It only affects iOS, true? Fallout is minimized. It's an insufficient improvement, true? Insufficiency isn't a blocker for B2. The risk of this patch, weighted against the improvement it offers, makes the risk worth it, right? |
Seems so
Yes
Sorry, not sure I understand the meaning of sufficiency in this case
I'd say so |
|
@kambala-decapitator this break the iOS simulator 😢 |
|
@kambala-decapitator cpython upstream: |
|
@clementperon thanks! I wasn't really interested in upstreaming those :) |
Description
This change builds Python as a real iOS platform instead of just Darwin-like:
sys.platformreportsiosinstead ofdarwinplatform.platform()returnsiPadOS-15.8.8-iPad5,4-arm64-64bitinstead ofmacOS-15.8.8-iPad5,4-64bitfor an iPad running iOS 15As a positive side effect,
Pycryptodomelibrary (coming fromscript.module.pycryptodome) starts working on iOS. Previously it failed at loading native binary libs (it uses custom loading logic unlike PIL for example) withThe new patch does the following:
host/host_aliaswhich we set asaarch64-apple-darwinand overriding those isn't possible because values inconfig.sitehave the highest priority.IPHONEOS_DEPLOYMENT_TARGETfrom environment. By default python is trying to infer the deployment target fromhost(which isn't possible in our case) and sets 13.0 as a fallback (the officially supported minimum iOS version). But we target 12.0 currently./usr/lib/libobjc.dylib. This happens on iOS 12 (and possibly 13 as well) due to the following python logic: try to read from disk from standard system locations (this always fails due to app sandboxing) or obtain lib path from dyld cache if possible (respective function_dyld_shared_cache_contains_pathis available only on iOS >= 14). But a simple test showed that while you can'tstator check existence of the library file at/usr/lib(sandboxing),dlopenstill succeeds in loading such a library.Motivation and context
Preparation for TestFlight / AppStore. When Python detects that it was built for iOS (actually for Apple non-macOS if you look at the code), it enables AppleFrameworkLoader that can load binary libs from custom locations (for AppStore it must be
<app bundle>/Frameworks). It requires proper packaging though and will be done in a following PR.How has this been tested?
local test on iOS 12, 15 and 26 devices
What is the effect on users?
addons that rely on
script.module.pycryptodomecan be used on iOS nowTypes of change
Checklist: