blob: 24fbc4a0faab206b52609d7cad2726600fb74ae4 [file] [log] [blame]
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";
// 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;
}
// 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;
// Package index files available for use.
repeated chromiumos.PackageIndexInfo package_indexes = 5;
}
// Create response.
message SysrootCreateResponse {
// Information about the created sysroot. This sysroot can be passed directly
// to the InstallToolchainRequest.
Sysroot sysroot = 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;
}
// 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;
}
message InstallToolchainResponse {
// The packages that failed to install. Will populate at least the category
// and package fields for any failed packages.
repeated chromiumos.PackageInfo failed_packages = 1;
}
message InstallPackagesRequest {
message Flags {
reserved 2;
// Compile from source (true), or use bin packages (false).
bool compile_source = 1;
// Whether to start goma.
bool use_goma = 3;
// Whether a toolchain change has occurred.
bool toolchain_changed = 4;
}
// 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;
// Package index files available for use.
repeated chromiumos.PackageIndexInfo package_indexes = 7;
}
message InstallPackagesResponse {
// The packages that failed to install. Will populate at least the category
// and package fields for any failed packages.
repeated chromiumos.PackageInfo failed_packages = 1;
// 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;
}
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;
}
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);
// Generate sysroot archive.
rpc GenerateArchive(SysrootGenerateArchiveRequest)
returns (SysrootGenerateArchiveResponse);
// 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.
rpc CreateSimpleChromeSysroot(CreateSimpleChromeSysrootRequest)
returns (CreateSimpleChromeSysrootResponse);
}