[Python-Dev] Support of the Android platform

Xavier de Gaye xdegaye at gmail.com
Thu Dec 14 04:26:19 EST 2017


On 12/13/2017 10:56 PM, Victor Stinner wrote:
 > I looked at your scripts to build Android but I failed to use them.

You failed because you did not read the README and tried to improvise. I will change the documentation and the build process to make it simpler for those that do not have the time to RTFM :-) I have 
documented the correct steps in the PR especially for you (they are just a summary of what is in the README) after you reported that failure. So you can follow these steps any time now and use 
correctly the build system and report the results here. This would be only fair, I think.

BTW You keep saying they are scripts when the build is actually driven by Makefiles (with the '.mk' extension).


 > Anyway, I'm not sure why these scripts have to be part of the CPython
 > git repository.
 >
 > Technically, is there a reason to put it aside the source code and
 > Unix build scripts (configure/Makefile/setup)?
 > Your https://github.com/python/cpython/pull/1629 only adds new files
 > without touching existing files.
 >
 > I suggest to create new Git project. It may be in the python
 > organization, or you may start with your GitHub account.

The 'Mac' build system has its own subdirectory in the source tree and it makes sense as it is the reference build system for this platform. I do not see why this should be different for Android.


 > Cross-compilation is hard, and I'm not sure that it's possible to
 > build a single recipe for all Android API versions, all configuration,
 > any set of libraries, etc. For Android, it seems like each developer
 > might want a subtle different configuration which might not be easy to
 > support.

You are mistaken, this proposal does not suggest that we are going to support "all Android API versions, all configuration, any set of libraries, etc.", quite the opposite actually.

The proposal is an Android build system for a specific API, a set of architectures using the NDK r14 toolchain and a set of optional external libraries. The build system enforces the use of NDK r14 
for example (as you have painfuly experienced). Python is tested on emulators so that there is no interference with vendor specific additions found on the Android devices or with installed PlayStore 
applications.


 > Having a separated Git project would allow people to contribute more
 > easily, experiment their fork, etc.
 >
 > What do you think?

Certainly not. We, core-devs, are very happy that no one is experimenting with our build system, it is complex enough as it is. The same goes for this Android build system.

Your suggestion seems to be driven by the failure you have experienced with this new build system and the fact that a user is also reporting a failure.  The origin of this other failure is unclear 
because I cannot reproduce it even though all the components used for the build are well defined and identical for everyone: the NDK includes the clang compiler, the libraries and the headers, the 
external libraries are downloaded by the build system, all the users use identical tools (same versions) and the same source code and the only difference may be with some utility tools such as sed, 
awk, etc...

This is a bad start for this proposal and it would have been fair to inform me that you were working in irc collaboration with this other user in testing the build system. On the other hand, these 
problems may have some positive consequences since it allows us to be aware of the fact that the bpo audience may change if we support Android and that this may be a problem. Android attracts all kind 
of developers that do not have the average expertise of unix developers and more importantly that do not have the same motivations and the same etiquette. I am now concerned by the fact that the 
quality of the bug reports on bpo may dramatically decrease if we adopt this proposal.

Xavier


More information about the Python-Dev mailing list