make.bash: avoid ksh bug in nogoenv

ksh handles make.bash surprisingly well and is a smaller
supply chain attack surface, so it's reasonable to want
to use "ksh make.bash" to build Go.

The only place where ksh and bash disagree in running
make.bash is an arguable bug in ksh that

	X=Y foo

accidentally changes the real value of X following that
command when foo is a shell function. (It correctly preserves
the original value of X when foo is a command being invoked.)

More specifically,

	GOROOT=$GOROOT_BOOTSTRAP nogoenv foo

incorrectly changes $GOROOT in the rest of the script.

CL 580020 suggested using a subshell, but subshells
historically have lost "set -e", so we'd have to use (...) || exit 1.
Instead of that, this CL refactors nogoenv into bootstrapenv,
putting it in charge of changing $GOROOT the same way it
changes all the other environment variables.

This CL also updates make.rc for parallelism.
It does not bother updating make.bat: that part is already
a bit different, and attempting to change it is all risk, no reward.

Change-Id: I5923a6fb5016a3862363363859365d1cd4f61a1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/582076
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eric Grosse <grosse@gmail.com>
2 files changed
tree: 7d7fa94d49dc4246151ca050388ed9e71aa0bde4
  1. .github/
  2. api/
  3. doc/
  4. lib/
  5. misc/
  6. src/
  7. test/
  8. .gitattributes
  9. .gitignore
  10. codereview.cfg
  11. CONTRIBUTING.md
  12. go.env
  13. LICENSE
  14. PATENTS
  15. README.md
  16. SECURITY.md
README.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.