build

package
v0.0.0-...-b5d9cbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Overview

Package build provides support for compiling tests and related executables.

Index

Constants

View Source
const (
	// LocalRunnerPkg is the Go package for local_test_runner.
	LocalRunnerPkg = "go.chromium.org/tast/core/cmd/local_test_runner"

	// RemoteRunnerPkg is the Go package for remote_test_runner.
	RemoteRunnerPkg = "go.chromium.org/tast/core/cmd/remote_test_runner"

	// LocalBundlePkgPathPrefix is the Go package path prefix for local test bundles.
	LocalBundlePkgPathPrefix = "go.chromium.org/tast-tests/cros/local/bundles"

	// RemoteBundlePkgPathPrefix is the Go package path prefix for remote test bundles.
	RemoteBundlePkgPathPrefix = "go.chromium.org/tast-tests/cros/remote/bundles"

	// LocalBundleBuildSubdir is a subdirectory used for compiled local test bundles.
	// Bundles are placed here rather than in the top-level build artifacts dir so that
	// local and remote bundles with the same name won't overwrite each other.
	LocalBundleBuildSubdir = "local_bundles"

	// RemoteBundleBuildSubdir is a subdirectory used for compiled remote test bundles.
	// Bundles are placed here rather than in the top-level build artifacts dir so that
	// local and remote bundles with the same name won't overwrite each other.
	RemoteBundleBuildSubdir = "remote_bundles"
)
View Source
const ArchHost = "host"

ArchHost represents the host architecture. It can be set in Target.Arch to instruct to use the host toolchains.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, cfg *Config, tgts []*Target) error

Build builds executables as dictated by cfg. tgts is a list of build targets to build in parallel.

func LocalBundlePrefix

func LocalBundlePrefix(bundle string) (string, error)

LocalBundlePrefix returns the local bundle prefix for a particular bundle.

func RemoteBundlePrefix

func RemoteBundlePrefix(bundle string) (string, error)

RemoteBundlePrefix returns the remnote bundle prefix for a particular bundle.

Types

type Config

type Config struct {
	// CheckBuildDeps indicates whether to check that build dependencies are installed and up-to-date in
	// the host sysroot.
	CheckBuildDeps bool
	// InstallPortageDeps controls whether outdated or missing Portage deps are automatically installed.
	// If false, a message is generated with the commands(s) that should be manually run and an error is returned.
	InstallPortageDeps bool
	// CheckDepsCachePath is the path to a JSON file storing cached information to avoid running emerge
	// to check build dependencies when possible. See checkDepsCache for the format.
	CheckDepsCachePath string
	// TastWorkspace is the path to the Go workspace containing Tast framework. This path is used to perform
	// source compatibility version checks. If it is empty, no check is performed.
	TastWorkspace string
}

Config describes a configuration for building an executable package.

type Target

type Target struct {
	// Pkg is the name of a Go executable package to build.
	Pkg string
	// Arch is the userland architecture to build for. It is usually given by "uname -m", but it can be different
	// if the kernel and the userland use different architectures (e.g. aarch64 kernel with armv7l userland).
	// If it is ArchHost, the toolchains for the host is used.
	Arch string
	// Workspaces contains paths to Go workspaces (i.e. with "src" subdirectories) containing source code to be compiled.
	// These are placed into the GOPATH environment variable in the listed order.
	Workspaces []string
	// Out is the path to save a built executable to.
	Out string
	// Debug is a flag indicating whether the binary should be built with debug symbols.
	Debug bool
}

Target describes a Go executable package to build and configurations needed to built it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL