build

package
v0.0.0-...-d046166 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package build provides support for compiling tests and related executables.

Index

Constants

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.

Types

type Config

type Config struct {
	// Logger is used to log informational messages.
	Logger logging.Logger
	// 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
}

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