Mike Frysinger | f1ba7ad | 2022-09-12 05:42:57 -0400 | [diff] [blame] | 1 | # Copyright 2019 The ChromiumOS Authors |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """SDK chroot operations.""" |
| 6 | |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 7 | import os |
Greg Edelston | 9dcdc8a | 2023-01-11 17:07:10 -0700 | [diff] [blame] | 8 | from typing import Dict, Union |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 9 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 10 | from chromite.api import controller |
Alex Klein | 076841b | 2019-08-29 15:19:39 -0600 | [diff] [blame] | 11 | from chromite.api import faux |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 12 | from chromite.api import validate |
Alex Klein | 71a9a1d | 2019-10-28 15:45:10 -0600 | [diff] [blame] | 13 | from chromite.api.controller import controller_util |
Bob Haarman | 0853ce9 | 2022-12-13 18:11:53 +0000 | [diff] [blame] | 14 | from chromite.api.gen.chromiumos import common_pb2 |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 15 | from chromite.lib import cros_build_lib |
| 16 | from chromite.service import sdk |
| 17 | |
| 18 | |
Alex Klein | 076841b | 2019-08-29 15:19:39 -0600 | [diff] [blame] | 19 | def _ChrootVersionResponse(_input_proto, output_proto, _config): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 20 | """Add a fake chroot version to a successful response.""" |
| 21 | output_proto.version.version = 168 |
Alex Klein | 076841b | 2019-08-29 15:19:39 -0600 | [diff] [blame] | 22 | |
| 23 | |
Bob Haarman | 171d409 | 2023-01-10 16:44:19 +0000 | [diff] [blame] | 24 | def _BinhostCLs(_input_proto, output_proto, _config): |
| 25 | """Add fake CL identifiers to a successful response.""" |
Bob Haarman | c008260 | 2022-09-20 16:12:43 -0700 | [diff] [blame] | 26 | output_proto.cls = [ |
Bob Haarman | 171d409 | 2023-01-10 16:44:19 +0000 | [diff] [blame] | 27 | "fakecl:1", |
| 28 | "fakecl:2", |
Bob Haarman | c008260 | 2022-09-20 16:12:43 -0700 | [diff] [blame] | 29 | ] |
| 30 | |
| 31 | |
Bob Haarman | 0853ce9 | 2022-12-13 18:11:53 +0000 | [diff] [blame] | 32 | def _BuildSdkTarballResponse(_input_proto, output_proto, _config): |
| 33 | """Populate a fake BuildSdkTarballResponse.""" |
| 34 | output_proto.sdk_tarball_path.path = "/fake/sdk/tarball.tar.gz" |
| 35 | output_proto.sdk_tarball_path.location = common_pb2.Path.OUTSIDE |
| 36 | |
| 37 | |
| 38 | @faux.success(_BuildSdkTarballResponse) |
| 39 | @validate.require("chroot") |
| 40 | @validate.validation_complete |
| 41 | def BuildSdkTarball( |
| 42 | input_proto: "BuildSdkTarballRequest", |
| 43 | output_proto: "BuildSdkTarballResponse", |
| 44 | _config: "api_config.ApiConfig", |
| 45 | ) -> None: |
| 46 | chroot = controller_util.ParseChroot(input_proto.chroot) |
| 47 | output_proto.sdk_tarball_path.path = str(sdk.BuildSdkTarball(chroot)) |
| 48 | output_proto.sdk_tarball_path.location = common_pb2.Path.OUTSIDE |
| 49 | |
| 50 | |
Greg Edelston | 01ae594 | 2023-01-30 16:26:54 -0700 | [diff] [blame] | 51 | def _CreateManifestFromSdkResponse(_input_proto, output_proto, _config): |
| 52 | """Populate a fake CreateManifestFromSdkResponse.""" |
| 53 | output_proto.manifest_path.path = "/fake/sdk/tarball.tar.gz.Manifest" |
| 54 | output_proto.manifest_path.location = common_pb2.Path.Location.INSIDE |
| 55 | |
| 56 | |
| 57 | @faux.success(_CreateManifestFromSdkResponse) |
| 58 | @validate.require("chroot") |
| 59 | @validate.require("sdk_path") |
| 60 | @validate.require("dest_dir") |
| 61 | @validate.validation_complete |
| 62 | def CreateManifestFromSdk( |
| 63 | input_proto: "CreateManifestFromSdkRequest", |
| 64 | output_proto: "CreateManifestFromSdkResponse", |
| 65 | _config: "api_config.ApiConfig", |
| 66 | ) -> None: |
| 67 | """Create a manifest file showing the ebuilds in an SDK.""" |
| 68 | |
| 69 | def _assert_path_is_absolute(path: str, name: str): |
| 70 | """Raise an exception if the given path is not absolute.""" |
| 71 | if not os.path.isabs(path): |
| 72 | cros_build_lib.Die(f"The {name} must be absolute; got {path}") |
| 73 | |
| 74 | _assert_path_is_absolute(input_proto.chroot.path, "chroot path") |
| 75 | _assert_path_is_absolute(input_proto.sdk_path.path, "SDK path") |
| 76 | _assert_path_is_absolute(input_proto.dest_dir.path, "destination directory") |
| 77 | |
Greg Edelston | 1f5deb6 | 2023-03-31 14:22:08 -0600 | [diff] [blame] | 78 | sdk_path = controller_util.pb2_path_to_pathlib_path( |
Greg Edelston | 01ae594 | 2023-01-30 16:26:54 -0700 | [diff] [blame] | 79 | input_proto.sdk_path, input_proto.chroot |
| 80 | ) |
Greg Edelston | 1f5deb6 | 2023-03-31 14:22:08 -0600 | [diff] [blame] | 81 | dest_dir = controller_util.pb2_path_to_pathlib_path( |
Greg Edelston | 01ae594 | 2023-01-30 16:26:54 -0700 | [diff] [blame] | 82 | input_proto.dest_dir, input_proto.chroot |
| 83 | ) |
| 84 | |
| 85 | manifest_path = sdk.CreateManifestFromSdk(sdk_path, dest_dir) |
| 86 | output_proto.manifest_path.path = str(manifest_path) |
| 87 | output_proto.manifest_path.location = common_pb2.Path.Location.OUTSIDE |
| 88 | |
| 89 | |
Alex Klein | 076841b | 2019-08-29 15:19:39 -0600 | [diff] [blame] | 90 | @faux.success(_ChrootVersionResponse) |
| 91 | @faux.empty_error |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 92 | def Create( |
| 93 | input_proto: "CreateRequest", |
| 94 | output_proto: "CreateResponse", |
| 95 | config: "api_config.ApiConfig", |
| 96 | ) -> Union[int, None]: |
| 97 | """Chroot creation, includes support for replacing an existing chroot. |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 98 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 99 | Args: |
Alex Klein | 611dddd | 2022-10-11 17:02:01 -0600 | [diff] [blame] | 100 | input_proto: The input proto. |
| 101 | output_proto: The output proto. |
| 102 | config: The API call config. |
Kevin Shelton | 50dabff | 2022-04-09 11:29:53 -0700 | [diff] [blame] | 103 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 104 | Returns: |
Alex Klein | 611dddd | 2022-10-11 17:02:01 -0600 | [diff] [blame] | 105 | An error code, None otherwise. |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 106 | """ |
| 107 | replace = not input_proto.flags.no_replace |
| 108 | bootstrap = input_proto.flags.bootstrap |
Brian Norris | 67374d8 | 2023-05-01 12:31:12 -0700 | [diff] [blame] | 109 | chroot = controller_util.ParseChroot(input_proto.chroot) |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 110 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 111 | sdk_version = input_proto.sdk_version |
| 112 | skip_chroot_upgrade = input_proto.skip_chroot_upgrade |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 113 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 114 | if config.validate_only: |
| 115 | return controller.RETURN_CODE_VALID_INPUT |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 116 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 117 | args = sdk.CreateArguments( |
| 118 | replace=replace, |
| 119 | bootstrap=bootstrap, |
Brian Norris | 67374d8 | 2023-05-01 12:31:12 -0700 | [diff] [blame] | 120 | chroot=chroot, |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 121 | sdk_version=sdk_version, |
| 122 | skip_chroot_upgrade=skip_chroot_upgrade, |
| 123 | ) |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 124 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 125 | version = sdk.Create(args) |
Alex Klein | 19c4cc4 | 2019-02-27 14:47:57 -0700 | [diff] [blame] | 126 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 127 | if version: |
| 128 | output_proto.version.version = version |
| 129 | else: |
| 130 | # This should be very rare, if ever used, but worth noting. |
| 131 | cros_build_lib.Die( |
| 132 | "No chroot version could be found. There was likely an" |
| 133 | "error creating the chroot that was not detected." |
| 134 | ) |
Alex Klein | aa5c417 | 2019-02-27 17:12:20 -0700 | [diff] [blame] | 135 | |
| 136 | |
Alex Klein | 076841b | 2019-08-29 15:19:39 -0600 | [diff] [blame] | 137 | @faux.success(_ChrootVersionResponse) |
| 138 | @faux.empty_error |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 139 | @validate.require_each("toolchain_targets", ["name"]) |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 140 | @validate.validation_complete |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 141 | def Update( |
| 142 | input_proto: "UpdateRequest", |
| 143 | output_proto: "UpdateResponse", |
| 144 | _config: "api_config.ApiConfig", |
| 145 | ): |
| 146 | """Update the chroot. |
Alex Klein | aa5c417 | 2019-02-27 17:12:20 -0700 | [diff] [blame] | 147 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 148 | Args: |
Alex Klein | 611dddd | 2022-10-11 17:02:01 -0600 | [diff] [blame] | 149 | input_proto: The input proto. |
| 150 | output_proto: The output proto. |
| 151 | _config: The API call config. |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 152 | """ |
| 153 | build_source = input_proto.flags.build_source |
| 154 | targets = [target.name for target in input_proto.toolchain_targets] |
| 155 | toolchain_changed = input_proto.flags.toolchain_changed |
Alex Klein | aa5c417 | 2019-02-27 17:12:20 -0700 | [diff] [blame] | 156 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 157 | args = sdk.UpdateArguments( |
| 158 | build_source=build_source, |
| 159 | toolchain_targets=targets, |
| 160 | toolchain_changed=toolchain_changed, |
| 161 | ) |
Chris McDonald | 68faa2a | 2020-01-13 12:23:05 -0700 | [diff] [blame] | 162 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 163 | version = sdk.Update(args) |
Alex Klein | aa5c417 | 2019-02-27 17:12:20 -0700 | [diff] [blame] | 164 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 165 | if version: |
| 166 | output_proto.version.version = version |
| 167 | else: |
| 168 | # This should be very rare, if ever used, but worth noting. |
| 169 | cros_build_lib.Die( |
| 170 | "No chroot version could be found. There was likely an" |
| 171 | "error creating the chroot that was not detected." |
| 172 | ) |
Alex Klein | 730cf55 | 2019-10-16 11:28:22 -0600 | [diff] [blame] | 173 | |
| 174 | |
| 175 | @faux.all_empty |
Greg Edelston | 6733dc5 | 2023-02-15 15:20:07 -0700 | [diff] [blame] | 176 | @validate.require("binhost_gs_bucket") |
| 177 | @validate.validation_complete |
| 178 | def Uprev(input_proto, output_proto, _config): |
Greg Edelston | 40aea81 | 2023-03-27 16:34:35 -0600 | [diff] [blame] | 179 | """Update SDK version file and prebuilt files to point to the latest SDK. |
| 180 | |
| 181 | Files will be changed locally, but not committed. |
| 182 | """ |
| 183 | # If the UprevRequest did not specify a target version, |
| 184 | # check the remote SDK version file on Google Cloud Storage for the latest |
| 185 | # uprev target. |
Greg Edelston | d401e5a | 2023-04-28 15:29:11 -0600 | [diff] [blame] | 186 | target_version = ( |
| 187 | input_proto.version or sdk.get_latest_uprev_target_version() |
| 188 | ) |
Greg Edelston | 40aea81 | 2023-03-27 16:34:35 -0600 | [diff] [blame] | 189 | |
| 190 | # The main uprev logic occurs in service/sdk.py. |
Greg Edelston | d401e5a | 2023-04-28 15:29:11 -0600 | [diff] [blame] | 191 | modified_files = sdk.uprev_sdk_and_prebuilts( |
Greg Edelston | 6733dc5 | 2023-02-15 15:20:07 -0700 | [diff] [blame] | 192 | binhost_gs_bucket=input_proto.binhost_gs_bucket, |
| 193 | version=target_version, |
| 194 | ) |
Greg Edelston | 40aea81 | 2023-03-27 16:34:35 -0600 | [diff] [blame] | 195 | |
| 196 | # Populate the UprevResponse object with the modified files. |
Greg Edelston | 6733dc5 | 2023-02-15 15:20:07 -0700 | [diff] [blame] | 197 | for modified_file in modified_files: |
Greg Edelston | 40aea81 | 2023-03-27 16:34:35 -0600 | [diff] [blame] | 198 | proto_path = output_proto.modified_files.add() |
| 199 | proto_path.path = str(modified_file) |
| 200 | proto_path.location = common_pb2.Path.OUTSIDE |
Greg Edelston | 6733dc5 | 2023-02-15 15:20:07 -0700 | [diff] [blame] | 201 | output_proto.version = target_version |
| 202 | |
| 203 | |
| 204 | @faux.all_empty |
Alex Klein | 730cf55 | 2019-10-16 11:28:22 -0600 | [diff] [blame] | 205 | @validate.validation_complete |
| 206 | def Delete(input_proto, _output_proto, _config): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 207 | """Delete a chroot.""" |
| 208 | chroot = controller_util.ParseChroot(input_proto.chroot) |
| 209 | sdk.Delete(chroot, force=True) |
Chris McDonald | 53ad544 | 2020-01-17 14:11:55 -0700 | [diff] [blame] | 210 | |
| 211 | |
| 212 | @faux.all_empty |
| 213 | @validate.validation_complete |
Brian Norris | f624bf4 | 2023-03-02 12:57:49 -0800 | [diff] [blame] | 214 | def Unmount(_input_proto, _output_proto, _config): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 215 | """Unmount a chroot""" |
Brian Norris | f624bf4 | 2023-03-02 12:57:49 -0800 | [diff] [blame] | 216 | # Deprecated. Do nothing. |
Chris McDonald | f48ea20 | 2020-01-29 13:19:23 -0700 | [diff] [blame] | 217 | |
| 218 | |
| 219 | @faux.all_empty |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 220 | @validate.require("path.path") |
Michael Mortensen | 52a98ac | 2020-07-28 16:00:18 -0600 | [diff] [blame] | 221 | @validate.validation_complete |
| 222 | def UnmountPath(input_proto, _output_proto, _config): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 223 | """Unmount a path""" |
| 224 | sdk.UnmountPath(input_proto.path.path) |
Michael Mortensen | 52a98ac | 2020-07-28 16:00:18 -0600 | [diff] [blame] | 225 | |
| 226 | |
| 227 | @faux.all_empty |
Chris McDonald | f48ea20 | 2020-01-29 13:19:23 -0700 | [diff] [blame] | 228 | @validate.validation_complete |
| 229 | def Clean(input_proto, _output_proto, _config): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 230 | """Clean unneeded files from a chroot.""" |
| 231 | chroot = controller_util.ParseChroot(input_proto.chroot) |
George Engelbrecht | 86cfae6 | 2023-04-05 10:57:41 -0600 | [diff] [blame] | 232 | |
| 233 | # Default (flagless) call sets 'safe' and 'sysroots'. |
| 234 | if not ( |
| 235 | input_proto.safe |
| 236 | or input_proto.images |
| 237 | or input_proto.sysroots |
| 238 | or input_proto.tmp |
| 239 | or input_proto.cache |
| 240 | or input_proto.logs |
| 241 | or input_proto.workdirs |
| 242 | or input_proto.incrementals |
| 243 | ): |
| 244 | sdk.Clean(chroot, safe=True, sysroots=True) |
| 245 | else: |
| 246 | sdk.Clean( |
| 247 | chroot, |
| 248 | safe=input_proto.safe, |
| 249 | images=input_proto.images, |
| 250 | sysroots=input_proto.sysroots, |
| 251 | tmp=input_proto.tmp, |
| 252 | cache=input_proto.cache, |
| 253 | logs=input_proto.logs, |
| 254 | workdirs=input_proto.workdirs, |
| 255 | incrementals=input_proto.incrementals, |
| 256 | ) |
Chris McDonald | 9d48680 | 2020-01-29 15:57:22 -0700 | [diff] [blame] | 257 | |
| 258 | |
| 259 | @faux.all_empty |
| 260 | @validate.validation_complete |
Bob Haarman | d1225ea | 2022-01-19 22:01:42 +0000 | [diff] [blame] | 261 | def BuildPrebuilts(input_proto, _output_proto, _config): |
Greg Edelston | 9dcdc8a | 2023-01-11 17:07:10 -0700 | [diff] [blame] | 262 | """Build the binary packages that comprise the Chromium OS SDK.""" |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 263 | chroot = controller_util.ParseChroot(input_proto.chroot) |
Greg Edelston | 199c536 | 2023-01-04 12:29:07 -0700 | [diff] [blame] | 264 | sdk.BuildPrebuilts(chroot, board=input_proto.build_target.name) |
Bob Haarman | d1225ea | 2022-01-19 22:01:42 +0000 | [diff] [blame] | 265 | |
| 266 | |
Bob Haarman | 171d409 | 2023-01-10 16:44:19 +0000 | [diff] [blame] | 267 | @faux.success(_BinhostCLs) |
Bob Haarman | c008260 | 2022-09-20 16:12:43 -0700 | [diff] [blame] | 268 | @faux.empty_error |
Bob Haarman | 0853ce9 | 2022-12-13 18:11:53 +0000 | [diff] [blame] | 269 | @validate.require( |
| 270 | "prepend_version", "version", "upload_location", "sdk_tarball_template" |
| 271 | ) |
Bob Haarman | d1225ea | 2022-01-19 22:01:42 +0000 | [diff] [blame] | 272 | @validate.validation_complete |
Bob Haarman | c008260 | 2022-09-20 16:12:43 -0700 | [diff] [blame] | 273 | def CreateBinhostCLs( |
| 274 | input_proto: "CreateBinhostCLsRequest", |
| 275 | output_proto: "CreateBinhostCLsResponse", |
| 276 | _config: "api_config.ApiConfig", |
| 277 | ) -> None: |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 278 | """Create CLs to update the binhost to point at uploaded prebuilts.""" |
Bob Haarman | 171d409 | 2023-01-10 16:44:19 +0000 | [diff] [blame] | 279 | output_proto.cls.extend( |
| 280 | sdk.CreateBinhostCLs( |
| 281 | input_proto.prepend_version, |
| 282 | input_proto.version, |
| 283 | input_proto.upload_location, |
| 284 | input_proto.sdk_tarball_template, |
| 285 | ) |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 286 | ) |
Bob Haarman | 338f8b7 | 2022-02-04 01:02:46 +0000 | [diff] [blame] | 287 | |
| 288 | |
| 289 | @faux.all_empty |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 290 | @validate.require("prepend_version", "version", "upload_location") |
Bob Haarman | 338f8b7 | 2022-02-04 01:02:46 +0000 | [diff] [blame] | 291 | @validate.validation_complete |
Bob Haarman | d1225ea | 2022-01-19 22:01:42 +0000 | [diff] [blame] | 292 | def UploadPrebuiltPackages(input_proto, _output_proto, _config): |
Greg Edelston | 9dcdc8a | 2023-01-11 17:07:10 -0700 | [diff] [blame] | 293 | """Upload prebuilt packages.""" |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 294 | sdk.UploadPrebuiltPackages( |
| 295 | controller_util.ParseChroot(input_proto.chroot), |
| 296 | input_proto.prepend_version, |
| 297 | input_proto.version, |
| 298 | input_proto.upload_location, |
| 299 | ) |
Greg Edelston | 9dcdc8a | 2023-01-11 17:07:10 -0700 | [diff] [blame] | 300 | |
| 301 | |
| 302 | @faux.all_empty |
| 303 | @validate.require("chroot") |
| 304 | @validate.validation_complete |
| 305 | def BuildSdkToolchain(input_proto, output_proto, _config): |
| 306 | """Build cross-compiler packages for the SDK.""" |
| 307 | chroot = controller_util.ParseChroot(input_proto.chroot) |
| 308 | extra_env: Dict[str, str] = {} |
| 309 | if input_proto.use_flags: |
| 310 | extra_env["USE"] = " ".join(use.flag for use in input_proto.use_flags) |
| 311 | generated_files = sdk.BuildSdkToolchain(chroot, extra_env=extra_env) |
| 312 | output_proto.generated_files.extend(generated_files) |