phase2: set CCACHE_BASEDIR
authorJo-Philipp Wich <jo@mein.io>
Mon, 23 Jan 2017 13:25:38 +0000 (14:25 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 23 Jan 2017 13:26:07 +0000 (14:26 +0100)
Add CCACHE_BASEDIR to make environment in order to improve cache hit rate for
the global shared cache.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase2/master.cfg

index d6d2e224edd6f3387a42fe2e2b09f2eae31d3f54..bff0b18e2d0f9ad9bb14127a73b30febadaa2114 100644 (file)
@@ -198,6 +198,14 @@ def GetNumJobs(props):
        else:
                return 1
 
+def GetCwd(props):
+       if props.hasProperty("builddir"):
+               return props["builddir"]
+       elif props.hasProperty("workdir"):
+               return props["workdir"]
+       else:
+               return "/"
+
 
 c['builders'] = []
 
@@ -314,7 +322,8 @@ for arch in arches:
                name = "compile",
                description = "Building packages",
                workdir = "build/sdk",
-               command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_SIGNED_PACKAGES=y", "CONFIG_AUTOREMOVE=y"]))
+               command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_SIGNED_PACKAGES=y", "CONFIG_AUTOREMOVE=y"],
+               env = {'CCACHE_BASEDIR': WithProperties("%(cwd)s", cwd=GetCwd)}))
 
        factory.addStep(ShellCommand(
                name = "mkfeedsconf",