summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-04-05 13:13:49 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2012-04-05 17:32:02 +0100
commit2386cfa1527524d4a126e811b6013aafd85e317c (patch)
tree4de3ce384e5380626532e5a79c9a66204d045c28 /morph
parent490beb166be0eecb18761c5f798245ab66bf3470 (diff)
downloadmorph-2386cfa1527524d4a126e811b6013aafd85e317c.tar.gz
morph: add options for ccache object downloading
--ccache-remotedir specifies a base URI for downloading objects from --ccache-remotenlevels specifies how many components to split the object name with, so if --ccache-remotenlevels=2 then object FEEDBEEFCAFEF00D.o will be searched for at $URI/F/E/EDBEEFCAFEF00D.o --ccache-remotenlevels should work most of the time with the default value. It is only needed if the ccache that populates the remote object cache uses a non-default CCACHE_NLEVELS.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph15
1 files changed, 15 insertions, 0 deletions
diff --git a/morph b/morph
index 13a67348..29e66877 100755
--- a/morph
+++ b/morph
@@ -37,6 +37,8 @@ defaults = {
'max-jobs': morphlib.util.make_concurrency(),
'prefix': '/usr',
'toolchain-target': '%s-baserock-linux-gnu' % os.uname()[4],
+ 'ccache-remotedir': '',
+ 'ccache-remotenlevels': 2,
}
@@ -79,6 +81,16 @@ class Morph(cliapp.Application):
metavar='DIR',
default=os.environ.get('TMPDIR'))
self.settings.boolean(['no-ccache'], 'do not use ccache')
+ self.settings.string(['ccache-remotedir'],
+ 'allow ccache to download objects from REMOTEDIR '
+ 'if they are not cached locally',
+ metavar='REMOTEDIR',
+ default=defaults['ccache-remotedir'])
+ self.settings.integer(['ccache-remotenlevels'],
+ 'assume ccache directory objects are split into '
+ 'NLEVELS levels of subdirectories',
+ metavar='NLEVELS',
+ default=defaults['ccache-remotenlevels'])
self.settings.boolean(['no-distcc'], 'do not use distcc')
self.settings.integer(['max-jobs'],
'run at most N parallel jobs with make (default '
@@ -699,6 +711,9 @@ class Morph(cliapp.Application):
'/baserock/eglibc.meta',
'/baserock/gcc.meta') if os.path.exists(f)
)
+ if self.settings['ccache-remotedir'] != '':
+ env['CCACHE_REMOTEDIR'] = self.settings['ccache-remotedir']
+ env['CCACHE_REMOTENLEVELS'] = self.settings['ccache-remotenlevels']
if not self.settings['no-distcc']:
env['CCACHE_PREFIX'] = 'distcc'