diff options
author | Guillaume Tucker <guillaume.tucker@collabora.com> | 2019-07-30 18:53:09 +0100 |
---|---|---|
committer | Guillaume Tucker <guillaume.tucker@collabora.com> | 2019-08-09 10:26:50 +0200 |
commit | 48d83fddbcb122bdfcd29d19c4ed8293e0e8e0eb (patch) | |
tree | 0cc036b1d6ccb3b2a3c6ab41c5ad9bab6d216e64 /kernelci | |
parent | 82cf593dbc2d5ae331068155c2e796687b35f7fd (diff) |
kernelci.build: keep .ccache directory inside the build directory
In order to make ccache more likely to be useful, and to be able to
discard it when necessary, keep the .ccache directory inside the
kernel build directory. That way, it should always cache build data
relevant to the build done in that build directory, and when removing
unused build directories the cache will be removed at the same time.
Also include both the CPU arch and the compiler name in the ccache
directory name, in case a build directory is being reused multiple
times (typically, for manual builds rather than on kernelci.org).
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'kernelci')
-rw-r--r-- | kernelci/build.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernelci/build.py b/kernelci/build.py index 486fefe..c1d5b8b 100644 --- a/kernelci/build.py +++ b/kernelci/build.py @@ -424,8 +424,8 @@ def _run_make(kdir, arch, target=None, jopt=None, silent=True, cc='gcc', if use_ccache: px = cross_compile if cc == 'gcc' and cross_compile else '' args.append('CC="ccache {}{}"'.format(px, cc)) - os.environ.setdefault('CCACHE_DIR', - os.path.join(kdir, '-'.join(['.ccache', arch]))) + ccache_dir = '-'.join(['.ccache', arch, cc]) + os.environ.setdefault('CCACHE_DIR', ccache_dir) elif cc != 'gcc': args.append('CC={}'.format(cc)) |