from buildbot.steps.shell import SetPropertyFromCommand
from buildbot.steps.transfer import FileUpload
from buildbot.steps.transfer import FileDownload
+from buildbot.steps.transfer import StringDownload
from buildbot.steps.master import MasterShellCommand
from buildbot.process.properties import Interpolate
from buildbot.process import properties
@properties.renderer
def GetCCache(props):
if props.hasProperty("ccache_command") and "ccache" in props["ccache_command"]:
- return props["ccache_command"] + " "
+ return props["ccache_command"]
else:
return ""
def MakeEnv(overrides=None, tryccache=False):
if tryccache:
- envcc = Interpolate("%(kw:ccache)s%(kw:cc)s", ccache=GetCCache, cc=GetCC)
- envcxx = Interpolate("%(kw:ccache)s%(kw:cxx)s", ccache=GetCCache, cxx=GetCXX)
+ envcc = Interpolate("%(kw:cwd)s/ccache_cc.sh", cwd=GetCwd)
+ envcxx = Interpolate("%(kw:cwd)s/ccache_cxx.sh", cwd=GetCwd)
+ envccache = Interpolate("%(kw:ccache)s", ccache=GetCCache)
+ envccc = Interpolate("%(kw:cc)s", cc=GetCC)
+ envccxx = Interpolate("%(kw:cxx)s", cxx=GetCXX)
else:
envcc = Interpolate("%(kw:cc)s", cc=GetCC)
envcxx = Interpolate("%(kw:cxx)s", cxx=GetCXX)
+ envccache = ""
+ envccc = ""
+ envccxx = ""
env = {
'CC': envcc,
'CXX': envcxx,
+ 'CCACHE': envccache,
+ 'CCC': envccc,
+ 'CCXX': envccxx,
}
if overrides is not None:
env.update(overrides)
want_stdout = False
))
+ factory.addStep(StringDownload(
+ name = "ccachecc",
+ s = '#!/bin/sh\nexec ${CCACHE} ${CCC} "$@"\n',
+ slavedest = "../ccache_cc.sh",
+ mode = 0755,
+ ))
+
+ factory.addStep(StringDownload(
+ name = "ccachecxx",
+ s = '#!/bin/sh\nexec ${CCACHE} ${CCXX} "$@"\n',
+ slavedest = "../ccache_cxx.sh",
+ mode = 0755,
+ ))
+
# prepare tar
factory.addStep(ShellCommand(
name = "dltar",