[buildbot] phase1: set CCACHE_BASEDIR

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 23 05:26:25 PST 2017


jow pushed a commit to buildbot.git, branch master:
https://git.lede-project.org/6dba2ab77da516c740e5d2e4828ff8bc02472656

commit 6dba2ab77da516c740e5d2e4828ff8bc02472656
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Jan 23 14:24:58 2017 +0100

    phase1: set CCACHE_BASEDIR
    
    Add CCACHE_BASEDIR to default environment in order to improve cache hit rate
    for the global shared cache.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 phase1/master.cfg | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index 695973f..632294f 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -238,10 +238,19 @@ def GetCXX(props):
 	else:
 		return "g++"
 
+def GetCwd(props):
+	if props.hasProperty("builddir"):
+		return props["builddir"]
+	elif props.hasProperty("workdir"):
+		return props["workdir"]
+	else:
+		return "/"
+
 def MakeEnv(overrides=None):
 	env = {
 		'CC': WithProperties("%(cc)s", cc=GetCC),
-		'CXX': WithProperties("%(cxx)s", cxx=GetCXX)
+		'CXX': WithProperties("%(cxx)s", cxx=GetCXX),
+		'CCACHE_BASEDIR': WithProperties("%(cwd)s", cwd=GetCwd)
 	}
 	if overrides is not None:
 		env.update(overrides)



More information about the lede-commits mailing list