Add the Android build factory by xdegaye · Pull Request #26 · python/buildmaster-config
The Python test suite succeeds when run with buildbot strenuous settings with all the Android architectures on API 24: x86, x86_64, armv7 and arm64.
This PR proposes to update master.cfg to run buildbots for Android. The Android build system is implemented at issue bpo-30386 and PR 1629, it adds the Android/ directory and the configure-android script to the root of the source directory without modifying any other file. The build system can be installed, upgraded (i.e. the SDK and NDK) and run remotely, through ssh for example.
The Android emulator is actually qemu, so the test suites for x86 and x86_64 last about the same time as the test suite run natively when the processor of the build system is of the x86 family. The test suites for the arm architectures last much longer: about 8 hours for arm64 and 10 hours for armv7 on a four years old laptop when the test suite is run with -u all -j1. Since none of the changes to Python that have been made for Android is specific to armv7 or arm64, maybe their test suite could be run just weekly.
The buildbot.sh script simulates the operations executed by a buildbot worker (except for the git step) and explains the changes to master.cfg proposed here. Its content is listed here:
#! /bin/bash
# Run the commands triggered by a Python buildbot master.
# makesetup step
PYTHON_DEVPT_VERSION=3.7 \
WITH_LIBRARIES=libffi,ncurses,openssl,readline,sqlite \
EMULATOR_CMD_LINE_OPTIONS="-use-system-libs -no-window" \
ANDROID_API=24 \
ANDROID_ARCH=x86_64 \
Android/makesetup --with-pydebug > makesetup.log 2>&1
echo "makesetup step done with exit status: $?"
# compile step
make all > compile.log 2>&1
echo "compile step done with exit status: $?"
# pythoninfo step
make pythoninfo > pythoninfo.log 2>&1
echo "pythoninfo step done with exit status: $?"
# test step
make buildbottest TESTOPTS=-j2 TESTPYTHONOPTS= TESTTIMEOUT=900 > test.log 2>&1
echo "test step done with exit status: $?"
# clean step
make distclean > clean.log 2>&1
echo "clean step done with exit status: $?"
Running this script on x86_64 gives the following results (the corresponding five log files are attached in the next comment) when it is run the second time, on the first run the native python and the external libraries are built and compile.log contains a lot more lines:
$ /path/to/buildbot.sh
makesetup step done with exit status: 0
compile step done with exit status: 0
pythoninfo step done with exit status: 0
test step done with exit status: 0
clean step done with exit status: 0