且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用ccache加快aosp的编译速度?

更新时间:2023-01-31 09:00:52

我们不再提供预构建的缓存.

We no longer provide a ccache prebuilt.

我们的年龄较大,并且遇到了许多导致无法复制的问题 结果和其他故障.较新的ccache版本可能会解决其中一些问题 问题,但是在我们的大型构建服务器上,我们没有看到 使用ccache可显着提高性能-您最终需要非常 良好的本地性和/或超大型缓存(如果您要构建许多不同的缓存) 配置.

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?

因此,如果您仍然想使用ccache,请继续设置USE_CCACHE,但还要进行设置 CCACHE_EXEC环境变量指向您的ccache可执行文件的路径.

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