summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-12-17 14:30:27 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-14 11:35:55 +0000
commite96d0200ca3226a3127934ed29c202797d88e4c2 (patch)
tree963b5d0d5ca73dc3efba1f60faa88964318a8d75 /meta/classes
parent7953d6a8bc4beffea7994d6e57f6a5e000ca1889 (diff)
downloadpoky-e96d0200ca3226a3127934ed29c202797d88e4c2.tar.gz
ccache.bbclass: Set CCACHE_CONFIGPATH to fix race issues
Fixed race issues when parallel build: ccache: error: /path/to/ccache/i586-poky-linux/mmc-utils/ccache.conf: No such file or directory ccache: error: /path/to/ccache/i586-poky-linux/mmc-utils/ccache.conf: No such file or directory This is because we set CCACHE_DIR for earch recipe, and ccache will create a ccache.conf for each CCACHE_DIR when CCACHE_CONFIGPATH is not set, but there might be a race issue in parallel build: ccache gcc file1.c ccache gcc file2.c If the two ccache processes use fopen(path, "w") to create ccache.conf at the same time, the error would happen. Set CCACHE_CONFIGPATH to meta/conf/ccache.conf can fix the problem, and we can add other configs to the file when needed. And also set cache_dir_levels to 1 (default is 2) since each recipe has a cache dir, thus we don't have too many files in one dir. (From OE-Core rev: 2abbc4d0cd571e82ed6188d3b2d84b4cd6be25e8) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/ccache.bbclass2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index fb3fbdf25c..b5457359ca 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -29,6 +29,8 @@ export CCACHE_BASEDIR ?= "${TMPDIR}"
29# Used for sharing cache files after compiler is rebuilt 29# Used for sharing cache files after compiler is rebuilt
30export CCACHE_COMPILERCHECK ?= "%compiler% -dumpspecs" 30export CCACHE_COMPILERCHECK ?= "%compiler% -dumpspecs"
31 31
32export CCACHE_CONFIGPATH ?= "${COREBASE}/meta/conf/ccache.conf"
33
32export CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${MULTIMACH_TARGET_SYS}/${PN}" 34export CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${MULTIMACH_TARGET_SYS}/${PN}"
33 35
34# We need to stop ccache considering the current directory or the 36# We need to stop ccache considering the current directory or the