go/src/cmd/dist/build.go

var goarch

var gorootBin

var gorootBinGo

var gohostarch

var gohostos

var goos

var goarm

var goarm64

var go386

var goamd64

var gomips

var gomips64

var goppc64

var goriscv64

var goroot

var goextlinkenabled

var gogcflags

var goldflags

var goexperiment

var workdir

var tooldir

var oldgoos

var oldgoarch

var oldgocache

var exe

var defaultcc

var defaultcxx

var defaultpkgconfig

var defaultldso

var rebuildall

var noOpt

var isRelease

var vflag

var okgoarch

var okgoos

// find reports the first index of p in l[0:n], or else -1.
func find(p string, l []string) int {}

// xinit handles initialization of the various global state, like goroot and goarch.
func xinit() {}

// compilerEnv returns a map from "goos/goarch" to the
// compiler setting to use for that platform.
// The entry for key "" covers any goos/goarch not explicitly set in the map.
// For example, compilerEnv("CC", "gcc") returns the C compiler settings
// read from $CC, defaulting to gcc.
//
// The result is a map because additional environment variables
// can be set to change the compiler based on goos/goarch settings.
// The following applies to all envNames but CC is assumed to simplify
// the presentation.
//
// If no environment variables are set, we use def for all goos/goarch.
// $CC, if set, applies to all goos/goarch but is overridden by the following.
// $CC_FOR_TARGET, if set, applies to all goos/goarch except gohostos/gohostarch,
// but is overridden by the following.
// If gohostos=goos and gohostarch=goarch, then $CC_FOR_TARGET applies even for gohostos/gohostarch.
// $CC_FOR_goos_goarch, if set, applies only to goos/goarch.
func compilerEnv(envName, def string) map[string]string {}

var clangos

// compilerEnvLookup returns the compiler settings for goos/goarch in map m.
// kind is "CC" or "CXX".
func compilerEnvLookup(kind string, m map[string]string, goos, goarch string) string {}

// rmworkdir deletes the work directory.
func rmworkdir() {}

// Remove trailing spaces.
func chomp(s string) string {}

// findgoversion determines the Go version to use in the version string.
// It also parses any other metadata found in the version file.
func findgoversion() string {}

// goModVersion returns the go version declared in src/go.mod. This is the
// go version to use in the go.mod building go_bootstrap, toolchain2, and toolchain3.
// (toolchain1 must be built with requiredBootstrapVersion(goModVersion))
func goModVersion() string {}

func requiredBootstrapVersion(v string) string {}

// isGitRepo reports whether the working directory is inside a Git repository.
func isGitRepo() bool {}

var oldtool

var unreleased

// setup sets up the tree for the initial build.
func setup() {}

// mustLinkExternal is a copy of internal/platform.MustLinkExternal,
// duplicated here to avoid version skew in the MustLinkExternal function
// during bootstrapping.
func mustLinkExternal(goos, goarch string, cgoEnabled bool) bool {}

var depsuffix

var gentab

var installed

var installedMu

func install(dir string) {}

func startInstall(dir string) chan struct{}

// runInstall installs the library, package, or binary associated with pkg,
// which is relative to $GOROOT/src.
func runInstall(pkg string, ch chan struct{}

// packagefile returns the path to a compiled .a file for the given package
// path. Paths may need to be resolved with resolveVendor first.
func packagefile(pkg string) string {}

var unixOS

// matchtag reports whether the tag matches this build.
func matchtag(tag string) bool {}

// shouldbuild reports whether we should build this file.
// It applies the same rules that are used with context tags
// in package go/build, except it's less picky about the order
// of GOOS and GOARCH.
// We also allow the special tag cmd_go_bootstrap.
// See ../go/bootstrap.go and package go/build.
func shouldbuild(file, pkg string) bool {}

// copyfile copies the file src to dst, via memory (so only good for small files).
func copyfile(dst, src string, flag int) {}

// dopack copies the package src to dst,
// appending the files listed in extra.
// The archive format is the traditional Unix ar format.
func dopack(dst, src string, extra []string) {}

func clean() {}

// The env command prints the default environment.
func cmdenv() {}

var timeLogEnabled

var timeLogMu

var timeLogFile

var timeLogStart

func timelog(op, name string) {}

// toolenv returns the environment to use when building commands in cmd.
//
// This is a function instead of a variable because the exact toolenv depends
// on the GOOS and GOARCH, and (at least for now) those are modified in place
// to switch between the host and target configurations when cross-compiling.
func toolenv() []string {}

var toolchain

// The bootstrap command runs a build from scratch,
// stopping at having installed the go_bootstrap command.
//
// WARNING: This command runs after cmd/dist is built with the Go bootstrap toolchain.
// It rebuilds and installs cmd/dist with the new toolchain, so other
// commands (like "go tool dist test" in run.bash) can rely on bug fixes
// made since the Go bootstrap version, but this function cannot.
func cmdbootstrap() {}

func wrapperPathFor(goos, goarch string) string {}

func goInstall(env []string, goBinary string, args ...string) {}

func appendCompilerFlags(args []string) []string {}

func goCmd(env []string, goBinary string, cmd string, args ...string) {}

func checkNotStale(env []string, goBinary string, targets ...string) {}

var cgoEnabled

var broken

var firstClass

// We only need CC if cgo is forced on, or if the platform requires external linking.
// Otherwise the go command will automatically disable it.
func needCC() bool {}

func checkCC() {}

func defaulttarg() string {}

// Install installs the list of packages named on the command line.
func cmdinstall() {}

// Clean deletes temporary objects.
func cmdclean() {}

// Banner prints the 'now you've installed Go' banner.
func cmdbanner() {}

func banner() {}

// Version prints the Go version.
func cmdversion() {}

// cmdlist lists all supported platforms.
func cmdlist() {}

func setNoOpt() {}