aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules
diff options
context:
space:
mode:
authorGravatar borenet <borenet@chromium.org>2016-08-05 05:18:05 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-05 05:18:06 -0700
commitd460a3c256d9bd4a9f4df49b065f887ec35914c1 (patch)
tree6ba244bde22eacd7d066a2ecb2b7f47faa8ded1d /infra/bots/recipe_modules
parentac09554dce518e9d4496771f648f3ae17eca857c (diff)
[recipes] Remove build environment vars from default_env
Diffstat (limited to 'infra/bots/recipe_modules')
-rw-r--r--infra/bots/recipe_modules/flavor/android_flavor.py9
-rw-r--r--infra/bots/recipe_modules/flavor/api.py4
-rw-r--r--infra/bots/recipe_modules/flavor/cmake_flavor.py4
-rw-r--r--infra/bots/recipe_modules/flavor/default_flavor.py16
-rw-r--r--infra/bots/recipe_modules/flavor/gn_flavor.py10
-rw-r--r--infra/bots/recipe_modules/flavor/ios_flavor.py4
-rw-r--r--infra/bots/recipe_modules/flavor/pdfium_flavor.py15
-rw-r--r--infra/bots/recipe_modules/flavor/xsan_flavor.py4
-rw-r--r--infra/bots/recipe_modules/vars/api.py4
9 files changed, 38 insertions, 32 deletions
diff --git a/infra/bots/recipe_modules/flavor/android_flavor.py b/infra/bots/recipe_modules/flavor/android_flavor.py
index 35e0b35b0b..474ec81b69 100644
--- a/infra/bots/recipe_modules/flavor/android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/android_flavor.py
@@ -79,7 +79,7 @@ class AndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
infra_step=True).stdout.rstrip()
except self.m.step.StepFailure:
path_to_adb = self.m.path.join(self._android_sdk_root,
- 'platform-tools', 'adb')
+ 'platform-tools', 'adb')
self._adb = _ADBWrapper(
self.m, path_to_adb, self.serial_args, self)
self._default_env = {'ANDROID_SDK_ROOT': self._android_sdk_root,
@@ -102,9 +102,10 @@ class AndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
return self.m.run(self.m.step, name=name, cmd=args + cmd,
env=env, **kwargs)
- def compile(self, target):
+ def compile(self, target, **kwargs):
"""Build the given target."""
- env = dict(self._default_env)
+ env = kwargs.pop('env', {})
+ env.update(dict(self._default_env))
ccache = self.m.run.ccache()
if ccache:
env['ANDROID_MAKE_CCACHE'] = ccache
@@ -117,7 +118,7 @@ class AndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
if 'Vulkan' in self.m.vars.builder_name:
cmd.append('--vulkan')
self.m.run(self.m.step, 'build %s' % target, cmd=cmd,
- env=env, cwd=self.m.path['checkout'])
+ env=env, cwd=self.m.path['checkout'], **kwargs)
def device_path_join(self, *args):
"""Like os.path.join(), but for paths on a connected Android device."""
diff --git a/infra/bots/recipe_modules/flavor/api.py b/infra/bots/recipe_modules/flavor/api.py
index 84bc899909..62730b80dd 100644
--- a/infra/bots/recipe_modules/flavor/api.py
+++ b/infra/bots/recipe_modules/flavor/api.py
@@ -89,8 +89,8 @@ class SkiaFlavorApi(recipe_api.RecipeApi):
def step(self, name, cmd, **kwargs):
return self._f.step(name, cmd, **kwargs)
- def compile(self, target):
- return self._f.compile(target)
+ def compile(self, target, **kwargs):
+ return self._f.compile(target, **kwargs)
def copy_extra_build_products(self, swarming_out_dir):
return self._f.copy_extra_build_products(swarming_out_dir)
diff --git a/infra/bots/recipe_modules/flavor/cmake_flavor.py b/infra/bots/recipe_modules/flavor/cmake_flavor.py
index 8b254eceb7..5a127dff52 100644
--- a/infra/bots/recipe_modules/flavor/cmake_flavor.py
+++ b/infra/bots/recipe_modules/flavor/cmake_flavor.py
@@ -7,8 +7,8 @@ import default_flavor
"""CMake flavor utils, used for building Skia with CMake."""
class CMakeFlavorUtils(default_flavor.DefaultFlavorUtils):
- def compile(self, target):
+ def compile(self, target, **kwargs):
"""Build Skia with CMake. Ignores `target`."""
cmake_build = self.m.vars.skia_dir.join('cmake', 'cmake_build')
self.m.run(self.m.step, 'cmake_build', cmd=[cmake_build],
- cwd=self.m.path['checkout'])
+ cwd=self.m.path['checkout'], **kwargs)
diff --git a/infra/bots/recipe_modules/flavor/default_flavor.py b/infra/bots/recipe_modules/flavor/default_flavor.py
index 4cdbaaa671..f1837c2fba 100644
--- a/infra/bots/recipe_modules/flavor/default_flavor.py
+++ b/infra/bots/recipe_modules/flavor/default_flavor.py
@@ -111,7 +111,7 @@ class DefaultFlavorUtils(object):
'--depot_tools_parent_dir',
self._win_toolchain_dir])
- def build_command_buffer(self):
+ def build_command_buffer(self, **kwargs):
"""Build command_buffer."""
script = self.m.vars.skia_dir.join('tools', 'build_command_buffer.py')
self.m.run(
@@ -120,13 +120,15 @@ class DefaultFlavorUtils(object):
args=['--chrome-dir', self.m.vars.checkout_root,
'--output-dir', self.out_dir,
'--chrome-build-type', self.m.vars.configuration,
- '--no-sync'])
+ '--no-sync'],
+ **kwargs)
- def compile(self, target):
+ def compile(self, target, **kwargs):
"""Build the given target."""
+ env = kwargs.pop('env', {})
# The CHROME_PATH environment variable is needed for builders that use
# toolchains downloaded by Chrome.
- env = {'CHROME_PATH': self.chrome_path}
+ env['CHROME_PATH'] = self.chrome_path
if self.m.platform.is_win:
make_cmd = ['python', 'make.py']
self.m.run.run_once(self.bootstrap_win_toolchain)
@@ -137,16 +139,16 @@ class DefaultFlavorUtils(object):
cmd = make_cmd + [target]
try:
self.m.run(self.m.step, 'build %s' % target, cmd=cmd,
- env=env, cwd=self.m.path['checkout'])
+ env=env, cwd=self.m.path['checkout'], **kwargs)
except self.m.step.StepFailure:
if self.m.platform.is_win:
# The linker occasionally crashes on Windows. Try again.
self.m.run(self.m.step, 'build %s' % target, cmd=cmd,
- env=env, cwd=self.m.path['checkout'])
+ env=env, cwd=self.m.path['checkout'], **kwargs)
else:
raise
if 'CommandBuffer' in self.m.vars.builder_name:
- self.m.run.run_once(self.build_command_buffer)
+ self.m.run.run_once(self.build_command_buffer, env=env)
def copy_extra_build_products(self, swarming_out_dir):
"""Copy extra build products to specified directory.
diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py
index ea5bbb6934..019967748b 100644
--- a/infra/bots/recipe_modules/flavor/gn_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_flavor.py
@@ -6,13 +6,14 @@ import default_flavor
"""GN flavor utils, used for building Skia with GN."""
class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
- def compile(self, target):
+ def compile(self, target, **kwargs):
"""Build Skia with GN."""
# Get the gn executable.
fetch_gn = self.m.vars.skia_dir.join('bin', 'fetch-gn')
self.m.run(self.m.step, 'fetch-gn',
cmd=[fetch_gn],
- cwd=self.m.vars.skia_dir)
+ cwd=self.m.vars.skia_dir,
+ **kwargs)
is_debug = 'is_debug=true'
if self.m.vars.configuration != 'Debug':
@@ -44,10 +45,11 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
gn_exe = 'gn.exe'
gn_gen = [gn_exe, 'gen', self.out_dir, '--args=%s' % ' '.join(gn_args)]
self.m.run(self.m.step, 'gn_gen', cmd=gn_gen,
- cwd=self.m.vars.skia_dir)
+ cwd=self.m.vars.skia_dir, **kwargs)
# Run ninja.
ninja_cmd = ['ninja', '-C', self.out_dir]
self.m.run(self.m.step, 'compile %s' % target,
cmd=ninja_cmd,
- cwd=self.m.vars.skia_dir)
+ cwd=self.m.vars.skia_dir,
+ **kwargs)
diff --git a/infra/bots/recipe_modules/flavor/ios_flavor.py b/infra/bots/recipe_modules/flavor/ios_flavor.py
index d0d60f4284..d59b248912 100644
--- a/infra/bots/recipe_modules/flavor/ios_flavor.py
+++ b/infra/bots/recipe_modules/flavor/ios_flavor.py
@@ -35,11 +35,11 @@ class iOSFlavorUtils(default_flavor.DefaultFlavorUtils):
return self.m.run(self.m.step, name=name, cmd=args + cmd,
env=env, **kwargs)
- def compile(self, target):
+ def compile(self, target, **kwargs):
"""Build the given target."""
cmd = [self.ios_bin.join('ios_ninja')]
self.m.run(self.m.step, 'build iOSShell', cmd=cmd,
- cwd=self.m.path['checkout'])
+ cwd=self.m.path['checkout'], **kwargs)
def device_path_join(self, *args):
"""Like os.path.join(), but for paths on a connected iOS device."""
diff --git a/infra/bots/recipe_modules/flavor/pdfium_flavor.py b/infra/bots/recipe_modules/flavor/pdfium_flavor.py
index ce11aeac2e..12a4f808e9 100644
--- a/infra/bots/recipe_modules/flavor/pdfium_flavor.py
+++ b/infra/bots/recipe_modules/flavor/pdfium_flavor.py
@@ -12,7 +12,7 @@ import default_flavor
class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
- def compile(self, target):
+ def compile(self, target, **kwargs):
"""Build PDFium with Skia."""
pdfium_dir = self.m.vars.checkout_root.join('pdfium')
@@ -21,17 +21,20 @@ class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
self.m.step,
'runhook',
cmd=['gclient', 'runhook', 'gn_linux64'],
- cwd=pdfium_dir)
+ cwd=pdfium_dir,
+ **kwargs)
# Setup gn args.
gn_args = ['pdf_use_skia=true', 'pdf_is_standalone=true',
'clang_use_chrome_plugins=false']
+ env = kwargs.pop('env', {})
+ env['CHROMIUM_BUILDTOOLS_PATH'] = str(pdfium_dir.join('buildtools'))
self.m.run(
self.m.step,
'gn_gen',
cmd=['gn', 'gen', 'out/skia', '--args=%s' % ' '.join(gn_args)],
cwd=pdfium_dir,
- env={'CHROMIUM_BUILDTOOLS_PATH': str(pdfium_dir.join('buildtools'))})
+ env=env)
# Modify DEPS file to contain the current Skia revision.
skia_revision = self.m.vars.got_revision
@@ -47,7 +50,7 @@ class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
patched_contents = re.sub(deps_skia_regexp, str(skia_revision),
original_contents)
self.m.file.write('write PDFium DEPs', deps_file,
- patched_contents, infra_step=True)
+ patched_contents, infra_step=True)
# gclient sync after updating DEPS.
self.m.run(
@@ -61,4 +64,6 @@ class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
self.m.step,
'build_pdfium',
cmd=['ninja', '-C', 'out/skia', '-j100'],
- cwd=pdfium_dir)
+ cwd=pdfium_dir,
+ env=env,
+ **kwargs)
diff --git a/infra/bots/recipe_modules/flavor/xsan_flavor.py b/infra/bots/recipe_modules/flavor/xsan_flavor.py
index 89169b77c1..b4bff4911d 100644
--- a/infra/bots/recipe_modules/flavor/xsan_flavor.py
+++ b/infra/bots/recipe_modules/flavor/xsan_flavor.py
@@ -26,11 +26,11 @@ class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
'TSAN': 'thread',
}[self.m.vars.builder_cfg['extra_config'].replace('Swarming', '')]
- def compile(self, target):
+ def compile(self, target, **kwargs):
cmd = [self.m.vars.skia_dir.join('tools', 'xsan_build'),
self._sanitizer, target]
self.m.run(self.m.step, 'build %s' % target, cmd=cmd,
- cwd=self.m.vars.skia_dir)
+ cwd=self.m.vars.skia_dir, **kwargs)
def copy_extra_build_products(self, swarming_out_dir):
# Include msan_out if MSAN.
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index 632cb20f34..50a332e8fb 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -787,8 +787,6 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.configuration = self.builder_spec['configuration']
self.default_env.update({'SKIA_OUT': self.skia_out,
'BUILDTYPE': self.configuration})
- self.default_env.update(self.builder_spec['env'])
- self.build_targets = [str(t) for t in self.builder_spec['build_targets']]
self.do_compile_steps = self.builder_spec.get('do_compile_steps', True)
self.do_test_steps = self.builder_spec['do_test_steps']
self.do_perf_steps = self.builder_spec['do_perf_steps']
@@ -806,5 +804,3 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.swarming_out_dir, 'dm')
self.perf_data_dir = self.m.path.join(self.swarming_out_dir,
'perfdata', self.builder_name, 'data')
- self.dm_flags = self.builder_spec['dm_flags']
- self.nanobench_flags = self.builder_spec['nanobench_flags']