gpt4 book ai didi

caching - 清除 ccache 或使用多个 ccache 目录的原因

转载 作者:行者123 更新时间:2023-12-01 22:24:29 25 4
gpt4 key购买 nike

使用 CCACHE 时使用多个缓存目录或完全清除缓存的实际原因是什么?

Buildroot BR2_CCACHE 配置选项的帮助说明如下:

Note that Buildroot does not try to invalidate the cache contents when the compiler changes in an incompatible way. Therefore, if you make a change to the compiler version and/or configuration, you are responsible for purging the ccache cache by removing the $HOME/.buildroot-ccache directory.

如果我理解正确的话,different compiler builds are recognized by CCACHE缓存是在每个编译器的基础上完成的。那么,描述所指的是那些情况呢?

此外,一些消息来源似乎建议应定期清除缓存。 Others point out that cache is cleaned up automatically when it reaches the "max cache size" threshold .

显然,如果缓存的数据已损坏,那么您需要采取一些措施。还有其他原因需要清除缓存吗?保留单个缓存难道没有意义吗?

最佳答案

主要原因是 buildroot 将 CCACHE_COMPILERCHECK 变量设置为“none”。请参阅ccache.mk in Buildroot .

Buildroot 这样做有充分的理由:每次他们重建相同的编译器版本(比如 gcc 4.8.0)时,所有 cca​​che 结果都会被丢弃,即使它们仍然有效。此外,工具链的另一部分可能会发生变化。这也会影响缓存的文件,但不会通过检查编译器版本是否更改来检测到。将来,可能会进行广泛的检查,涵盖工具链的所有必要部分will be used 。目前看来还不是这样。

显然,这不是最佳选择:理想情况下,当您将编译器版本从 4.8 更改为 4.9 时,ccache 结果将自动清除。现在,您必须手动执行此操作。

关于caching - 清除 ccache 或使用多个 ccache 目录的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27906820/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com