use ccache for cross compilation #543
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ccache is already used for building hostpython (if
/usr/lib/ccache
is added to thePATH
), but not for any cross compiles.This adds ccache to the
CC
andCXX
env vars for standard and Cython builds, and setsNDK_CCACHE
to the ccache binary for NDK builds. ccache usage is enabled by default, for convenience, but will respect theUSE_CCACHE
var (if set to0
, ccache will not be used).My distribution
hostpython2, jpeg, libffi, openssl, png, sdl2_image, sdl2_mixer, sdl2_ttf, python2, cdecimal, cnotify, eesentinel, enum34, evdev, ipaddress, pil, pyasn1, pycrypto, pytz, pyusb, sdl2, setuptools, six, zope_event, zope_interface, babel, gryphus, idna, pycparser, pyjnius, pyopenssl, sqlalchemy, twisted, zope_component, cffi, kivy, cryptography, aeris2
, which includes some custom recipespyasn1_modules, alembic, characteristic, bitstring, qrcode, service_identity, tenjin, pymysql, phonenumbers, mako
For this distribution, these changes greatly decreased my rebuild time. Tested with deleting
build
anddists
, but leavingpackages
alone to keep the download cache, then rebuilding the entire distribution as well as packaging an APK:time p4a apk --private ../new-private/ --package=com.aerispos.aeris2 --name="AerisPOS" --version=2.2.19 --bootstrap=sdl2 --requirements=aeris2 --dist_name=aeris2-dist --copy-libs --debug
Previous build time was around 30 minutes (estimated, not measured); with ccache the build time is 6m22s.
ccache stats: