OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 # pylint: disable=W0201 | 6 # pylint: disable=W0201 |
7 | 7 |
8 | 8 |
9 """Default flavor utils class, used for desktop builders.""" | 9 """Default flavor utils class, used for desktop builders.""" |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 'bootstrap_win_toolchain_json.py') | 104 'bootstrap_win_toolchain_json.py') |
105 win_toolchain_json = self._win_toolchain_dir.join( | 105 win_toolchain_json = self._win_toolchain_dir.join( |
106 'src', 'build', 'win_toolchain.json') | 106 'src', 'build', 'win_toolchain.json') |
107 self.m.python( | 107 self.m.python( |
108 'bootstrap win toolchain', | 108 'bootstrap win toolchain', |
109 script=bootstrap_script, | 109 script=bootstrap_script, |
110 args=['--win_toolchain_json', win_toolchain_json, | 110 args=['--win_toolchain_json', win_toolchain_json, |
111 '--depot_tools_parent_dir', | 111 '--depot_tools_parent_dir', |
112 self._win_toolchain_dir]) | 112 self._win_toolchain_dir]) |
113 | 113 |
114 def build_command_buffer(self): | 114 def build_command_buffer(self, **kwargs): |
115 """Build command_buffer.""" | 115 """Build command_buffer.""" |
116 script = self.m.vars.skia_dir.join('tools', 'build_command_buffer.py') | 116 script = self.m.vars.skia_dir.join('tools', 'build_command_buffer.py') |
117 self.m.run( | 117 self.m.run( |
118 self.m.python, 'build command_buffer', | 118 self.m.python, 'build command_buffer', |
119 script=script, | 119 script=script, |
120 args=['--chrome-dir', self.m.vars.checkout_root, | 120 args=['--chrome-dir', self.m.vars.checkout_root, |
121 '--output-dir', self.out_dir, | 121 '--output-dir', self.out_dir, |
122 '--chrome-build-type', self.m.vars.configuration, | 122 '--chrome-build-type', self.m.vars.configuration, |
123 '--no-sync']) | 123 '--no-sync'], |
| 124 **kwargs) |
124 | 125 |
125 def compile(self, target): | 126 def compile(self, target, **kwargs): |
126 """Build the given target.""" | 127 """Build the given target.""" |
| 128 env = kwargs.pop('env', {}) |
127 # The CHROME_PATH environment variable is needed for builders that use | 129 # The CHROME_PATH environment variable is needed for builders that use |
128 # toolchains downloaded by Chrome. | 130 # toolchains downloaded by Chrome. |
129 env = {'CHROME_PATH': self.chrome_path} | 131 env['CHROME_PATH'] = self.chrome_path |
130 if self.m.platform.is_win: | 132 if self.m.platform.is_win: |
131 make_cmd = ['python', 'make.py'] | 133 make_cmd = ['python', 'make.py'] |
132 self.m.run.run_once(self.bootstrap_win_toolchain) | 134 self.m.run.run_once(self.bootstrap_win_toolchain) |
133 if 'Vulkan' in self.m.vars.builder_name: | 135 if 'Vulkan' in self.m.vars.builder_name: |
134 env['VK_SDK_PATH'] = self.m.vars.slave_dir.join('win_vulkan_sdk') | 136 env['VK_SDK_PATH'] = self.m.vars.slave_dir.join('win_vulkan_sdk') |
135 else: | 137 else: |
136 make_cmd = ['make'] | 138 make_cmd = ['make'] |
137 cmd = make_cmd + [target] | 139 cmd = make_cmd + [target] |
138 try: | 140 try: |
139 self.m.run(self.m.step, 'build %s' % target, cmd=cmd, | 141 self.m.run(self.m.step, 'build %s' % target, cmd=cmd, |
140 env=env, cwd=self.m.path['checkout']) | 142 env=env, cwd=self.m.path['checkout'], **kwargs) |
141 except self.m.step.StepFailure: | 143 except self.m.step.StepFailure: |
142 if self.m.platform.is_win: | 144 if self.m.platform.is_win: |
143 # The linker occasionally crashes on Windows. Try again. | 145 # The linker occasionally crashes on Windows. Try again. |
144 self.m.run(self.m.step, 'build %s' % target, cmd=cmd, | 146 self.m.run(self.m.step, 'build %s' % target, cmd=cmd, |
145 env=env, cwd=self.m.path['checkout']) | 147 env=env, cwd=self.m.path['checkout'], **kwargs) |
146 else: | 148 else: |
147 raise | 149 raise |
148 if 'CommandBuffer' in self.m.vars.builder_name: | 150 if 'CommandBuffer' in self.m.vars.builder_name: |
149 self.m.run.run_once(self.build_command_buffer) | 151 self.m.run.run_once(self.build_command_buffer, env=env) |
150 | 152 |
151 def copy_extra_build_products(self, swarming_out_dir): | 153 def copy_extra_build_products(self, swarming_out_dir): |
152 """Copy extra build products to specified directory. | 154 """Copy extra build products to specified directory. |
153 | 155 |
154 Copy flavor-specific build products to swarming_out_dir for use in test and | 156 Copy flavor-specific build products to swarming_out_dir for use in test and |
155 perf steps.""" | 157 perf steps.""" |
156 if ("Win" in self.m.vars.builder_name and | 158 if ("Win" in self.m.vars.builder_name and |
157 "Vulkan" in self.m.vars.builder_name): | 159 "Vulkan" in self.m.vars.builder_name): |
158 # This copies vulkan-1.dll that has been bundled into win_vulkan_sdk | 160 # This copies vulkan-1.dll that has been bundled into win_vulkan_sdk |
159 # since version 2 See skia/api BUILD_PRODUCTS_ISOLATE_WHITELIST | 161 # since version 2 See skia/api BUILD_PRODUCTS_ISOLATE_WHITELIST |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 images_dir=self.m.vars.images_dir, | 225 images_dir=self.m.vars.images_dir, |
224 skp_dir=self.m.vars.local_skp_dir, | 226 skp_dir=self.m.vars.local_skp_dir, |
225 tmp_dir=self.m.vars.tmp_dir) | 227 tmp_dir=self.m.vars.tmp_dir) |
226 | 228 |
227 def cleanup_steps(self): | 229 def cleanup_steps(self): |
228 """Run any device-specific cleanup steps.""" | 230 """Run any device-specific cleanup steps.""" |
229 pass | 231 pass |
230 | 232 |
231 def __repr__(self): | 233 def __repr__(self): |
232 return '<%s object>' % self.__class__.__name__ # pragma: no cover | 234 return '<%s object>' % self.__class__.__name__ # pragma: no cover |
OLD | NEW |