summaryrefslogtreecommitdiff
path: root/morphlib/buildenvironment.py
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2012-12-10 17:55:23 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-12-17 12:08:55 +0000
commitf19efa182d0e53d97e163f980d6e221c55dd9c9b (patch)
tree0989586ca1ee444ceb538fcd1cf24e8eb8577dc9 /morphlib/buildenvironment.py
parentac1cd545050a4aaa61e5b3f1dda5e278ba5e40b1 (diff)
downloadmorph-f19efa182d0e53d97e163f980d6e221c55dd9c9b.tar.gz
Add support for ccache
This is set up so that each individual project repository has its own ccache, all under one defined directory. The top-level ccache directory is added as the setting 'compiler-cache-dir', and defaults to $cachedir/ccache. When a build is performed, this will bind-mount a project's ccache into the /tmp/ccache of the staging-area and set up the environment variables so that ccache will be used (if appropriate executables are installed to /usr/lib/ccache in the staging-area). In addition, this removes code for ccache-remotedir, as it is unrelated to this implementation of ccache. Reviewed-by: Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> Reviewed-by: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
Diffstat (limited to 'morphlib/buildenvironment.py')
-rw-r--r--morphlib/buildenvironment.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/morphlib/buildenvironment.py b/morphlib/buildenvironment.py
index c9c12cc4..d9e3210f 100644
--- a/morphlib/buildenvironment.py
+++ b/morphlib/buildenvironment.py
@@ -88,14 +88,12 @@ class BuildEnvironment():
# FIXME: we should set CCACHE_BASEDIR so any objects that refer to their
# current directory get corrected. This improve the cache hit rate
# env['CCACHE_BASEDIR'] = self.tempdir.dirname
+ env['CCACHE_DIR'] = '/tmp/ccache'
env['CCACHE_EXTRAFILES'] = ':'.join(
f for f in ('/baserock/binutils.meta',
'/baserock/eglibc.meta',
'/baserock/gcc.meta') if os.path.exists(f)
)
- if settings['ccache-remotedir'] != '':
- env['CCACHE_REMOTEDIR'] = settings['ccache-remotedir']
- env['CCACHE_REMOTENLEVELS'] = str(settings['ccache-remotenlevels'])
if not settings['no-distcc']:
env['CCACHE_PREFIX'] = 'distcc'