aboutsummaryrefslogtreecommitdiff
path: root/src/run.bat
AgeCommit message (Collapse)Author
2022-08-17run: set GOENV=off when running 'go tool dist env'Bryan C. Mills
'go tool' sets environment variables, including the GOAMD64 value from the user's go.env file. 'go tool dist test' then rebuilds and reinstalls the toolchain and standard library based on those variables. It should not; instead, it should test exactly the configuration installed by the make scripts. Fixes #54084. Change-Id: I7cc8a21cc1d8331e06d7b7c55b14d170f8e2faab Reviewed-on: https://go-review.googlesource.com/c/go/+/420055 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-12all.bat,clean.bat,race.bat,run.bat: call some.bat with .\some.batYasuhiro Matsumoto
When set NoDefaultCurrentDirectoryInExePath=1, call some.bat does not work. Change-Id: Ifeab27ecf0d7ba1d504b755a22f73a0f13abbbb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/405874 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@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-05run.bat: use cmd/dist instead of 'go install' to rebuild std and cmdBryan C. Mills
cmd/dist may set and/or unset variables before building, and at any rate it is fragile to run 'go install' before sourcing env.bat. The build-stamp information embedded by the 'go' command is currently sensitive to whether CGO_* variables are implicit or explicit, so running 'go install' before env.bat may cause stamped metadata to become stale. (Explicitly setting to the default arguably ought to produce the same metadata as leaving the variables unset, but that's a separate issue and a bigger cleanup.) Moreover, run.bat is supposed to parallel run.bash, and run.bash already hasn't invoked 'go install' itself since CL 6531! For #52009 Change-Id: Ie35217913f02cc7e0c3f9b12874abd7416473478 Reviewed-on: https://go-review.googlesource.com/c/go/+/398060 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-19build: set GOPATH consistently in run.bash, run.bat, run.rcRuss Cox
We used to clear GOPATH in all the build scripts. Clearing GOPATH is misleading at best, since you just end up with the default GOPATH (%USERPROFILE%\go on Windows). Unless that's your GOROOT, in which case you end up with a fatal error from the go command (#43938). run.bash changed to setting GOPATH=/dev/null, which has no clear analogue on Windows. run.rc still clears GOPATH. Change them all to set GOPATH to a non-existent directory /nonexist-gopath or c:\nonexist-gopath. Change-Id: I51edd66d37ff6a891b0d0541d91ecba97fbbb03d Reviewed-on: https://go-review.googlesource.com/c/go/+/288818 Trust: Russ Cox <rsc@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-06-10run.bat: do not unset GOROOT_FINAL before running testsBryan C. Mills
This removes the same logic from run.bat that was removed from cmd/dist in CL 236819. The duplicated logic was removed from run.bash and run.rc in CL 6531, but that part of run.bat was apparently missed (and not noticed because its effect was redundant). Also fix a path-separator bug in cmd/addr2line.TestAddr2Line that was exposed as a result. Fixes #39478 Updates #39385 Change-Id: I00054966cf92ef92a03681bf23de7f45f46fbb5e Reviewed-on: https://go-review.googlesource.com/c/go/+/237359 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-08all: treat all files as binary, but check in .bat with CRLFDmitri Shuralyov
This is a followup to CL 96495. It should be simpler and more robust to achieve .bat files having CRLF line endings by treating it as a binary file, like all other files, and checking it in with the desired CRLF line endings. A test is used to check the entire Go tree, short of directories starting with "." and named "testdata", for any .bat files that have anything other than strict CRLF line endings. This will help catch any accidental modifications to existing .bat files or check ins of new .bat files. Importantly, this is compatible with how Gerrit serves .tar.gz files, making it so that CRLF line endings are preserved. The Go project is supported on many different environments, some of which may have limited git implementations available, or none at all. Relying on fewer git features and special rules makes it easier to have confidence in the exact content of all files. Additionally, Go development started in Subversion, moved to Perforce, then Mercurial, and now uses Git.¹ Reducing its reliance on git-specific features will help if there will be another transition in the project's future. There are only 5 .bat files in the entire Go source tree, so a new one being added is a rare event, and we prefer to do things in Go instead. We still have the option of improving the experience for developers by adding a pre-commit converter for .bat files to the git-codereview tool. ¹ https://groups.google.com/d/msg/golang-dev/sckirqOWepg/YmyT7dWJiocJ Fixes #39391. For #37791. Change-Id: I6e202216322872f0307ac96f1b8d3f57cb901e6b Reviewed-on: https://go-review.googlesource.com/c/go/+/236437 Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-05-27run.bat: use ..\bin\go instead of "go" to install std and cmdBryan C. Mills
The paths for the other "go" commands in this file were fixed in CL 223741, but this one was missed (and run.bat is not caught by the builders). Change-Id: Iba1efddc7d2fbe6af39c39d643508decc954bbc5 Reviewed-on: https://go-review.googlesource.com/c/go/+/234758 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-04-03run.bat: check go.exe instead of goEgon Elbre
Windows requires checking with the .exe extension. Change-Id: I8e2fe83df81b92f04967bafb28f8effde999f597 Reviewed-on: https://go-review.googlesource.com/c/go/+/227157 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-03-27run.{bash,bat,rc}: use ../bin/go instead of the go binary in $PATHBryan C. Mills
https://golang.org/doc/contribute.html#quick_test currently suggests running 'make.bash' and 'run.bash' separately, but 'run.bash' potentially uses a 'go' command resolved from the wrong GOROOT, which in turn sets the wrong GOROOT for further commands. Updates #32674 Updates #17896 Change-Id: I4925d478d0fc7351c4f6d40830ab17d4d688348d Reviewed-on: https://go-review.googlesource.com/c/go/+/223741 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Katie Hockman <katie@golang.org>
2020-03-22build: force all Windows batch files to CRLFGiovanni Bajo
Batch files should use CRLF endings. LF endings mostly work but in some situations they cause random errors like goto commands failing for mysterious reasons. See golang.org/issue/37791 for more information. Next CL triggered one of such bug (a label was not being recognized), so prepare for it by converting to CRLF. This CL also touches all existing batch files to force git to update the line endings (unfortunately, changing .gitattributes only has effect next time the file is checked out or modified). Fixes #37791 Updates #9281 Change-Id: I6f9a114351cb7ac9881914400aa210c930eb8cc1 Reviewed-on: https://go-review.googlesource.com/c/go/+/96495 Run-TryBot: Giovanni Bajo <rasky@develer.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.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>
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-12-29cmd/dist: make test default to --no-rebuildRuss Cox
I'm tired of having to remember it on every command. Rebuilding everything is the wrong default. This CL updates the build script, but the builders may (or may not) need work, depending on whether they rebuild using the test command (I doubt it). Change-Id: I21f202a2f13e73df3f6bd54ae6a317c467b68151 Reviewed-on: https://go-review.googlesource.com/18084 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-03-03build: convert run.bash, run.bat, and run.rc into a Go programBrad Fitzpatrick
This will enable test sharding over multiple VMs, to speed trybot answers. Update #10029 Change-Id: Ie277c6459bc38005e4d6af14d22effeaa0a4667e Reviewed-on: https://go-review.googlesource.com/6531 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-03-01build: give windows builders extra time for testsRuss Cox
In the tests, the runtime test fails after 2 minutes. On an unloaded VM it only takes 45 seconds. I think the difference is all the other build work going on simultaneously with the running of the runtime test. Change-Id: I41e95d2e4daea44ceaa8505f81aa7b5bcfa9ec77 Reviewed-on: https://go-review.googlesource.com/6364 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
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>
2014-12-13build: change all.bash output to be more markdown-friendlyRuss Cox
People keep pasting all.bash output into GitHub bugs, which turns the # lines into <h1> headlines. Add some more #s so that the bug reports are more readable. Not ideal but seems like the best of a few bad options. Change-Id: I4c69930ec304b2d504d7cd66221281a8577b87ae Reviewed-on: https://go-review.googlesource.com/1286 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-05runtime: generate windows callback list with go generateRuss Cox
This is the last system-dependent file written by cmd/dist. They are all now written by go generate. cmd/dist is not needed to start building package runtime for a different system anymore. Now all the generated files can be assumed generated, so delete the clumsy hacks in cmd/api. Re-enable api check in run.bash. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/185040044
2014-11-21[dev.cc] build: skip API checks on Windows too (not just Unix)Russ Cox
TBR=brainman CC=golang-codereviews https://golang.org/cl/175490043
2014-10-02run.bat: comment text properlyAlex Brainman
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/153830044
2014-09-24runtime: keep g->syscallsp consistent after cgo->Go callbacksHector Martin Cantero
Normally, the caller to runtime.entersyscall() must not return before calling runtime.exitsyscall(), lest g->syscallsp become a dangling pointer. runtime.cgocallbackg() violates this constraint. To work around this, save g->syscallsp and g->syscallpc around cgo->Go callbacks, then restore them after calling runtime.entersyscall(), which restores the syscall stack frame pointer saved by cgocall. This allows the GC to correctly trace a goroutine that is currently returning from a Go->cgo->Go chain. This also adds a check to proc.c that panics if g->syscallsp is clearly invalid. It is not 100% foolproof, as it will not catch a case where the stack was popped then pushed back beyond g->syscallsp, but it does catch the present cgo issue and makes existing tests fail without the bugfix. Fixes #7978. LGTM=dvyukov, rsc R=golang-codereviews, dvyukov, minux, bradfitz, iant, gobot, rsc CC=golang-codereviews, rsc https://golang.org/cl/131910043
2014-06-02build: remove goplay from run.bash and run.batAndrew Gerrand
TBR=rsc R=golang-codereviews CC=golang-codereviews https://golang.org/cl/106730043
2014-03-06run.bash: explain why we set GOMAXPROCS for runtime testDmitriy Vyukov
Fixes #7459. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/71060044
2014-02-19cmd/gc: fix handling of append with -race.Rémy Oudompheng
Also re-enable race tests in run.bash. Fixes #7334. LGTM=rsc R=rsc, dvyukov, iant, bradfitz, dave CC=golang-codereviews https://golang.org/cl/65740043
2014-02-18run.bat: use double-colon to comment textAlex Brainman
LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/64980043
2014-02-15build: disable race detector test in run.bat on windowsRuss Cox
CL 64170043 disabled it in run.bash for Unix systems. I did not realize Windows systems also ran the race detector test. TBR=iant CC=golang-codereviews https://golang.org/cl/64480043
2013-08-15runtime/race: add end-to-end test on windowsAlex Brainman
whatever "end-to-end" means here R=golang-dev, dvyukov CC=golang-dev https://golang.org/cl/12898044
2013-08-09cmd/api: eliminate duplicate package import workRuss Cox
On my Mac, cuts the API checks from 15 seconds to 6 seconds. Also clean up some tag confusion: go run list-of-files ignores tags. R=bradfitz, gri CC=golang-dev https://golang.org/cl/12699048
2013-08-07build: change how cmd/api is run in run.bash and run.batBrad Fitzpatrick
In prep for Robert's forthcoming cmd/api rewrite which depends on the go.tools subrepo, we'll need to be more careful about how and when we run cmd/api. Rather than implement this policy in both run.bash and run.bat, this change moves the policy and mechanism into cmd/api/run.go, which will then evolve. The plan is in a TODO in run.go. R=golang-dev, gri CC=golang-dev https://golang.org/cl/12482044
2013-08-01build: remove builder from test suite (fix build)Andrew Gerrand
R=golang-dev, dave, dsymonds CC=golang-dev https://golang.org/cl/12225043
2013-07-12make.bat: incease runtime test timeout to 300s (fixes build)Alex Brainman
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/11064044
2013-05-06api: add go1.1.txt; update cmd/api to use itBrad Fitzpatrick
R=golang-dev, adg, r CC=golang-dev https://golang.org/cl/9250043
2013-04-23misc/cgo/testso: enable test on windowsShenghou Ma
Depends on CL 8715043 and CL 8676050. Fixes #5273. R=alex.brainman, r CC=gobot, golang-dev https://golang.org/cl/8764043
2013-04-09run.bat: make windows runtime test timeout same as other osAlex Brainman
R=golang-dev, dave CC=golang-dev https://golang.org/cl/8551043
2013-03-25all.bat,make.bat,run.bat: make these work even when directory has space in itAlex Brainman
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7510048
2013-03-06runtime,misc/cgo/test: disable broken tests so we can test the restAlex Brainman
R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/7486048
2013-03-01build: disable cgo on windowsRuss Cox
Update #4955. R=golang-dev CC=golang-dev https://golang.org/cl/7435049
2013-03-01cmd/ld: fix windows buildRuss Cox
Fixes #4948. R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/7445045
2013-03-01run.bat: disable race detector testAlex Brainman
R=golang-dev, dave CC=golang-dev https://golang.org/cl/7439048
2012-11-15run.{bash,bat,rc}: unset GOMAXPROCS before ../testDave Cheney
test/run.go already executes tests in parallel where possible. An unknown GOMAXPROCS value during the tests is known to cause failures with tests that measure allocations. ref: https://groups.google.com/d/topic/golang-nuts/tgMhFJ3F5WY/discussion R=fullung, minux.ma, r CC=golang-dev https://golang.org/cl/6847050
2012-11-07runtime/race: add Windows supportDmitriy Vyukov
This is copy of https://golang.org/cl/6810080 but sent from another account (dvyukov@gmail.com is not in CONTRIBUTORS). R=rsc CC=golang-dev https://golang.org/cl/6827060
2012-11-01run.bat: make output consistentAlex Brainman
R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/6811059
2012-10-04src/run.bat: add new flag for api toolRob Pike
Fixes build. Makes me annoyed. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/6591074
2012-09-26cmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windowsShenghou Ma
Fixes #4063. R=alex.brainman, rsc CC=golang-dev https://golang.org/cl/6543066
2012-09-20misc/cgo/stdio: make it work on Windows and also test itShenghou Ma
use a function to get stdout and stderr, instead of depending on a specific libc implementation. also make test/run.go replace \r\n by \n before comparing output. Fixes #2121. Part of issue 1741. R=alex.brainman, rsc, r, remyoudompheng CC=golang-dev https://golang.org/cl/5847068
2012-09-19misc/cgo/test and test/bench/go1: enable these tests on windowsAlex Brainman
R=golang-dev, r, bradfitz CC=golang-dev https://golang.org/cl/6488127
2012-09-11misc/cgo/life: disable it temporarily on windows, because go builder failsAlex Brainman
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6506096
2012-09-03run.bat: do not run misc\cgo\stdio test on windows (fix build)Alex Brainman
It is enabled by mistake and should be part of CL 5847068 instead. R=golang-dev CC=golang-dev, minux.ma https://golang.org/cl/6488073