summaryrefslogtreecommitdiff
path: root/morphlib/app.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/app.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/app.py')
-rwxr-xr-xmorphlib/app.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/morphlib/app.py b/morphlib/app.py
index d154f8b9..a13d26a1 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -43,8 +43,6 @@ defaults = {
'max-jobs': morphlib.util.make_concurrency(),
'prefix': '/usr',
'toolchain-target': '%s-baserock-linux-gnu' % os.uname()[4],
- 'ccache-remotedir': '',
- 'ccache-remotenlevels': 2,
'build-ref-prefix': 'baserock/builds'
}
@@ -61,6 +59,11 @@ class Morph(cliapp.Application):
'cache git repositories and build results in DIR',
metavar='DIR',
default=defaults['cachedir'])
+ self.settings.string(['compiler-cache-dir'],
+ 'cache compiled objects in CCDIR/REPO_NAME',
+ metavar='CCDIR',
+ default=os.path.join(self.settings['cachedir'],
+ 'ccache'))
self.settings.string(['build-ref-prefix'],
'Prefix to use for temporary build refs',
metavar='PREFIX',
@@ -109,18 +112,6 @@ class Morph(cliapp.Application):
'DANGEROUS and will install stuff on your '
'system',
group=group_build)
- self.settings.string(['ccache-remotedir'],
- 'allow ccache to download objects from REMOTEDIR '
- 'if they are not cached locally',
- metavar='REMOTEDIR',
- default=defaults['ccache-remotedir'],
- group=group_build)
- self.settings.integer(['ccache-remotenlevels'],
- 'assume ccache directory objects are split into '
- 'NLEVELS levels of subdirectories',
- metavar='NLEVELS',
- default=defaults['ccache-remotenlevels'],
- group=group_build)
self.settings.boolean(['keep-path'],
'do not touch the PATH environment variable',
group=group_build)