From: Jo-Philipp Wich Date: Tue, 25 Sep 2018 13:57:28 +0000 (+0200) Subject: phase1: rework MakeEnv() X-Git-Tag: v1~120 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0045e061ff96d06c22077bde720e8227a9ea45a6;p=buildbot.git phase1: rework MakeEnv() Always set CCC and CCXX since ./staging_dir/host/bin/{gcc,g++} might be symlinked to the ccache wrapper which uses $CCC / $CCXX to refer to the actual compiler, even when we intend to invoke the build without ccache. While being at it, shuffle the code around somewhat to reduce some redundancy and to make the function a bit shorter. Signed-off-by: Jo-Philipp Wich --- diff --git a/phase1/master.cfg b/phase1/master.cfg index 71b3c81..de46c1b 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -334,25 +334,18 @@ def GetNextBuild(builder, requests): return requests[0] def MakeEnv(overrides=None, tryccache=False): - if tryccache: - 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, + 'CCC': Interpolate("%(kw:cc)s", cc=GetCC), + 'CCXX': Interpolate("%(kw:cxx)s", cxx=GetCXX), } + if tryccache: + env['CC'] = Interpolate("%(kw:cwd)s/ccache_cc.sh", cwd=GetCwd) + env['CXX'] = Interpolate("%(kw:cwd)s/ccache_cxx.sh", cwd=GetCwd) + env['CCACHE'] = Interpolate("%(kw:ccache)s", ccache=GetCCache) + else: + env['CC'] = env['CCC'] + env['CXX'] = env['CCXX'] + env['CCACHE'] = '' if overrides is not None: env.update(overrides) return env