aboutsummaryrefslogtreecommitdiff
path: root/src/make.rc
AgeCommit message (Collapse)Author
4 daysmake.bash: preserve GOROOT_BOOTSTRAPMateusz Poliwczak
CL 582076 made the GOROOT_BOOTSTRAP set to "", which in turn causes the next iteration to return true. "$GOROOT_BOOTSTRAP/bin/go" becomes "/bin/go", which always exists. Fixes #67654 Change-Id: I290bd4a7defc58e4b34d5bf955ef4f34569ff0ed GitHub-Last-Rev: 9c7134fa44874b0a9d03807aa583b1088cc13922 GitHub-Pull-Request: golang/go#67655 Reviewed-on: https://go-review.googlesource.com/c/go/+/588436 Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-04-27make.bash: avoid ksh bug in nogoenvRuss Cox
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>
2024-02-21cmd: remove support for GOROOT_FINALConstantin Konstantinidis
Fixes #62047 Change-Id: If7811c1eb9073fb09b7006076998f8b2e1810bfb Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/539975 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-07-24make.bash,bat,rc: use Go 1.20.6 instead of Go 1.17.13Russ Cox
This was missed in the update of the bootstrap toolchain and should help people who don't set GOROOT_BOOTSTRAP and instead assume these scripts will find the right one. For #54265. Change-Id: I37a0d0976006d13b73df00013780be5abf202e91 Reviewed-on: https://go-review.googlesource.com/c/go/+/512275 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2023-01-17make.bash, make.rc: fix GOROOT detection when GOEXPERIMENT is setRuss Cox
We need to clear GOEXPERIMENT any time we are invoking a bootstrap toolchain. One line missed the clearing of GOEXPERIMENT. There were three different lines using different syntaxes and subtly different sets of variables being cleared, so hoist them into a function so it's all in one place. Also quote $GOROOT_BOOTSTRAP consistently. Change-Id: I6c5a5d70c694c24705bbc61298b28ae906c0cf6c Reviewed-on: https://go-review.googlesource.com/c/go/+/456635 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org>
2022-10-17all: use Go 1.17.13 for bootstrapRuss Cox
Previously we used Go 1.17, but we realized thanks to tickling a pre-Go1.17.3 bug that if we are going to change the bootstrap toolchain that we should default to the latest available point release at the time we make the switch, not the initial major release, so as to avoid bugs that were fixed in the point releases. This CL updates the default search locations and the release notes. Users who run make.bash and depend on finding $HOME/sdk/go1.17 may need to run go install golang.org/dl/go1.17.13@latest go1.17.13 download to provide a Go 1.17.13 toolchain to their builds. Change-Id: I3a2511f088cf852470a7216a5a41ae775fb561b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/439419 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-15build: update comments about Go 1.4 in make.bash, make.bat, make.rcRuss Cox
A few lingering references to Go 1.4 remain. Fix them, and document the ones that should stay. For #44505. Fixes #54301. Change-Id: Ieb9c0f08e4d1890ea3fdfd9c8df5493934ae7493 Reviewed-on: https://go-review.googlesource.com/c/go/+/423354 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-03make.bat, make.rc: show bootstrap toolchain versionRuss Cox
Print the bootstrap toolchain version on Plan 9 and Windows, same as on all Unix systems since CL 204757 (Nov 2019). This makes it easier to see what is going on in a build. For #44505. Change-Id: I50cdd5e15a7c8b908e33e92780f8a3bca65c91ef Reviewed-on: https://go-review.googlesource.com/c/go/+/419452 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-04-05cmd/dist: move more environment logic into cmd/dist from make and run scriptsBryan C. Mills
'go tool dist env' outputs different (and fewer) environment variables than 'go env'. The 'go tool dist env' variables should be authoritative, whereas many printed by 'go env' are merely informational (and not intended to be overridden in the actual environment). Fixes #52009 Change-Id: Ic0590153875183135cebf7ca55ead7c2b4038569 Reviewed-on: https://go-review.googlesource.com/c/go/+/398061 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-04make.bash: disable GOEXPERIMENT when using bootstrap toolchainRuss Cox
When using Go 1.4 this doesn't matter, but when using Go 1.17, the bootstrap toolchain will complain about unknown GOEXPERIMENT settings. Clearly GOEXPERIMENT is for the toolchain being built, not the bootstrap. Already submitted as CL 395879 on the dev.boringcrypto branch, but needed on master to set up GOEXPERIMENT=boringcrypto builder ahead of merge. For #51940. Change-Id: Ib6a4099cca799b4d5df1974cdb5471adb0fd557d Reviewed-on: https://go-review.googlesource.com/c/go/+/397894 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-21build: force GOWORK=off in make.{bash,bat,rc}Dmitri Shuralyov
While building Go from source, workspace mode should be disabled, even if the external environment tries to configure it otherwise. Fixes #51558. Change-Id: Icd7577860271f59a8f94406214b111280e4b65b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/393879 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-08build: for default bootstrap, use Go 1.17 if present, falling back to Go 1.4Russ Cox
Preparation for #44505, but safe for Go 1.18. Also fixes the default build on Macs, at least for people who have a $HOME/go1.17 or have run go install golang.org/dl/go1.17@latest go1.17 download Replay of CL 369914 after revert in CL 370138. Only change is adding 'export GOROOT_BOOTSTRAP' in make.bash. Change-Id: I8ced4e87a9dc0f05cc49095578b401ae6212ac85 Reviewed-on: https://go-review.googlesource.com/c/go/+/370274 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-08Revert "build: for default bootstrap, use Go 1.17 if present, falling back ↵Michael Pratt
to Go 1.4" This reverts https://golang.org/cl/369914. Reason for revert: Breaking previously working toolchain builds. For #44505. Change-Id: I09ae20e50109a600d036358118077d27669df39c Reviewed-on: https://go-review.googlesource.com/c/go/+/370138 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-07build: for default bootstrap, use Go 1.17 if present, falling back to Go 1.4Russ Cox
Preparation for #44505, but safe for Go 1.18. Also fixes the default build on Macs, at least for people who have a $HOME/go1.17 or have run go install golang.org/dl/go1.17@latest go1.17 download Change-Id: I822f93e75498620fad87db2436376148c42f6bff Reviewed-on: https://go-review.googlesource.com/c/go/+/369914 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-09-02src: do not emit warning when GOROOT_BOOTSTRAP is unsetCuong Manh Le
Fixes #48155 Change-Id: I610a20d3af55035bb0b1047509361b204253801e Reviewed-on: https://go-review.googlesource.com/c/go/+/347273 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-09-02src: emit warning when make.bash run with invalid GOROOT_BOOTSTRAPCuong Manh Le
When setting an invalid GOROOT_BOOTSTRAP, make.bash try looking at env to find a valid go command and use that GOROOT instead. It's better if the script emit a warning, instead of silently change the GOROOT_BOOTSTRAP. Change-Id: I6038093d5e8c072da27bcae44b125f6774f809a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/326030 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-08-11src/make.*: make --no-clean flag a no-op that prints a warningMatthew Dempsky
This flag is undocumented and is no longer useful. Users who want to install additional toolchains without cleaning the installed packages should just use `go install`. This CL changes cmd/dist to print a warning that --no-clean is deprecated and to advise users to use `go install std cmd` instead, and then otherwise ignores it: ``` $ ./make.bash --no-clean Building Go cmd/dist using $GOROOT_BOOTSTRAP. (devel +b7a85e0003 linux/amd64) warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead Building Go toolchain1 using $GOROOT_BOOTSTRAP. ``` Fixes #47204. Change-Id: I275031832098401a49e491e324e8de3427973630 Reviewed-on: https://go-review.googlesource.com/c/go/+/341392 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-23cmd/go: add env -w and env -u to set and unset default env varsRuss Cox
Setting environment variables for go command configuration is too difficult and system-specific. This CL adds go env -w, to change the default settings more easily, in a portable way. It also adds go env -u, to unset those changes. See https://golang.org/design/30411-env for details. Fixes #30411. Change-Id: I36e83f55b666459f8f7f482432a4a6ee015da71d Reviewed-on: https://go-review.googlesource.com/c/go/+/171137 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-03-11cmd,std: add go.mod filesBryan C. Mills
Updates #30241 Updates #30228 Change-Id: Ida0fe8263bf44e0498fed2048e22283ba5716835 Reviewed-on: https://go-review.googlesource.com/c/go/+/164622 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2018-11-16build: clear GO111MODULE during make.bash etcRuss Cox
The standard build assumes the variable is unset. Make it so, like we do for GOFLAGS, GOBIN, and so on. Change-Id: I4ad5695f8021b08bd1a35dd99112970a813d247c Reviewed-on: https://go-review.googlesource.com/c/149959 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-01cmd/go: add $GOFLAGS environment variableRuss Cox
People sometimes want to turn on a particular go command flag by default. In Go 1.11 we have at least two different cases where users may need this. 1. Linking can be noticeably slower on underpowered systems due to DWARF, and users may want to set -ldflags=-w by default. 2. For modules, some users or CI systems will want vendoring always, so they want -getmode=vendor (soon to be -mod=vendor) by default. This CL generalizes the problem to “set default flags for the go command.” $GOFLAGS can be a space-separated list of flag settings, but each space-separated entry in the list must be a standalone flag. That is, you must do 'GOFLAGS=-ldflags=-w' not 'GOFLAGS=-ldflags -w'. The latter would mean to pass -w to go commands that understand it (if any do; if not, it's an error to mention it). For #26074. For #26318. Fixes #26585. Change-Id: I428f79c1fbfb9e41e54d199c68746405aed2319c Reviewed-on: https://go-review.googlesource.com/126656 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2017-10-31build: quiet make.bash, make.bat, make.rcRuss Cox
The signal-to-noise ratio is too low. Stop printing the name of every package. Can still get the old output with make.bash -v. Change-Id: Ib2c82e037166e6d2ddc31ae2a4d29af5becce574 Reviewed-on: https://go-review.googlesource.com/74351 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-10-25build: move final steps of make.bash, make.bat, make.rc into cmd/distRuss Cox
This CL expands the job of "dist bootstrap" to be "finish make.bash". I need to change that logic in upcoming CLs related to cmd/go changes, and I'd rather not change it in three places in three different shell script languages. Change-Id: I545dc215e408289e4d0b28f7c2ffcd849d89ad3b Reviewed-on: https://go-review.googlesource.com/72870 Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-08-25build: add `go env GOROOT` as default GOROOT_BOOTSTRAP valueWei Congrui
This change also added the same check in make.bash to make.rc, which makes sure $GOROOT_BOOTSTRAP != $GOROOT. Fixes #14339 Change-Id: I2758f4a845bae42ace02492fc6a911f6d6247d26 Reviewed-on: https://go-review.googlesource.com/57753 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-22build: fix cross-compile on Plan 9Russ Cox
In Plan 9's shell, GOBIN= \ foo bar is the same as GOBIN=foo bar Write what was meant, which is GOBIN=() \ foo bar Fixes #17737. Change-Id: Ie5a1b51a7cec950b5e78bbbe99cbc3cfe102f980 Reviewed-on: https://go-review.googlesource.com/33144 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Quentin Smith <quentin@golang.org> Reviewed-by: David du Colombier <0intro@gmail.com>
2016-05-19build: unset GOBIN during buildBrad Fitzpatrick
Fixes #14340 Change-Id: I43e1624fafc972fb868708c3857fc8acf1bfbbd7 Reviewed-on: https://go-review.googlesource.com/23255 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2015-06-17doc: replace references to {5..9}{g,l} with go tool compile and go tool linkJeremy Jackins
I updated some references to 6g, 6l and friends that I came across, as those programs don't exist anymore. I also fixed some echos in make.rc to match other make.* scripts while I was there. Change-Id: Ib84532cd4688cf65174dd9869e5d42af98a20a48 Reviewed-on: https://go-review.googlesource.com/11162 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-01all: delete C libraries and cmd/dist code that builds themRuss Cox
Change-Id: Ic66243674ac1dbf829c7523005e33611cc89ac83 Reviewed-on: https://go-review.googlesource.com/6362 Reviewed-by: Rob Pike <r@golang.org>
2015-02-23[dev.cc] cmd/go: fix expansion of 'std', add 'cmd'Russ Cox
The wildcard 'std' is defined in documentation to be all the packages in the Go standard library. It has also historically matched commands in the main repo, but as we implement core commands in Go, that becomes problematic. We need a wildcard that means just the library, and since 'std' is already documented to have that definition, make it so. Add a new wildcard 'cmd' for the commands in the main repo ($GOROOT). Commands that want both can say 'std cmd' (or 'cmd std') to get the effect of the old 'std'. Update make.bash etc to say both std and cmd most of the time. Exception: in race.bash, do not install race-enabled versions of the actual commands. This avoids trying to write binaries while using them, but more importantly it avoids enabling the race detector and its associated memory overhead for the already memory-hungry compilers. Change-Id: I26bb06cb13b636dfbe71a015ee0babeb270a0275 Reviewed-on: https://go-review.googlesource.com/5550 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2015-02-04[dev.cc] all: merge master (b8fcae0) into dev.ccRuss Cox
Change-Id: I2aa1d0b0c4cf7632a54e843810959b468e3812ab
2015-02-04cmd/go, make: remove ccflagsJosh Bleecher Snyder
cc is no more. Change-Id: I8d1bc0d2e471cd9357274204c9bc1fa67cbc272d Reviewed-on: https://go-review.googlesource.com/3833 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-21[dev.cc] build: do not 'clean -i std' between dist and go_bootstrapRuss Cox
Executing 'clean -i std' removes installed Go programs, including the toolchain binaries we need for building. It's not clear why the 'clean -i std' is here in the first place. cmd/dist just removed the entire pkg tree, so everything is new. The only reason for 'clean -i std' would be if you don't trust that dist compiled the packages properly. If that's true for some reason, we can fix cmd/dist, or add -a to the install commands that follow. Perhaps clean -i std should not remove tools, or perhaps std should not expand to any tools. Not sure. Also remove banner from make.bat and make.rc that was already removed from make.bash. cmd/dist prints it now. Also fix array size error in liblink/objfile.c. Fixes dev.cc build. Change-Id: I60855e001a682efce55ad9aa307a8f3ee47f7366 Reviewed-on: https://go-review.googlesource.com/3100 Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-14[dev.cc] build: do not pass GOHOSTOS and GOHOSTARCH to Go 1.4 buildRuss Cox
Go 1.4 should build what it knows how to build. GOHOSTOS and GOHOSTARCH are for the Go 1.5 build only. Change-Id: Id0f367f03485100a896e61cfdace4ac44a22e16d Reviewed-on: https://go-review.googlesource.com/2818 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-14[dev.cc] build: fix cross-compilationRuss Cox
Fixes #9574. Change-Id: Ifd7ecccb25e934f9aba284b2d72b6b22f18cb0b6 Reviewed-on: https://go-review.googlesource.com/2812 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-13build: bootstrap on Plan 9David du Colombier
This change implements the requirement of old Go to build new Go on Plan 9. Also fix the build of the new cmd/dist written in Go. This is similar to the make.bash change in CL 2470, but applied to make.rc for Plan 9. Change-Id: Ifd9a3bd8658e2cee6f92b4c7f29ce86ee2a93c53 Reviewed-on: https://go-review.googlesource.com/2662 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-09-08build: adjustments for move from src/pkg to srcRuss Cox
This CL adjusts code referring to src/pkg to refer to src. Immediately after submitting this CL, I will submit a change doing 'hg mv src/pkg/* src'. That change will be too large to review with Rietveld but will contain only the 'hg mv'. This CL will break the build. The followup 'hg mv' will fix it. For more about the move, see golang.org/s/go14nopkg. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/134570043
2014-02-13lib9: enable on Plan 9David du Colombier
This change depends on CL 57170052. LGTM=rsc R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/60840049
2013-05-24build: fix make.rc on Plan 9David du Colombier
Set $status as null to prevent rc from exiting on the last --no-banner argument checking when used with rc -e. It allows all.rc to not exit before executing run.rc R=golang-dev, lucio.dere, rsc CC=golang-dev https://golang.org/cl/9611045
2013-02-26build: do not set GOBIN on Plan 9Anthony Martin
Also, I synced the rc files with changes that have been made to make.bash, etc. R=seed, rminnich, r CC=golang-dev https://golang.org/cl/7389049
2012-05-01build: dist-based build for Plan 9Anthony Martin
R=rsc, iant, iant, seed CC=golang-dev https://golang.org/cl/5608059