go/src/cmd/dist
Austin Clements 57009d4504 cmd/cgo/internal/testsanitizers: build on all platforms
This test package uses the Pdeathsig field of syscall.SysProcAttr,
which is only available on a few platforms. Currently, dist test
checks for compatible platforms and only registers it as part of
all.bash on platforms where it can build. But this doesn't help if
you're just trying to type check everything in cmd.

Make this package pass type checking by moving the condition from dist
into build tags on the test package itself.

For #60164.
Updates #37486.

Change-Id: I58b12d547c323cec895320baa5fca1b82e99d1b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/494658
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2023-05-12 19:43:56 +00:00
..
README cmd/dist: update to assume Go 1.17.13 as minimal Go bootstrap version 2022-11-21 17:16:41 +00:00
build.go misc/android: rename to misc/go_android_exec, make go build work 2023-05-01 14:45:55 +00:00
build_test.go cmd/link/internal/ld: move more of mustLinkExternal into internal/platform 2023-03-02 16:34:21 +00:00
buildgo.go cmd/dist: refactor generated cgo-support logic 2023-04-20 17:26:46 +00:00
buildruntime.go cmd/dist: refactor generated cgo-support logic 2023-04-20 17:26:46 +00:00
buildtag.go cmd/dist: implement //go:build parsing 2021-10-28 03:35:04 +00:00
buildtag_test.go cmd/dist: add buildtag parsing test 2021-11-25 00:02:52 +00:00
buildtool.go cmd/dist: add explicit module version to generated go.mod 2023-05-05 15:46:57 +00:00
doc.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
exec_118.go cmd/dist: add old style build tags 2022-09-17 02:56:44 +00:00
exec_119.go cmd/dist: add old style build tags 2022-09-17 02:56:44 +00:00
imports.go cmd/dist: support GOROOT vendoring 2019-10-28 21:45:30 +00:00
main.go cmd/dist: add openbsd/ppc64 as a known GOOS/GOARCH 2023-03-18 05:49:27 +00:00
notgo117.go all: use Go 1.17.13 for bootstrap 2022-10-17 19:46:59 +00:00
quoted.go all: add missing copyright header 2022-11-09 14:05:53 +00:00
supported_test.go cmd/dist, internal/platform: test agreement on supported build modes 2023-01-31 16:54:46 +00:00
sys_default.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
sys_windows.go Revert "cmd/dist: log CPU model when testing" 2022-01-14 20:50:36 +00:00
test.go cmd/cgo/internal/testsanitizers: build on all platforms 2023-05-12 19:43:56 +00:00
util.go cmd/dist: default to GOARM=7 on all non-arm systems 2023-02-23 17:50:29 +00:00
util_gc.go all: use more precise build tags 2021-02-23 19:55:03 +00:00
util_gccgo.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
vfp_arm.s all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00
vfp_default.s all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00

README

This program, dist, is the bootstrapping tool for the Go distribution.

As of Go 1.5, dist and other parts of the compiler toolchain are written
in Go, making bootstrapping a little more involved than in the past.
The approach is to build the current release of Go with an earlier one.

The process to install Go 1.x, for x ≥ 20, is:

1. Build cmd/dist with Go 1.17.13.
2. Using dist, build Go 1.x compiler toolchain with Go 1.17.13.
3. Using dist, rebuild Go 1.x compiler toolchain with itself.
4. Using dist, build Go 1.x cmd/go (as go_bootstrap) with Go 1.x compiler toolchain.
5. Using go_bootstrap, build the remaining Go 1.x standard library and commands.

NOTE: During the transition from the old C-based toolchain to the Go-based one,
step 2 also builds the parts of the toolchain written in C, and step 3 does not
recompile those.

Because of backward compatibility, although the steps above say Go 1.17.13,
in practice any release ≥ Go 1.17.13 but < Go 1.x will work as the bootstrap base.

See golang.org/s/go15bootstrap for more details.

Compared to Go 1.4 and earlier, dist will also take over much of what used to
be done by make.bash/make.bat/make.rc and all of what used to be done by
run.bash/run.bat/run.rc, because it is nicer to implement that logic in Go
than in three different scripting languages simultaneously.