Russell Keith-Magee added the comment:

Nick: you are correct - these are changes to support iOS as a cross-compilation 
target, so you can run your Python code on an iOS device. Apologies for the 
confusion in nomenclature.

Ned: You're correct that the build needs to be run on an OS/X machine, and 
needs to be done in multiple passes because of the need for multiple SDKs.

I've taken the approach of using Setup.local for two reasons. 

Firstly, iOS requires a "fully embedded" Python, because Apple doesn't approve 
of the use of dynamic loading in apps. Setup.local was the best way I found to 
force modules to be statically linked into the main library.

Secondly, because of the nature of the end-deployment, I imagine it's 
inevitable that serious end-users will want to customise their Python build for 
specific applications. AppStore submission rules prohibit running code that 
wasn't shipped with the app (i.e., Apple won't let you do an end-run around 
their app approval processes), so the set of modules you're actually using will 
be a known quantity. Since a "full" iOS Python build is 34MB or so, much of 
that bulk will be for binary support of modules that you aren't using, 
providing an easily configurable way to prune out unused modules from the built 
product seemed like a useful facility. There's also the issue of providing 
support for the standard library modules (like SSL) that have dependencies that 
can't be easily provided or specified out-of-the-box. 

If there's a better/more palatable approach than using Setup.local, I'm happy 
to look into it.

The libffi code is a direct copy from the current (as of a week or so ago) 
libffi trunk. There have been some bug fixes applied since 3.2.1 was released 
in november that are necessary to support ctypes on ARM64 (but, as I flagged in 
my original comment, introduces bugs for ARMv7). The libffi repo suggests the 
next version will be 4.0, but I have no idea when that will be finalised. I'm 
currently trying to get their release plans confirmed. 

As with OS/X libffi support, the source code needs to be generated, rather than 
just "./configure && make"'d. That said, the libffi_darwin code could be 
re-used, as the x86_64 components are the same for Darwin as the iOS simulator.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23670>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to