]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: build bootstrap without GOEXPERIMENT
authorAustin Clements <austin@google.com>
Mon, 15 Mar 2021 19:53:21 +0000 (15:53 -0400)
committerAustin Clements <austin@google.com>
Thu, 18 Mar 2021 16:51:22 +0000 (16:51 +0000)
commit6461d74bf203925c981c889034ac5f713dc9db0b
tree56896ada18c9d078492a7882725d6022fbf6ffc9
parent06ca809410649e24c1a3a079a0a859bae2d4613a
cmd/dist: build bootstrap without GOEXPERIMENT

Currently, dist attempts to build the bootstrap with the GOEXPERIMENT
set in the environment. However, the logic is incomplete and notably
requires a hack to enable the appropriate build tags for
GOEXPERIMENT=regabi. Without this hack, the build becomes skewed
between a compiler that uses regabi and a runtime that doesn't when
building toolchain2.

We could try to improve the GOEXPERIMENT processing in cmd/dist, but
it will always chase cmd/internal/objabi and it's quite difficult to
share the logic with objabi because of the constraints on building
cmd/dist.

Instead, we switch to building go_bootstrap without any GOEXPERIMENT
and only start using GOEXPERIMENT once we have a working, modern
cmd/go (which has all the GOEXPERIMENT logic in it). We also build
toolchain1 without any GOEXPERIMENT set, in case the bootstrap
toolchain is recent enough to understand build-time GOEXPERIMENT
settings.

As part of this, we make GOEXPERIMENT=none mean "no experiments". This
is necessary since, now that we support setting GOEXPERIMENT at build
time, we need an explicit way to say "ignore all baked-in experiments".

For #40724.

Change-Id: I115399579b766a7a8b2f352f7e5efea5305666cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/302050
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/dist/build.go
src/cmd/internal/objabi/util.go