Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Implements ArtifactService.""" |
| 7 | |
| 8 | from __future__ import print_function |
| 9 | |
Alex Klein | cb541e8 | 2019-06-26 15:06:11 -0600 | [diff] [blame] | 10 | import functools |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 11 | import os |
| 12 | |
Alex Klein | 2b23672 | 2019-06-19 15:44:26 -0600 | [diff] [blame] | 13 | from chromite.api import validate |
Alex Klein | 238d886 | 2019-05-07 11:32:46 -0600 | [diff] [blame] | 14 | from chromite.api.controller import controller_util |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 15 | from chromite.cbuildbot import commands |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 16 | from chromite.cbuildbot.stages import vm_test_stages |
Alex Klein | 2275d69 | 2019-04-23 16:04:12 -0600 | [diff] [blame] | 17 | from chromite.lib import build_target_util |
| 18 | from chromite.lib import chroot_lib |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 19 | from chromite.lib import constants |
| 20 | from chromite.lib import cros_build_lib |
Evan Hernandez | de44598 | 2019-04-22 13:42:34 -0600 | [diff] [blame] | 21 | from chromite.lib import cros_logging as logging |
Alex Klein | 2275d69 | 2019-04-23 16:04:12 -0600 | [diff] [blame] | 22 | from chromite.lib import sysroot_lib |
| 23 | from chromite.service import artifacts |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 24 | |
| 25 | |
Evan Hernandez | 9f125ac | 2019-04-08 17:18:47 -0600 | [diff] [blame] | 26 | def _GetImageDir(build_root, target): |
| 27 | """Return path containing images for the given build target. |
| 28 | |
Alex Klein | e2612a0 | 2019-04-18 13:51:06 -0600 | [diff] [blame] | 29 | TODO(saklein) Expand image_lib.GetLatestImageLink to support this use case. |
| 30 | |
Evan Hernandez | 9f125ac | 2019-04-08 17:18:47 -0600 | [diff] [blame] | 31 | Args: |
| 32 | build_root (str): Path to checkout where build occurs. |
| 33 | target (str): Name of the build target. |
| 34 | |
| 35 | Returns: |
| 36 | Path to the directory containing target images. |
| 37 | |
| 38 | Raises: |
| 39 | DieSystemExit: If the image dir does not exist. |
| 40 | """ |
| 41 | image_dir = os.path.join(build_root, 'src/build/images', target, 'latest') |
| 42 | if not os.path.exists(image_dir): |
| 43 | cros_build_lib.Die('Expected to find image output for target %s at %s, ' |
| 44 | 'but path does not exist' % (target, image_dir)) |
| 45 | return image_dir |
| 46 | |
| 47 | |
| 48 | def BundleImageZip(input_proto, output_proto): |
| 49 | """Bundle image.zip. |
| 50 | |
| 51 | Args: |
| 52 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 53 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | 9f125ac | 2019-04-08 17:18:47 -0600 | [diff] [blame] | 54 | """ |
| 55 | target = input_proto.build_target.name |
| 56 | output_dir = input_proto.output_dir |
| 57 | image_dir = _GetImageDir(constants.SOURCE_ROOT, target) |
| 58 | archive = commands.BuildImageZip(output_dir, image_dir) |
| 59 | output_proto.artifacts.add().path = os.path.join(output_dir, archive) |
| 60 | |
| 61 | |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 62 | def BundleTestUpdatePayloads(input_proto, output_proto): |
| 63 | """Generate minimal update payloads for the build target for testing. |
| 64 | |
| 65 | Args: |
| 66 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 67 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 68 | """ |
| 69 | target = input_proto.build_target.name |
| 70 | output_dir = input_proto.output_dir |
| 71 | build_root = constants.SOURCE_ROOT |
| 72 | |
| 73 | # Use the first available image to create the update payload. |
Evan Hernandez | 9f125ac | 2019-04-08 17:18:47 -0600 | [diff] [blame] | 74 | img_dir = _GetImageDir(build_root, target) |
Alex Klein | cb541e8 | 2019-06-26 15:06:11 -0600 | [diff] [blame] | 75 | img_types = [constants.IMAGE_TYPE_TEST, constants.IMAGE_TYPE_DEV, |
| 76 | constants.IMAGE_TYPE_BASE] |
| 77 | img_names = [constants.IMAGE_TYPE_TO_NAME[t] for t in img_types] |
| 78 | img_paths = map(functools.partial(os.path.join, img_dir), img_names) |
| 79 | valid_images = filter(os.path.exists, img_paths) |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 80 | |
Alex Klein | cb541e8 | 2019-06-26 15:06:11 -0600 | [diff] [blame] | 81 | if not valid_images: |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 82 | cros_build_lib.Die( |
| 83 | 'Expected to find an image of type among %r for target "%s" ' |
Evan Hernandez | 9f125ac | 2019-04-08 17:18:47 -0600 | [diff] [blame] | 84 | 'at path %s.', img_types, target, img_dir) |
Alex Klein | cb541e8 | 2019-06-26 15:06:11 -0600 | [diff] [blame] | 85 | image = valid_images[0] |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 86 | |
Alex Klein | cb541e8 | 2019-06-26 15:06:11 -0600 | [diff] [blame] | 87 | payloads = artifacts.BundleTestUpdatePayloads(image, output_dir) |
| 88 | for payload in payloads: |
| 89 | output_proto.artifacts.add().path = payload |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 90 | |
| 91 | |
| 92 | def BundleAutotestFiles(input_proto, output_proto): |
| 93 | """Tar the autotest files for a build target. |
| 94 | |
| 95 | Args: |
| 96 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 97 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 98 | """ |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 99 | output_dir = input_proto.output_dir |
Alex Klein | 238d886 | 2019-05-07 11:32:46 -0600 | [diff] [blame] | 100 | if not output_dir: |
| 101 | cros_build_lib.Die('output_dir is required.') |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 102 | |
Alex Klein | 238d886 | 2019-05-07 11:32:46 -0600 | [diff] [blame] | 103 | target = input_proto.build_target.name |
| 104 | if target: |
| 105 | # Legacy call, build out sysroot path from default source root and the |
| 106 | # build target. |
| 107 | target = input_proto.build_target.name |
| 108 | build_root = constants.SOURCE_ROOT |
| 109 | sysroot_path = os.path.join(build_root, constants.DEFAULT_CHROOT_DIR, |
| 110 | 'build', target) |
| 111 | sysroot = sysroot_lib.Sysroot(sysroot_path) |
| 112 | else: |
| 113 | # New style call, use chroot and sysroot. |
| 114 | chroot = controller_util.ParseChroot(input_proto.chroot) |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 115 | |
Alex Klein | 238d886 | 2019-05-07 11:32:46 -0600 | [diff] [blame] | 116 | sysroot_path = input_proto.sysroot.path |
| 117 | if not sysroot_path: |
| 118 | cros_build_lib.Die('sysroot.path is required.') |
| 119 | |
| 120 | # Since we're staying outside the chroot, prepend the chroot path to the |
| 121 | # sysroot path so we have a valid full path to the sysroot. |
| 122 | sysroot = sysroot_lib.Sysroot(os.path.join(chroot.path, |
| 123 | sysroot_path.lstrip(os.sep))) |
| 124 | |
| 125 | if not sysroot.Exists(): |
| 126 | cros_build_lib.Die('Sysroot path must exist: %s', sysroot.path) |
| 127 | |
| 128 | try: |
| 129 | # Note that this returns the full path to *multiple* tarballs. |
| 130 | archives = artifacts.BundleAutotestFiles(sysroot, output_dir) |
| 131 | except artifacts.Error as e: |
| 132 | cros_build_lib.Die(e.message) |
| 133 | |
| 134 | for archive in archives.values(): |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 135 | output_proto.artifacts.add().path = archive |
| 136 | |
| 137 | |
| 138 | def BundleTastFiles(input_proto, output_proto): |
| 139 | """Tar the tast files for a build target. |
| 140 | |
| 141 | Args: |
| 142 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 143 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 144 | """ |
| 145 | target = input_proto.build_target.name |
| 146 | output_dir = input_proto.output_dir |
| 147 | build_root = constants.SOURCE_ROOT |
Evan Hernandez | 36589c6 | 2019-04-05 18:14:42 -0600 | [diff] [blame] | 148 | cwd = os.path.join(build_root, 'chroot/build', target, 'build') |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 149 | |
| 150 | # Note that unlike the functions below, this returns the full path |
| 151 | # to the tarball. |
Alex Klein | e2612a0 | 2019-04-18 13:51:06 -0600 | [diff] [blame] | 152 | # TODO(crbug.com/954294): Replace with a chromite/service implementation. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 153 | archive = commands.BuildTastBundleTarball(build_root, cwd, output_dir) |
| 154 | |
Evan Hernandez | 9a5d312 | 2019-04-09 10:51:23 -0600 | [diff] [blame] | 155 | if archive is None: |
| 156 | cros_build_lib.Die( |
| 157 | 'Could not bundle Tast files. ' |
| 158 | 'No Tast directories found for %s.', target) |
| 159 | |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 160 | output_proto.artifacts.add().path = archive |
| 161 | |
| 162 | |
| 163 | def BundlePinnedGuestImages(input_proto, output_proto): |
| 164 | """Tar the pinned guest images for a build target. |
| 165 | |
| 166 | Args: |
| 167 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 168 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 169 | """ |
| 170 | target = input_proto.build_target.name |
| 171 | output_dir = input_proto.output_dir |
| 172 | build_root = constants.SOURCE_ROOT |
| 173 | |
Alex Klein | e2612a0 | 2019-04-18 13:51:06 -0600 | [diff] [blame] | 174 | # TODO(crbug.com/954299): Replace with a chromite/service implementation. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 175 | archive = commands.BuildPinnedGuestImagesTarball(build_root, target, |
| 176 | output_dir) |
| 177 | |
Evan Hernandez | 9a5d312 | 2019-04-09 10:51:23 -0600 | [diff] [blame] | 178 | if archive is None: |
Evan Hernandez | de44598 | 2019-04-22 13:42:34 -0600 | [diff] [blame] | 179 | logging.warning('Found no pinned guest images for %s.', target) |
| 180 | return |
Evan Hernandez | 9a5d312 | 2019-04-09 10:51:23 -0600 | [diff] [blame] | 181 | |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 182 | output_proto.artifacts.add().path = os.path.join(output_dir, archive) |
| 183 | |
| 184 | |
Alex Klein | 7bf0ecb | 2019-06-25 10:04:15 -0600 | [diff] [blame] | 185 | def FetchPinnedGuestImages(input_proto, output_proto): |
| 186 | """Get the pinned guest image information.""" |
| 187 | sysroot_path = input_proto.sysroot.path |
| 188 | if not sysroot_path: |
| 189 | cros_build_lib.Die('sysroot.path is required.') |
| 190 | |
| 191 | chroot = controller_util.ParseChroot(input_proto.chroot) |
| 192 | sysroot = sysroot_lib.Sysroot(sysroot_path) |
| 193 | |
| 194 | if not chroot.exists(): |
| 195 | cros_build_lib.Die('Chroot does not exist: %s', chroot.path) |
| 196 | |
| 197 | if not sysroot.Exists(chroot=chroot): |
| 198 | cros_build_lib.Die('Sysroot does not exist: %s', |
| 199 | chroot.full_path(sysroot.path)) |
| 200 | |
| 201 | pins = artifacts.FetchPinnedGuestImages(chroot, sysroot) |
| 202 | |
| 203 | for pin in pins: |
| 204 | pinned_image = output_proto.pinned_images.add() |
| 205 | pinned_image.filename = pin.filename |
| 206 | pinned_image.uri = pin.uri |
| 207 | |
| 208 | |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 209 | def BundleFirmware(input_proto, output_proto): |
| 210 | """Tar the firmware images for a build target. |
| 211 | |
| 212 | Args: |
| 213 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 214 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 215 | """ |
Michael Mortensen | 568ec13 | 2019-06-27 16:56:21 +0000 | [diff] [blame] | 216 | target = input_proto.build_target.name |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 217 | output_dir = input_proto.output_dir |
Michael Mortensen | 568ec13 | 2019-06-27 16:56:21 +0000 | [diff] [blame] | 218 | build_root = constants.SOURCE_ROOT |
| 219 | |
| 220 | # TODO(crbug.com/954300): Replace with a chromite/service implementation. |
| 221 | archive = commands.BuildFirmwareArchive(build_root, target, output_dir) |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 222 | |
Evan Hernandez | 9a5d312 | 2019-04-09 10:51:23 -0600 | [diff] [blame] | 223 | if archive is None: |
| 224 | cros_build_lib.Die( |
Michael Mortensen | 568ec13 | 2019-06-27 16:56:21 +0000 | [diff] [blame] | 225 | 'Could not create firmware archive. No firmware found for %s.', target) |
Evan Hernandez | 9a5d312 | 2019-04-09 10:51:23 -0600 | [diff] [blame] | 226 | |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 227 | output_proto.artifacts.add().path = os.path.join(output_dir, archive) |
| 228 | |
| 229 | |
| 230 | def BundleEbuildLogs(input_proto, output_proto): |
| 231 | """Tar the ebuild logs for a build target. |
| 232 | |
| 233 | Args: |
| 234 | input_proto (BundleRequest): The input proto. |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 235 | output_proto (BundleResponse): The output proto. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 236 | """ |
| 237 | target = input_proto.build_target.name |
| 238 | output_dir = input_proto.output_dir |
Evan Hernandez | a478d80 | 2019-04-08 15:08:24 -0600 | [diff] [blame] | 239 | |
| 240 | # commands.BuildEbuildLogsTarball conflates "buildroot" with sysroot. |
| 241 | # Adjust accordingly... |
| 242 | build_root = os.path.join(constants.SOURCE_ROOT, 'chroot', 'build') |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 243 | |
Alex Klein | e2612a0 | 2019-04-18 13:51:06 -0600 | [diff] [blame] | 244 | # TODO(crbug.com/954303): Replace with a chromite/service implementation. |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 245 | archive = commands.BuildEbuildLogsTarball(build_root, target, output_dir) |
| 246 | |
Evan Hernandez | 9a5d312 | 2019-04-09 10:51:23 -0600 | [diff] [blame] | 247 | if archive is None: |
| 248 | cros_build_lib.Die( |
| 249 | 'Could not create ebuild logs archive. No logs found for %s.', target) |
| 250 | |
Evan Hernandez | f388cbf | 2019-04-01 11:15:23 -0600 | [diff] [blame] | 251 | output_proto.artifacts.add().path = os.path.join(output_dir, archive) |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 252 | |
| 253 | |
Alex Klein | 2275d69 | 2019-04-23 16:04:12 -0600 | [diff] [blame] | 254 | def BundleSimpleChromeArtifacts(input_proto, output_proto): |
| 255 | """Create the simple chrome artifacts.""" |
| 256 | # Required args. |
| 257 | sysroot_path = input_proto.sysroot.path |
| 258 | build_target_name = input_proto.sysroot.build_target.name |
| 259 | output_dir = input_proto.output_dir |
| 260 | |
| 261 | if not build_target_name: |
| 262 | cros_build_lib.Die('build_target.name is required') |
| 263 | if not output_dir: |
| 264 | cros_build_lib.Die('output_dir is required.') |
| 265 | if not os.path.exists(output_dir): |
| 266 | cros_build_lib.Die('output_dir (%s) does not exist.', output_dir) |
| 267 | if not sysroot_path: |
| 268 | cros_build_lib.Die('sysroot.path is required.') |
| 269 | |
| 270 | # Optional args. |
| 271 | chroot_path = input_proto.chroot.path or constants.DEFAULT_CHROOT_PATH |
| 272 | cache_dir = input_proto.chroot.cache_dir |
| 273 | |
| 274 | # Build out the argument instances. |
| 275 | build_target = build_target_util.BuildTarget(build_target_name) |
| 276 | chroot = chroot_lib.Chroot(path=chroot_path, cache_dir=cache_dir) |
| 277 | # Sysroot.path needs to be the fully qualified path, including the chroot. |
| 278 | full_sysroot_path = os.path.join(chroot.path, sysroot_path.lstrip(os.sep)) |
| 279 | sysroot = sysroot_lib.Sysroot(full_sysroot_path) |
| 280 | |
| 281 | # Quick sanity check that the sysroot exists before we go on. |
| 282 | if not sysroot.Exists(): |
| 283 | cros_build_lib.Die('The sysroot does not exist.') |
| 284 | |
| 285 | try: |
| 286 | results = artifacts.BundleSimpleChromeArtifacts(chroot, sysroot, |
| 287 | build_target, output_dir) |
| 288 | except artifacts.Error as e: |
| 289 | cros_build_lib.Die('Error %s raised in BundleSimpleChromeArtifacts: %s', |
| 290 | type(e), e) |
| 291 | |
| 292 | for file_name in results: |
| 293 | output_proto.artifacts.add().path = file_name |
| 294 | |
| 295 | |
Alex Klein | 2b23672 | 2019-06-19 15:44:26 -0600 | [diff] [blame] | 296 | @validate.require('chroot.path', 'sysroot.path', 'test_results_dir', |
| 297 | 'output_dir') |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 298 | def BundleVmFiles(input_proto, output_proto): |
| 299 | """Tar VM disk and memory files. |
| 300 | |
| 301 | Args: |
| 302 | input_proto (SysrootBundleRequest): The input proto. |
| 303 | output_proto (BundleResponse): The output proto. |
| 304 | """ |
| 305 | chroot = input_proto.chroot.path |
Alex Klein | 2b23672 | 2019-06-19 15:44:26 -0600 | [diff] [blame] | 306 | sysroot = input_proto.sysroot.path.lstrip(os.sep) |
| 307 | test_results_dir = input_proto.test_results_dir.lstrip(os.sep) |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 308 | output_dir = input_proto.output_dir |
| 309 | |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 310 | # TODO(crbug.com/954344): Replace with a chromite/service implementation. |
Alex Klein | 2b23672 | 2019-06-19 15:44:26 -0600 | [diff] [blame] | 311 | image_dir = os.path.join(chroot, sysroot, test_results_dir) |
Alex Klein | 6504eca | 2019-04-18 15:37:56 -0600 | [diff] [blame] | 312 | archives = vm_test_stages.ArchiveVMFilesFromImageDir(image_dir, output_dir) |
| 313 | for archive in archives: |
| 314 | output_proto.artifacts.add().path = archive |
Tiancong Wang | c4805b7 | 2019-06-11 12:12:03 -0700 | [diff] [blame] | 315 | |
| 316 | def BundleOrderfileGenerationArtifacts(input_proto, output_proto): |
| 317 | """Create tarballs of all the artifacts of orderfile_generate builder. |
| 318 | |
| 319 | Args: |
| 320 | input_proto (BundleRequest): The input proto. |
| 321 | output_proto (BundleResponse): The output proto. |
| 322 | """ |
| 323 | # Required args. |
| 324 | build_target_name = input_proto.build_target.name |
| 325 | output_dir = input_proto.output_dir |
| 326 | chrome_version = input_proto.chrome_version |
| 327 | |
| 328 | if not build_target_name: |
| 329 | cros_build_lib.Die('build_target.name is required.') |
| 330 | if not chrome_version: |
| 331 | cros_build_lib.Die('chrome_version is required.') |
| 332 | if not output_dir: |
| 333 | cros_build_lib.Die('output_dir is required.') |
| 334 | elif not os.path.isdir(output_dir): |
| 335 | cros_build_lib.Die('output_dir does not exist.') |
| 336 | |
| 337 | chroot = controller_util.ParseChroot(input_proto.chroot) |
| 338 | |
| 339 | try: |
| 340 | results = artifacts.BundleOrderfileGenerationArtifacts( |
| 341 | chroot, input_proto.build_target, chrome_version, output_dir) |
| 342 | except artifacts.Error as e: |
| 343 | cros_build_lib.Die('Error %s raised in BundleSimpleChromeArtifacts: %s', |
| 344 | type(e), e) |
| 345 | |
| 346 | for file_name in results: |
| 347 | output_proto.artifacts.add().path = file_name |