[oe-commits] [openembedded-core] 06/18: ccache.bbclass: Set CCACHE_CONFIGPATH to fix race issues

git at git.openembedded.org git at git.openembedded.org
Fri Jan 11 13:23:01 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 574feae7ebb46bc3ab2573403ce7172d337b825d
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Mon Dec 17 14:30:27 2018 +0800

    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 at windriver.com>
---
 meta/classes/ccache.bbclass | 2 ++
 meta/conf/ccache.conf       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index fb3fbdf..b545735 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -29,6 +29,8 @@ export CCACHE_BASEDIR ?= "${TMPDIR}"
 # Used for sharing cache files after compiler is rebuilt
 export CCACHE_COMPILERCHECK ?= "%compiler% -dumpspecs"
 
+export CCACHE_CONFIGPATH ?= "${COREBASE}/meta/conf/ccache.conf"
+
 export CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${MULTIMACH_TARGET_SYS}/${PN}"
 
 # We need to stop ccache considering the current directory or the
diff --git a/meta/conf/ccache.conf b/meta/conf/ccache.conf
new file mode 100644
index 0000000..931012d
--- /dev/null
+++ b/meta/conf/ccache.conf
@@ -0,0 +1,2 @@
+max_size = 0
+cache_dir_levels = 1

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list