android-sourceccache

How to use ccache to speed up compiling of aosp?


I found the ccache aosp repo here https://android.googlesource.com/toolchain/ccache/, but I have no idea how to use ccache on aosp v10, the official aosp site doesn't have any info abouut ccache anymore, only multiple builds. Does ccache still work with recent versions of aosp ?


Solution

  • We no longer provide a ccache prebuilt.

    Ours was old, and had a number of issues that triggered non-reproducible results and other failures. Newer ccache versions may fix some of those issues, but at the large scale of our build servers, we weren't seeing significant performance gains from using ccache -- you end up needing very good locality and/or very large caches if you're building many different configurations.

    Local no-change full rebuilds were showing better results, but why not just use incremental builds at that point?

    So if you still want to use ccache, continue setting USE_CCACHE, but also set the CCACHE_EXEC environment variable to the path to your ccache executable.

    https://cs.android.com/android/platform/superproject/+/android10-release:build/make/core/ccache.mk;l=17