]> code.ossystems Code Review - openembedded-core.git/commit
ccache.bbclass: Set CCACHE_CONFIGPATH to fix race issues
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 17 Dec 2018 06:30:27 +0000 (14:30 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Jan 2019 11:21:57 +0000 (11:21 +0000)
commit2abbc4d0cd571e82ed6188d3b2d84b4cd6be25e8
tree5cb8ac65c9a4a77f7ba2f5b06996745c254fa73e
parent36cead66fbadd8c3827aec4b67ea124ee3c2ff94
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.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
meta/classes/ccache.bbclass
meta/conf/ccache.conf [new file with mode: 0644]