Followup fixes for recipe roll
Simplifying some environment madness. Nobody gets to modify default_env.
Always apply it in run.__call__(). Add depot_tools path to PATH in
default_env. Result is simpler but now default_env is applied in many
more places, which should be harmless.
BUG=skia:
Change-Id: I8299d50bde2bc3e2d47568a267d1d962a3fc3d56
Reviewed-on: https://skia-review.googlesource.com/9916
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py
index 6040447..4ee2f8e 100644
--- a/infra/bots/recipe_modules/flavor/gn_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_flavor.py
@@ -124,13 +124,7 @@
ninja = 'ninja.exe' if 'Win' in os else 'ninja'
gn = self.m.vars.skia_dir.join('bin', gn)
- env = self.m.step.get_from_context('env', {})
- env.update(self.m.vars.default_env)
- env['PATH'] = self.m.path.pathsep.join([
- env.get('PATH', '%(PATH)s'),
- str(self.m.bot_update._module.PACKAGE_REPO_ROOT),
- ])
- with self.m.step.context({'cwd': self.m.vars.skia_dir, 'env': env}):
+ with self.m.step.context({'cwd': self.m.vars.skia_dir}):
self._py('fetch-gn', self.m.vars.skia_dir.join('bin', 'fetch-gn'))
self._run('gn gen', [gn, 'gen', self.out_dir, '--args=' + gn_args])
self._run('ninja', [ninja, '-C', self.out_dir])
@@ -149,14 +143,14 @@
def step(self, name, cmd):
app = self.m.vars.skia_out.join(self.m.vars.configuration, cmd[0])
cmd = [app] + cmd[1:]
- env = self.m.step.get_from_context('env') or {}
+ env = self.m.step.get_from_context('env', {})
clang_linux = str(self.m.vars.slave_dir.join('clang_linux'))
extra_config = self.m.vars.builder_cfg.get('extra_config', '')
if 'SAN' in extra_config:
# Sanitized binaries may want to run clang_linux/bin/llvm-symbolizer.
- self.m.vars.default_env['PATH'] = '%%(PATH)s:%s' % clang_linux + '/bin'
+ env['PATH'] = '%%(PATH)s:%s' % clang_linux + '/bin'
elif 'Ubuntu' == self.m.vars.builder_cfg.get('os', ''):
cmd = ['catchsegv'] + cmd