build: golang.org/x/build/internal/buildgo Index | Files

package buildgo

import "golang.org/x/build/internal/buildgo"

Package buildgo provides tools for pushing and building the Go distribution on buildlets.

Index

Package Files

basepin.go benchmarks.go buildgo.go client.go

func FetchSubrepo Uses

func FetchSubrepo(sl spanlog.Logger, bc *buildlet.Client, repo, rev string) error

func VersionTgz Uses

func VersionTgz(rev string) io.Reader

VersionTgz returns an io.Reader of a *.tar.gz file containing only a VERSION file containing the contents of the provided rev string.

type BenchmarkItem Uses

type BenchmarkItem struct {
    Output []string // benchmark output for each commit
    // contains filtered or unexported fields
}

BenchmarkItem represents a single package's benchmarks, to be run on one or more commit. After Run is called, the output of each commit can be retrieved from the Output field.

func (*BenchmarkItem) Name Uses

func (b *BenchmarkItem) Name() string

Name returns a string that uniquely identifies this benchmark.

func (*BenchmarkItem) Run Uses

func (b *BenchmarkItem) Run(buildEnv *buildenv.Environment, sl spanlog.Logger, conf dashboard.BuildConfig, bc *buildlet.Client, w io.Writer, revs []BuilderRev) (remoteErr, err error)

Run runs all the iterations of this benchmark on bc. Build output is sent to w. Benchmark output is stored in b.output. revs must contain exactly two revs. The first rev is assumed to be present in "go", and the second will be placed into "go-parent". TODO(quentin): Support len(revs) != 2.

type BuilderRev Uses

type BuilderRev struct {
    Name string // e.g. "linux-amd64-race"
    Rev  string // lowercase hex core repo git hash

    // optional sub-repository details (both must be present)
    SubName string // e.g. "net"
    SubRev  string // lowercase hex sub-repo git hash
}

BuilderRev is a build configuration type and a revision.

func (BuilderRev) IsSubrepo Uses

func (br BuilderRev) IsSubrepo() bool

func (BuilderRev) RepoOrGo Uses

func (br BuilderRev) RepoOrGo() string

func (*BuilderRev) SnapshotExists Uses

func (br *BuilderRev) SnapshotExists(ctx context.Context, buildEnv *buildenv.Environment) bool

snapshotExists reports whether the snapshot exists in storage. It returns potentially false negatives on network errors. Callers must not depend on this as more than an optimization.

func (*BuilderRev) SnapshotObjectName Uses

func (br *BuilderRev) SnapshotObjectName() string

SnapshotObjectName is the cloud storage object name of the built Go tree for this builder and Go rev (not the sub-repo). The entries inside this tarball do not begin with "go/".

func (*BuilderRev) SnapshotURL Uses

func (br *BuilderRev) SnapshotURL(buildEnv *buildenv.Environment) string

SnapshotURL is the absolute URL of the snapshot object (see above).

func (BuilderRev) SubRevOrGoRev Uses

func (br BuilderRev) SubRevOrGoRev() string

type Client Uses

type Client struct {
    Env    *buildenv.Environment // generally Production or Staging
    Creds  *google.Credentials
    Client *http.Client // OAuth2 client
    // contains filtered or unexported fields
}

Client is an authenticated client to the Go build system.

func NewClient Uses

func NewClient(ctx context.Context, env *buildenv.Environment) (*Client, error)

NewClient returns a new client for using the Go build system in the provided environment. The authentication information is discovered using env.Credentials.

func (*Client) AwaitOp Uses

func (c *Client) AwaitOp(ctx context.Context, op *compute.Operation) error

AwaitOp waits for op to finish. It returns nil if the operating finished successfully.

func (*Client) Compute Uses

func (c *Client) Compute() *compute.Service

Compute returns the GCE compute service.

func (*Client) MakeBasepinDisks Uses

func (c *Client) MakeBasepinDisks(ctx context.Context) error

MakeBasepinDisks looks at the list of all the project's VM images and creates (if needed) a disk for each one, named with the prefix "basepin-". The purpose of these "basepin" disks is to speed up GCE VM creations. When GCE creates a new disk for a new VM, it takes a fast path when creating the disk if there's another disk in the same zone for that image, and makes the new disk a thin Copy-on-Write shadow over the basepin disk. GCE also does this if there's been a VM created within the past N minutes of that type, but we want VMs to always create quickly.

type GoBuilder Uses

type GoBuilder struct {
    spanlog.Logger
    BuilderRev
    Conf dashboard.BuildConfig
    // Goroot is a Unix-style path relative to the work directory of the builder (e.g. "go").
    Goroot string
}

A GoBuilder knows how to build a revision of Go with the given configuration.

func (GoBuilder) EnumerateBenchmarks Uses

func (gb GoBuilder) EnumerateBenchmarks(bc *buildlet.Client, benchmarksRev string, pkgs []string) ([]*BenchmarkItem, error)

EnumerateBenchmarks returns a slice of the benchmarks to be run for the built Go distribution found in gb.Goroot. If benchmarksRev is non-empty, it is the revision of x/benchmarks to check out for additional benchmarks. pkgs contains a list of possibly duplicate packages that will be searched for benchmarks.

func (GoBuilder) RunMake Uses

func (gb GoBuilder) RunMake(bc *buildlet.Client, w io.Writer) (remoteErr, err error)

RunMake builds the tool chain. goroot is relative to the workdir with forward slashes. w is the Writer to send build output to. remoteErr and err are as described at the top of this file.

Package buildgo imports 22 packages (graph) and is imported by 3 packages. Updated 2018-07-21. Refresh now. Tools for package owners.