]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go, go/build: add ToolTags to build.Default
authorRuss Cox <rsc@golang.org>
Fri, 16 Apr 2021 03:07:41 +0000 (23:07 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 16 Apr 2021 19:21:48 +0000 (19:21 +0000)
commitdba89283ad05e600defc41dbf94df91ce9027566
treefe30981bf9561d983b9f071d21a7b5821fb412a4
parent95ed5c3800a87ddf9b0ec3958eaaa1a969306293
cmd/go, go/build: add ToolTags to build.Default

The build.Default context really needs to accurately describe
the default build context. The goexperiment tags being a special
case in the go command violates that rule and is the root cause
of the various try-bot failures blocking the enabling of regabi.

(The cleanups I made in golang.org/x/tools were long overdue
but are not strictly necessary for making regabi work; this CL is.)

Having moved the GOEXPERIMENT parsing into internal/buildcfg,
go/build can now use it to set up build.Default, in the new field
ToolTags, meant to hold toolchain-determined tags (for now,
just the experiments). And at the same time we can remove the
duplication of GOOS and GOARCH defaults.

And then once build.Default is set up accurately, the special case
code in cmd/go itself can be removed, and the special case code
in test/run.go is at least a bit less special.

Change-Id: Ib7394e10aa018e492cb9a83fb8fb9a5011a8c25b
Reviewed-on: https://go-review.googlesource.com/c/go/+/310732
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/list/context.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/work/init.go
src/go/build/build.go
test/run.go