blob: 51bf1069ed7e35e475cfd972269d32772e2d5d9e [file] [log] [blame]
// Copyright 2019 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto3";
package chromite.api;
option go_package = "go.chromium.org/chromiumos/infra/proto/go/chromite/api";
import "chromite/api/build_api.proto";
import "chromiumos/common.proto";
import "chromiumos/metrics.proto";
import "chromiumos/prebuilts_cloud.proto";
import "google/protobuf/timestamp.proto";
// Sysroot information.
message Sysroot {
// Sysroot location.
string path = 1;
// The build target used to create the sysroot.
chromiumos.BuildTarget build_target = 2;
}
// Information about the sysroot's profile.
// TODO(crbug/1088059): Finish migrating this to chromiumos.Profile.
message Profile {
// The name of the profile.
string name = 1;
}
// Sysroot create request.
message SysrootCreateRequest {
// The Create flags.
message Flags {
// Triggers an update of the chroot unless the it is declared as current.
bool chroot_current = 1;
// Replace the existing sysroot when one already exists when set to true,
// otherwise keep the existing sysroot. No effect when the sysroot does not
// exist.
bool replace = 2;
// Whether a toolchain change has occurred.
bool toolchain_changed = 3;
// Whether to use the prebuilts generated by CQ
bool use_cq_prebuilts = 4;
}
// The target whose sysroot is being created.
chromiumos.BuildTarget build_target = 1;
// The sysroot create flags.
Flags flags = 2;
// The profile to select for the sysroot.
Profile profile = 3;
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 4;
// Refers to PackageIndex files used for the binhost lookup service
// prototype that was deprecated in R114.
reserved 5;
reserved "package_indexes";
}
// Create response.
message SysrootCreateResponse {
// Information about the created sysroot. This sysroot can be passed directly
// to the InstallToolchainRequest.
Sysroot sysroot = 1;
}
// GetTargetArchitecture request.
message GetTargetArchitectureRequest {
// Required. The build target to query about.
chromiumos.BuildTarget build_target = 1;
// Required. The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 2;
}
// GetTargetArchitecture response.
message GetTargetArchitectureResponse {
// The architecture of the build target, such as "amd64" or "arm64".
string architecture = 1;
}
// Sysroot generate archive request.
message SysrootGenerateArchiveRequest {
// The target whose sysroot is being created.
chromiumos.BuildTarget build_target = 1;
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 2;
// Packages to generate the sysroot for, such as 'virtual/target-fuzzers'.
// This is passed in based on the informaitonal builder type, see
// chromite/config/chromeos_config.py for examples.
repeated chromiumos.PackageInfo packages = 3;
// Target directory for the sysroot tarball.
chromiumos.ResultPath target_dir = 4;
}
// Generate archive response.
message SysrootGenerateArchiveResponse {
// Path where the sysroot tarball is written.
chromiumos.Path sysroot_archive = 1;
}
// Sysroot extract archive request.
message SysrootExtractArchiveRequest {
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 1;
// Archive will be extracted to default sysroot path of this target.
chromiumos.BuildTarget build_target = 2;
// The archive tarball path.
chromiumos.Path sysroot_archive = 3;
}
// Sysroot extract archive response.
message SysrootExtractArchiveResponse {
// Path where the sysroot tarball is written.
chromiumos.Path sysroot_archive = 1;
}
// Request to install the toolchain into the sysroot.
message InstallToolchainRequest {
// The install toolchain flags.
message Flags {
// Compile from source (true), or use bin packages (false).
bool compile_source = 1;
// Whether a toolchain change has occurred.
bool toolchain_changed = 2;
}
// The sysroot where the toolchain is being installed.
// The path and build_target are required.
Sysroot sysroot = 1;
// The flags for the install.
Flags flags = 2;
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 3;
// Directory where results (logs, etc.) should be stored.
chromiumos.ResultPath result_path = 4;
}
message InstallToolchainResponse {
// Additional data about the packages that failed to build.
repeated FailedPackageData failed_package_data = 4;
reserved 1;
reserved "failed_packages";
}
message InstallPackagesRequest {
message Flags {
// R81 was the last release branch to reference event_file.
reserved 2;
reserved "event_file";
// use_remoteexec was unnecessary after
// InstallPackagesRequest.remoteexec_config was added.
reserved 6;
reserved "use_remoteexec";
// Compile from source (true), or use bin packages (false).
bool compile_source = 1;
// Whether to start goma. Ignored if remoteexec_config exists.
bool use_goma = 3;
// Whether a toolchain change has occurred.
bool toolchain_changed = 4;
// Whether to perform a dryrun in which the list of packages that would have
// been installed are calculated but not actually merged.
// Added in R93
bool dryrun = 5;
// Whether to allow cros workon packages to build from the unstable ebuild.
bool workon = 7;
// Whether to use Bazel to build packages.
bool bazel = 8;
// Whether to skip cleaning the package directories, i.e. FEATURES=noclean.
bool skip_clean_package_dirs = 9;
// Whether to execute Bazel actions remotely in RBE, for those actions
// that allow remote execution. Actions that are configured to execute
// only locally will do that irrespective of the value of this flag.
//
// Note that this is unrelate to the `use_remoteexec` setting, which
// controls whether to use reclient or goma for package-level builds of
// packages that support reclient/goma.
bool bazel_use_remote_execution = 10;
}
// Which packages should a Bazel-based build target.
enum BazelTargets {
// If unspecified, all packages will be built.
BAZEL_TARGETS_UNSPECIFIED = 0;
// Lite builds target a limited set of packages for performance.
LITE = 1;
}
// The sysroot into which the packages are being installed.
// The path and build target are required.
Sysroot sysroot = 1;
// The install packages flags.
Flags flags = 2;
// Optional.
// A list of specific package atoms to install. Will generate
// the list of packages for the build target if none are
// specified. The version of the packages is ignored if provided.
repeated chromiumos.PackageInfo packages = 3;
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 4;
// USE flags to set before building the packages.
repeated chromiumos.UseFlag use_flags = 5;
// Goma Config.
chromiumos.GomaConfig goma_config = 6;
// Refers to PackageIndex files used for the binhost lookup service
// prototype that was deprecated in R114.
reserved 7;
reserved "package_indexes";
// Remoteexec Config to hold info needed for remote execution.
chromiumos.RemoteexecConfig remoteexec_config = 8;
// Directory where results (logs, etc.) should be stored.
chromiumos.ResultPath result_path = 9;
// Which packages should a Bazel-based build target.
BazelTargets bazel_targets = 10;
// Data needed for fetching binhosts from the binhost lookup service.
chromiumos.BinhostLookupServiceData binhost_lookup_service_data = 11;
// Optional.
// Timestamp at which the install packages action will be timed out.
// Can be used to exit cleanly shortly before termination.
google.protobuf.Timestamp timeout_timestamp = 12;
}
message InstallPackagesResponse {
// The metric events that occurred during the running of InstallPackages.
repeated chromiumos.MetricEvent events = 2;
// Goma artifacts will only be populated if
// InstallPackagesRequest.goma_config.log_dir was not empty.
chromiumos.GomaArtifacts goma_artifacts = 3;
// Additional data about the packages that failed to build.
repeated FailedPackageData failed_package_data = 4;
// Remoteexec artifacts (logs).
chromiumos.RemoteexecArtifacts remoteexec_artifacts = 5;
reserved 1;
reserved "failed_packages";
}
message FailedPackageData {
chromiumos.PackageInfo name = 1;
chromiumos.Path log_path = 2;
// Future fields: link to OWNERS file for package would be neat
}
message CreateSimpleChromeSysrootRequest {
// The board that is the build_target for the created sysroot.
chromiumos.BuildTarget build_target = 1;
// Additional environment flags which are set via the ENV VAR 'USE'.
repeated string use_flags = 2;
// Target directory for the sysroot tarball.
chromiumos.ResultPath target_dir = 3;
// The chroot where the operations will be executed.
// Required.
chromiumos.Chroot chroot = 4;
}
message CreateSimpleChromeSysrootResponse {
// Path where the sysroot tarball is written.
chromiumos.Path sysroot_archive = 1;
}
// Service to manipulate a sysroot.
service SysrootService {
option (service_options) = {
module : "sysroot",
service_chroot_assert : INSIDE,
};
// Create the base sysroot structure.
rpc Create(SysrootCreateRequest) returns (SysrootCreateResponse);
// Get the build target's architecture.
rpc GetTargetArchitecture(GetTargetArchitectureRequest)
returns (GetTargetArchitectureResponse);
// Generate sysroot archive. Added in R83.
rpc GenerateArchive(SysrootGenerateArchiveRequest)
returns (SysrootGenerateArchiveResponse);
// Extract archive to sysroot.
rpc ExtractArchive(SysrootExtractArchiveRequest)
returns (SysrootExtractArchiveResponse);
// Install the toolchain into the sysroot.
rpc InstallToolchain(InstallToolchainRequest)
returns (InstallToolchainResponse);
// Install packages into the sysroot. By default will install all packages.
rpc InstallPackages(InstallPackagesRequest) returns (InstallPackagesResponse);
// Install SimpleChrome sysroot. Added in R79.
rpc CreateSimpleChromeSysroot(CreateSimpleChromeSysrootRequest)
returns (CreateSimpleChromeSysrootResponse);
}