[OE-core] [PATCH] ccache: Disable CCACHE_HASHDIR by default

Mike Crowe mac at mcrowe.com
Sat Mar 11 16:54:25 UTC 2017


As of ccache-3.3, ccache will always include the current directory
in the hash when the compiler is configured to output debug
information. The current directory will change every time ${PV}
changes, which will invalidate the cache.

ccache apparently does this so that paths in the debug information will
always be correct. In an OE world these paths may already be missing or
incorrect due to rm_work or the use of a shared sstate cache, so it doesn't
seem as if we're losing much by disabling this feature.

Signed-off-by: Mike Crowe <mac at mcrowe.com>
---
 meta/classes/ccache.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index 76c8828..6b20846 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -2,6 +2,13 @@ CCACHE = "${@bb.utils.which(d.getVar('PATH'), 'ccache') and 'ccache '}"
 export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_HOST_SYS}/${PN}"
 CCACHE_DISABLE[unexport] = "1"
 
+# As of ccache-3.3, ccache will always include the current directory
+# in the hash when the compiler is configured to output debug
+# information. The current directory will change every time ${PV}
+# changes which greatly reduces the utility of ccache. So, let's not
+# consider the current directory to be significant by default.
+export CCACHE_NOHASHDIR ?= "1"
+
 DEPENDS_append_class-target = " ccache-native"
 DEPENDS[vardepvalueexclude] = " ccache-native"
 
-- 
2.1.4




More information about the Openembedded-core mailing list