[Python-ideas] Adding iOS/Android support to Python

Ned Deily nad at acm.org
Sun Oct 26 01:52:51 CEST 2014


In article <AF04D1E2-058D-4322-91C7-E544E837A1D7 at yahoo.com>,
 Andrew Barnert 
 <abarnert at yahoo.com.dmarc.invalid> wrote:
> On Oct 24, 2014, at 19:20, Russell Keith-Magee 
> <russell at keith-magee.com> wrote:
> > Given three independent platform-specific build directories, it's 
> > relatively easy to construct a "fat" framework, but it isn't clear to me 
> > how that would fit into Python's build system. I can see that the build 
> > system has support for "universal" builds, which looks like an artefact of 
> > the OS X PPC->i386 conversion, but the build approach appears to be 
> > different to that required for iOS.
> 
> It's still perfectly possible to build Python universal on OS X. In fact, 
> both the python.org builds and Apple's pre-installed builds are fat 
> i386/x86_64.
> 
> iOS does put some limitations on things, especially when building shared 
> libs, but if you need to fall back to building each target separately and 
> lipo'ing them together manually, I'm pretty sure there are a few third-party 
> libs that already use that workaround. Didn't PyObjC used to build that way?

I have no personal experience with iOS builds but I *think* the 
complexity of multi-arch builds is handled by the Apple-supplied 
compiler tools in the same way for iOS as is done for OS X builds.  I 
assume that, like for OS X builds, the compiler driver handles the 
multiple builds and lipos automatically under the covers based on the 
requested archs, the SDK, and platform tools in use.  As Andrew notes, 
we have long fully supported SDK builds and all of the universal archs 
for OS X (again using Apple's compiler chain distributed via Xcode 
and/or the Command Line Tools).  I wouldn't expect that to be a big 
problem to adapt for iOS.  (Cross building on platforms other than OS X 
is another matter.)

The main issue, as always, is getting buy-in to "standardize" support 
for these platforms and all of the issues of long-term maintenance.  
Applying a set of changes is just the first step.  We need to have 
subject experts for code and documentation.  We'd need to have buildbots 
to give some assurance that we aren't breaking things.   We need to have 
people willing to test pre-releases.  All these things are doable and 
probably desirable.  But they don't happen automatically.  The changes 
that have already been added to the Python build system to support 
various kinds of cross-builds are today largely undocumented, 
unsupported by python-dev, and untested by our buildbots.  We need to 
solve these problems for them as well before we end up with more bitrot.

-- 
 Ned Deily,
 nad at acm.org



More information about the Python-ideas mailing list