Than McIntosh [Mon, 1 Jul 2024 16:11:33 +0000 (16:11 +0000)]
cmd/link: align .reloc block starts by 32 bits for PE target
Tweak the code that emits the PE ".reloc" section on Windows to ensure
that each relocation block is 32-bit aligned, which is required by the
PE standard.
Fixes #68260.
Change-Id: I39b75a7491b00fa97871aebb90d3be0ec09f9c40
Reviewed-on: https://go-review.googlesource.com/c/go/+/595896 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Mohamed Yousif [Mon, 24 Jun 2024 16:14:03 +0000 (16:14 +0000)]
cmd/go: update go clean help message
Update the help message for the go clean command to include
the correct usage and flags for better clarity.
This change follows instructions by Ian on this thread <https://groups.google.com/g/golang-nuts/c/VENQ0fqLCSc/m/qO8EuawVBwAJ?pli=1>.
Change-Id: Ia509a38ee9ec7c31d384c3563535c5e3ccd9a9ce
GitHub-Last-Rev: 3048b2e4bd10a8d25da479f96c9d90ecb3c63082
GitHub-Pull-Request: golang/go#68135
Reviewed-on: https://go-review.googlesource.com/c/go/+/593639
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Dmitri Shuralyov [Sat, 29 Jun 2024 20:35:40 +0000 (20:35 +0000)]
sync: refer to Locker interface methods in RWMutex.RLocker doc
The methods being implemented are part of the Locker interface,
not the RWMutex struct.
Fixes #68250.
Change-Id: I609c4d5c44e90a12914a8678971ba295519cc265
Reviewed-on: https://go-review.googlesource.com/c/go/+/595875
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: 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>
Tom Levy [Mon, 13 May 2024 04:10:34 +0000 (04:10 +0000)]
runtime: fix nil pointer in TestGoroutineParallelism2 when offline
Previously, the test would crash when running on a computer without an
internet connection, e.g. in airplane mode (stack trace below).
The bug was that the condition was inverted. The code tried to close
the listener if `err != nil` (that is, if net.Listen() failed). But if
Listen() failed then there is no listener to close! The listener
should only be closed if Listen() succeeded.
Here is the stack trace from `go test runtime` when offline:
Change-Id: I48983fe21b3360ea9d0182c4a3b509801257027b
Reviewed-on: https://go-review.googlesource.com/c/go/+/584436
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Keith Randall <khr@google.com>
Alessandro Arzilli [Mon, 24 Jun 2024 13:53:55 +0000 (15:53 +0200)]
cmd/compile: drop internal range-over-func vars from DWARF output
Drops internal range-over-func variables from the DWARF output
(excluding #yield which is used by Delve).
Fixes #68238
Change-Id: Ic035e37ca3560347276cdc3b469fd564da33f4f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/594257 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
Keith Randall [Fri, 28 Jun 2024 03:45:22 +0000 (20:45 -0700)]
cmd/compile: don't elide zero extension on top of signed values
v = ... compute some value, which zeros top 32 bits ...
w = zero-extend v
We want to remove the zero-extension operation, as it doesn't do anything.
But if v is typed as a signed value, and it gets spilled/restored, it
might be re-sign-extended upon restore. So the zero-extend isn't actually
a NOP when there might be calls or other reasons to spill in between v and w.
Fixes #68227
Change-Id: I3b30b8e56c7d70deac1fb09d2becc7395acbadf8
Reviewed-on: https://go-review.googlesource.com/c/go/+/595675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joedian Reid <joedian@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Jes Cok [Thu, 27 Jun 2024 16:00:00 +0000 (00:00 +0800)]
slices: update docs for All, Backward, Values
For #61899
Change-Id: I3586b9b59e87159d21e1a270dabb3af213592739
Reviewed-on: https://go-review.googlesource.com/c/go/+/595515
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Cherry Mui [Fri, 21 Jun 2024 16:20:38 +0000 (12:20 -0400)]
cmd/link: don't skip code sign even if dsymutil didn't generate a file
Even if dsymutil didn't generate a file (which should not happen
with the Apple toolchain with the correct setup), we should not
skip next steps, e.g. code sign. A return statement makes it exit
too early.
Updates #68088.
Change-Id: Ic1271ed1b7fe5bdee5a25cc5d669a105173b389e
Reviewed-on: https://go-review.googlesource.com/c/go/+/593660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Than McIntosh <thanm@google.com>
Cherry Mui [Fri, 21 Jun 2024 15:56:45 +0000 (11:56 -0400)]
cmd/link: don't let dsymutil delete our temp directory
To work around #59026, where dsymutil may not clean up its temp
directory at exit, we set DSYMUTIL_REPRODUCER_PATH to our temp
directory so it uses that, and we can delete it at the end.
In Xcode 16 beta, dsymutil deletes the DSYMUTIL_REPRODUCER_PATH
directory even if it is not empty. We still need our tmpdir at the
point, so give a subdirectory to dsymutil instead.
For #68088.
Change-Id: I18759cc39512819bbd0511793ce917eae72245d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593659 Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Kir Kolyshkin [Sun, 9 Jun 2024 19:47:23 +0000 (12:47 -0700)]
os: rewrite TestChtimesWithZeroTimes
First, this enables checks on DragonFly BSD, which partially works since
CL 589496 (except two things: atime is not supported on hammer2 fs, and
when both times are omitted, it doesn't work due to a kernel bug).
Second, there are a few problems with TestChtimesWithZeroTimes:
- test cases are interdependent (former cases influence the latter ones),
making the test using too many different times and also hard to read;
- time is changed forward not backward which could be racy;
- if the test has failed, it hard to see which exact case is failing.
Plus, there are issues with the error exclusion code in
TestChtimesWithZeroTimes:
- the atime comparison is done twice for the default ("unix") case;
- the atime exclusion caused by noatime mount flag applies to all
unixes rather than netbsd only as it should;
- the atime exclusion tries to read wrong files (/bin/mounts and
/etc/mtab instead of /proc/mounts);
- the exclusion for netbsd is only applied for 64-bit arches, which
seems wrong (and I've reproduced noatime issue on NetBSD 9.4/i386).
Let's rewrite it, fixing all these issues, and rename to
TestChtimesOmit.
NB: TestChtimes can now be removed.
Change-Id: If9020256ca920b4db836a1f0b2e055b5fce4a552
Reviewed-on: https://go-review.googlesource.com/c/go/+/591535
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Joedian Reid <joedian@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Damien Neil [Mon, 24 Jun 2024 17:01:47 +0000 (10:01 -0700)]
crypto/tls: apply QUIC session event flag to QUICResumeSession events
Go 1.23 adds two new events to QUICConns: QUICStoreSessionEvent and
QUICResumeSessionEvent. We added a QUICConfig.EnableStoreSessionEvent
flag to control whether the store-session event is provided or not,
because receiving this event requires additional action from the caller:
the session must be explicitly stored with QUICConn.StoreSession.
We did not add a control for whether the resume-session event is
provided, because this event requires no action and the caller is
expected to ignore unknown events.
However, we never documented the expectation that callers ignore
unknown events, and quic-go produces an error when receiving an
unexpected event. So change the EnableStoreSessionEvent flag to
apply to both new events.
Fixes #68124
For #63691
Change-Id: I84af487e52b3815f7b648e09884608f8915cd645
Reviewed-on: https://go-review.googlesource.com/c/go/+/594475 Reviewed-by: Marten Seemann <martenseemann@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Joel Sing [Fri, 14 Jun 2024 15:28:46 +0000 (01:28 +1000)]
cmd/internal/obj/arm64: fix return with register
ARM64 allows for a register to be specified with a return
instruction. While the assembler parsing and encoding currently
supports this, the preprocess function uses LR unconditionally.
Correct this such that if a register is specified, the register
is used.
Change-Id: I708f6c7e910d141559b60d2d5ee76ae2e1dc3a0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/592796 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
func25 [Sun, 23 Jun 2024 05:53:47 +0000 (05:53 +0000)]
cmd/compile: update README to reflect dead code elimination changes
The description of middle-end dead code elimination is inconsistent with the current implementation.
The early dead code elimination pass of IR nodes is no longer located in cmd/compile/internal/deadcode and is no longer called by gc/main.go:Main. It has been moved to the unified IR writer phase. This update modifies the README to reflect this architectural change.
Change-Id: I78bd486edefd6b02948fee7de9ce6c83b147bc1d
GitHub-Last-Rev: 76493ce8b08cd585d761d65d29b984360f7ee628
GitHub-Pull-Request: golang/go#68134
Reviewed-on: https://go-review.googlesource.com/c/go/+/593638 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Dmitri Shuralyov [Mon, 24 Jun 2024 20:39:21 +0000 (16:39 -0400)]
cmd: run go mod tidy after CL 593684
Reported by TestAllDependencies/cmd(thorough) in cmd/internal/moddeps.
Change-Id: I897baf00efbfebd07abe387f54c7ce4fc14444e6
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/594536
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I73a3d23dd6c15ff4954ebe7a52c6c308fea947ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/593684 Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
Filippo Valsorda [Sun, 23 Jun 2024 12:10:14 +0000 (14:10 +0200)]
crypto/tls: replay test recordings without network
There is no reason to go across a pipe when replaying a conn recording.
This avoids the complexity of using localPipe and goroutines, and makes
handshake benchmarks more accurate, as we don't measure network
overhead.
Also note how it removes the need for -fast: operating locally we know
when the flow is over and can error out immediately, without waiting for
a read from the feeder on the other side of the pipe to timeout.
Avoids some noise in #67979, but doesn't fix the two root causes:
localPipe flakes and testing.B races.
Updates #67979
Change-Id: I153d3fa5a24847f3947823e8c3a7bc639f89bc1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/594255
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Joedian Reid <joedian@google.com>
Kir Kolyshkin [Fri, 21 Jun 2024 23:59:21 +0000 (16:59 -0700)]
os: TestChtimes: separate hasNoatime
Move the noatime check to a separate function (to be used by CL 91535),
adding some documentation along the way.
Unify the atime error message.
Change-Id: I5f75a4399f6e1b16ae20438003de5460f3eeb5aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/594075 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Joedian Reid <joedian@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Sebastian Nickolls [Thu, 25 Apr 2024 16:19:20 +0000 (17:19 +0100)]
cmd/internal/obj/arm64: Enable arm64 assembler tests for cross-compiler builds
Some of the tests for the arm64 assembler are not running for
cross-compiled arm64 builds with GOARCH=arm64. This patch allows the
tests to run for all architectures and moves the test that can only run on
arm64 into its own conditionally compiled file.
Updates #44734
Change-Id: I045870d47cdc1280bfacc1ef275f34504278ed89
Reviewed-on: https://go-review.googlesource.com/c/go/+/587315 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Sebastian Nickolls <sebastian.nickolls@arm.com>
Ian Lance Taylor [Sun, 23 Jun 2024 22:21:28 +0000 (15:21 -0700)]
net/netip: unexport fields of addrDetail
For #68113
Change-Id: I19c7d8eff8e3a7a1b6c8e28cb867edeca6be237d
Reviewed-on: https://go-review.googlesource.com/c/go/+/593737
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Davis Goodin [Fri, 21 Jun 2024 23:44:44 +0000 (16:44 -0700)]
cmd/link/internal/ld: handle "\r" in MinGW "--print-prog-name" output
Fix the "gcc --print-prog-name" output parser to handle "\r\n", not only
"\n". The MinGW compiler on Windows uses "\r\n" as line endings, causing
the existing parser to create paths like
".../x86_64-w64-mingw32/bin/ar.exe\r", which is not correct. By trimming
the "\r\n" cutset, both types of line endings are handled correctly.
Fixes #68121
Change-Id: I04b8bf9b6a5b29a1e59a6aa07fa4faa4c5bdeee6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Cherry Mui [Mon, 17 Jun 2024 18:44:42 +0000 (14:44 -0400)]
cmd/link: handle dynamic import variables on Darwin in plugin mode
CL 501855 added support for cgo_dynamic_import variables on Darwin.
But it didn't support the plugin build mode on amd64, where the
assembler turns a direct load (R_PCREL) to a load via GOT
(R_GOTPCREL). This CL adds the support. We just need to handle
external linking mode, as this can only occur in plugin or shared
build mode, which requires external linking.
Fixes #67976.
Updates #50891.
Change-Id: I0f56265d50bfcb36047fa5538ad7a5ec77e7ef96
Reviewed-on: https://go-review.googlesource.com/c/go/+/592499 Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Gopher Robot [Fri, 21 Jun 2024 19:19:05 +0000 (19:19 +0000)]
doc/next: delete
The release note fragments have been merged and added
as _content/doc/go1.23.md in x/website in CL 594035.
For #65614.
Change-Id: I7c8c718bc065024b6bdca93ce9bcc3c5d8b2dbc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/594036
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Michael Matloob [Fri, 21 Jun 2024 18:35:14 +0000 (14:35 -0400)]
cmd/internal: separate counter package from telemetry package
Move the code that opens and increments counters out of the
cmd/internal/telemetry package into cmd/internal/telemetry/counter. The
telemetry package has dependencies on the upload code, which we do not
want to pull into the rest of the go toolchain.
For #68109
Change-Id: I463c106819b169177a783de4a7d93377e81f4e3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/593976
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com>
Ian Lance Taylor [Wed, 19 Jun 2024 00:49:10 +0000 (17:49 -0700)]
iter: minor doc comment updates
Remove old return value. Use single variable range for iter.Seq[V].
Rewrite Pairs implementation to not loop forever.
Fixes #68056
Fixes #68073
Change-Id: I7ede0fe8ed058bbd57869d87e17b7f2c3641f7dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/593555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Ian Lance Taylor [Fri, 31 May 2024 05:29:35 +0000 (22:29 -0700)]
cmd/cgo: fail on v, err := C.fn when fn is a builtin function
We were already checking for _CMalloc, but in fact none of the
builtin functions support returning an error.
Fixes #67707
Change-Id: I0ee432a9f13ace472c3f36f641efc7d18eda0631
Reviewed-on: https://go-review.googlesource.com/c/go/+/589575
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Kir Kolyshkin [Wed, 12 Jun 2024 00:25:06 +0000 (17:25 -0700)]
os: improve newFile, rm newDir
1. Assuming that CI environments do not use NFS (and if they do,
they have TMPDIR set pointing to a local file system), we can
- remove localTmp;
- remove newDir, replacing calls to it with t.TempDir;
- remove repeated comments about NFS.
2. Use t.Name, t.Cleanup and t.Helper to improve newFile and simplify
its usage. Ensure the cleanup reports all errors.
Change-Id: I0a79a6a3d52faa323ed2658ef73f8802847f3c09
Reviewed-on: https://go-review.googlesource.com/c/go/+/592096 Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Jes Cok [Tue, 18 Jun 2024 15:43:21 +0000 (23:43 +0800)]
encoding/json: clarify the map's key type for Unmarshal
While here, also fix doc link for encoding.TextMarshaler.
Fixes #67495
Change-Id: Ia2a674c5c35b5a849ce8f5eef3d34d165b3195b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593335
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Rob Pike [Thu, 13 Jun 2024 23:48:09 +0000 (09:48 +1000)]
text/template/parse: fix handling of assignment/declaration in PipeNode.String
The String method for Pipes assumed all variables were declared. Easy fix:
check the IsAssign bit.
Fixes #65382
Change-Id: I58f2760c1a8bb2821c3538645d893f58fd76ae73
Reviewed-on: https://go-review.googlesource.com/c/go/+/592695
Run-TryBot: Rob Pike <r@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Clide Stefani [Thu, 13 Jun 2024 18:57:12 +0000 (14:57 -0400)]
crypto/tls: add support for -expect-version to bogo_shim_test
The existing implementation of bogo_shim_test does not support tests
that use the expect-version flag.
This change adds support for this flag.
Updates #51434.
Change-Id: Ie23fdb06d15ec0593ca58f28144e83f93ef7f200
Reviewed-on: https://go-review.googlesource.com/c/go/+/592635
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: David Chase <drchase@google.com>
Austin Clements [Wed, 19 Jun 2024 02:12:35 +0000 (22:12 -0400)]
sync/atomic: correct result names for Or methods
A few of the new Or methods of the atomic types use "new" as the name
for the result value, but it actually returns the old value. Fix this
by renaming the result values to "old".
Updates #61395.
Change-Id: Ib08db9964f5dfe91929f216d50ff0c9cc891ee49
Reviewed-on: https://go-review.googlesource.com/c/go/+/593855 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Cuong Manh Le [Thu, 20 Jun 2024 15:58:24 +0000 (22:58 +0700)]
cmd/compile: support generic alias type
Type parameters on aliases are now allowed after #46477 accepted.
Updates #46477
Fixes #68054
Change-Id: Ic2e3b6f960a898163f47666e3a6bfe43b8cc22e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/593715 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Kir Kolyshkin [Thu, 30 May 2024 21:31:40 +0000 (14:31 -0700)]
internal/syscall/unix: fix UTIME_OMIT for dragonfly
CL 219638 added UTIME_OMIT values for various systems. The value for
DragonFly BSD appears to be incorrect.
The correct value is -2 (see references below), while -1 is used for
UTIME_NOW. As a result, timestamp is changed to the current time instead
of not touching. This should have been caught by the accompanying test
case, TestChtimesWithZeroTimes, but its failures are essentially skipped
on dragonfly (this is being fixed separately in a followup CL 591535).
Change-Id: I432360ca982c84b7cd70d0cf01d860af9ff985fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/589496
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Damien Neil [Mon, 17 Jun 2024 19:30:19 +0000 (12:30 -0700)]
net/http: keep Content-Encoding in Error, add GODEBUG for ServeContent
This reverts the changes to Error from CL 571995, and adds a
GODEBUG controlling the changes to ServeContent/ServeFile/ServeFS.
The change to remove the Content-Encoding header when serving an error
breaks middleware which sets Content-Encoding: gzip and wraps a
ResponseWriter in one which compresses the response body.
This middleware already breaks when ServeContent handles a Range request.
Correct uses of ServeContent which serve pre-compressed content with
a Content-Encoding: gzip header break if we don't remove that header
when serving errors. Therefore, we keep the change to ServeContent/
ServeFile/ServeFS, but we add the ability to disable the new behavior
by setting GODEBUG=httpservecontentkeepheaders=1.
We revert the change to Error, because users who don't want to include
a Content-Encoding header in errors can simply remove the header
themselves, or not add it in the first place.
Sam Thanawalla [Tue, 18 Jun 2024 18:48:57 +0000 (18:48 +0000)]
doc/next: update release notes for go list -m -json
For #65614
Change-Id: I49921aefb79efbc012e745cc2abd9ff36c0a9149
Reviewed-on: https://go-review.googlesource.com/c/go/+/593495 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Roland Shoemaker [Wed, 20 Mar 2024 23:09:10 +0000 (16:09 -0700)]
misc/ios: rework exec wrapper to only support simulator
This updates the tools used to execute Go binaries on the Apple iOS
Simulator to (a) work with newer arm64 macOS, (b) remove support
for running binaries on physical devices, and (c) remove the reliance on
LLDB and third-party Python packages. This makes the wrapper somewhat
simpler, and easier to understand and maintain. Additionally
clangwrap.sh is updated to reflect dropping support for targeting
physical devices.
This smoothes out the path for #66360.
Change-Id: I769127e65f5e8c6c727841168890fd8557fb0e1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/573175 Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Sam Thanawalla [Mon, 20 May 2024 20:43:39 +0000 (20:43 +0000)]
cmd/go: fix go list -u -m all with too new retractions dependency
Previously, go would not report retractions of dependencies that have a
newer version of Go. With this change, we will still display retractions despite a version difference when go list -u -m is used.
Fixes: #66403
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Change-Id: I6406680235e294269836ae4cbe3d5680ca10eea0
Reviewed-on: https://go-review.googlesource.com/c/go/+/588775
Auto-Submit: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reason for revert: It turns out, basically no one in private PKIs can
get this right. It causes way too much breakage, and every other impl
also ignores it, so we'll continue to be in good company.
Change-Id: I2da808b411ec12f72112c49079faf9f68ae465c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/589615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Dmitri Shuralyov [Wed, 12 Jun 2024 17:08:00 +0000 (13:08 -0400)]
doc/next: improve wording for proposal 67061
For #67061.
For #65614.
Change-Id: I0e324b02537e0d40c2092139d31941a1a85a0e69
Reviewed-on: https://go-review.googlesource.com/c/go/+/592196 Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
thepudds [Sat, 15 Jun 2024 22:00:19 +0000 (18:00 -0400)]
doc/next: add motivation and details links for range-over-func iterators
The "Changes to the language" section at the top of the release notes
will likely ultimately include more explanation about iterators, or at
least, the Go project will likely publish additional introductory
material on iterators on the blog and so on.
As a perhaps temporary step given current interest, this CL updates the
release notes with two additional links for details and motivation.
The new package documentation for the iter package is up-to-date,
precise, and also more accessible than the language spec, while the 2022
pre-proposal GitHub discussion starts with perhaps the most compelling
motivation writeup so far. (We purposefully include "2022" in the text
to help illustrate this was not the result of an overly hasty process).
We also update the target of the existing language spec reference to be
closer to the new material.
For #61405.
Change-Id: I4bc0f99c40f31edfc5c0e635dca5f844b26b6eeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/592935 Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sam Thanawalla [Mon, 17 Jun 2024 19:19:56 +0000 (19:19 +0000)]
cmd/go: set GoVersion for files on the command line with vet
For: #65612 Fixes: #66092
For now, we will align the behavior such that vet and the compiler agree
that gover.Local() will be used for command-line-files.
We expect to change this to set the goversion as the containing module's go
version.
Change-Id: If7f2ea3a82e8e876716f18dacc021026de175a93
Reviewed-on: https://go-review.googlesource.com/c/go/+/593156 Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
go/doc: added the predeclared identifiers clear, min, max
Fixes: #68028
Change-Id: Ib341b9f57b001cccc5dc9e822b7feaabcdb77e63
GitHub-Last-Rev: 8dd3467016088ab2a8797f14065d2e6104eb0505
GitHub-Pull-Request: golang/go#68029
Reviewed-on: https://go-review.googlesource.com/c/go/+/593015 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Robert Griesemer <gri@google.com>
Joel Sing [Fri, 14 Jun 2024 16:00:29 +0000 (02:00 +1000)]
syscall: selectively update zerrors_* on openbsd/386, openbsd/arm and openbsd/amd64
The EBADMSG, ENOTRECOVERABLE, EOWNERDEAD and EPROTO Errno are missing
on openbsd/386, openbsd/arm and openbsd/amd64. These are the earliest
OpenBSD ports and they did not exist in the system headers when the
relevant zerror_* file was generated.
These exist for all other ports, hence it makes sense to add them
for consistency. Update error and signal strings so that they are
also consistent across OpenBSD ports.
Fixes #67998
Change-Id: I948857ef5bddcfbcdfb102c95e571d9cee009e77
Reviewed-on: https://go-review.googlesource.com/c/go/+/592795 Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Russ Cox [Fri, 7 Jun 2024 12:35:32 +0000 (08:35 -0400)]
iter: add doc comment from proposal
Add the doc comment from the proposal, lightly edited.
The edits are to drop mention of value-error Seq2 usage
and to adjust for the bool result changes.
Fixes #61897.
Change-Id: Iaffbaa301064b2f8739956d602ca5fa23c89a269
Reviewed-on: https://go-review.googlesource.com/c/go/+/591096
Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
David Chase [Wed, 12 Jun 2024 15:13:26 +0000 (11:13 -0400)]
cmd/compile: give the closure generated for rangefunc bodies a name.
The generated name has the form "#yield%d" for %d = 1, 2, 3, ...
This may help the debugger connect execution within a rangefunc
loop's body to the frame containing the rest of the source code.
(It may not actually be necessary; we need to confirm with Alessandro
Aarzilli or someone else on the Delve team.)
Change-Id: Iabbb2ea5604a4bc1558c160819ac80197e1f2242
Reviewed-on: https://go-review.googlesource.com/c/go/+/592175 Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Than McIntosh [Wed, 12 Jun 2024 14:41:32 +0000 (14:41 +0000)]
cmd/go: fix problems with coverage percentage reporting w/ -coverpkg
This patch resolves a set of problems with "percent covered" metrics
reported when the "-coverpkg" is in effect; these bugs were introduced
in Go 1.22 with the rollout of CL 495452 and related changes.
Specifically, for runs with multiple packages selected but without
-coverpkg, "percent covered" metrics were generated for package P not
based just on P's statements but on the entire corpus of statements.
Fixes #65570.
Change-Id: I38d61886cb46ebd38d8c4313c326d671197c3568
Reviewed-on: https://go-review.googlesource.com/c/go/+/592205
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Than McIntosh [Wed, 12 Jun 2024 21:54:53 +0000 (21:54 +0000)]
internal/coverage: refactor EmitPercent in preparation for bugfix
Refactor cformat.EmitPercent to accept a package filter (list of
packages to report). This is a no-op in terms of exposed coverage
functionality, but we will need this feature in a subsequent patch.
Updates #65570.
Change-Id: I04ddc624a634837ea31c12ec395aa1295a0ea1f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/592204
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Than McIntosh [Wed, 12 Jun 2024 14:39:19 +0000 (14:39 +0000)]
cmd/go: fix handling of builtin packages in WriteCoverMetaFilesFile
In certain unusual situations we can wind up with a build action for a
dummy (built-in) package as a dependency for the writeCoverMeta
pseudo-action generated when -coverpkg is in effect; this was causing
a panic in WriteCoverMetaFilesFile when it discovered a predecessor
whose Mode field was not "build". Update the code that constructs deps
for writeCoverMeta action to skip dummy builds.
Fixes #67953.
Change-Id: If747aeb9bae061c84290d1e10f6ea7abb0828aca
Reviewed-on: https://go-review.googlesource.com/c/go/+/592202
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Benson Margulies [Thu, 13 Jun 2024 22:47:18 +0000 (22:47 +0000)]
slices: add documentation on incomparable items in SortFunc
Change-Id: Ib289008c0e9b5e83c37c9b6b316f3f5de8ac339a
Reviewed-on: https://go-review.googlesource.com/c/go/+/592617
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Than McIntosh [Wed, 12 Jun 2024 19:58:36 +0000 (19:58 +0000)]
cmd/go: fix "go test -n -cover" glitch with no-test packages
Invoking "go test -n -cover ./..." on a collection of packages that
includes at least one package with code but no tests can result in
spurious error of the form
Robert Griesemer [Thu, 13 Jun 2024 17:57:12 +0000 (10:57 -0700)]
spec: adjust for-range prose to include iterator functions where missing
Also add a missing table entry to the language versions section in the
appendix.
Fixes #67977.
Change-Id: I1f98abbbcc34a4ff31f390752635435eaf6120b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/592595
TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Robert Griesemer [Thu, 13 Jun 2024 16:29:22 +0000 (09:29 -0700)]
go/types, types2: typecheck cases even if switch expression is invalid
Rather than returning right away when the switch expression is invalid,
continue type checking the type switch case.
The code was already written to be able to deal with an invalid switch
expression but it returned early nevertheless. Remove the early return
and rewrite the switch expression test slightly to better control the
scope of the x operand, leading to cleaner code.
In the process replace a tricky use of the x operand with a use of the
sx operand (plus guard, since sx may be nil if invalid).
Fixes #67962.
Change-Id: I1dc08d10078753c68449637622beb4018ed23803
Reviewed-on: https://go-review.googlesource.com/c/go/+/592555 Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Michael Matloob [Thu, 13 Jun 2024 16:38:20 +0000 (12:38 -0400)]
cmd/go: call telemetry.MaybeChild at start of go command
Call the new telemetry.MaybeChild function at the start of the go
command so that the child process logic can be run immediately without
running toolchain selection if this is the child process.
The Start function in the telemetry shim package has been renamed to
OpenCounters to make it clear that that's its only function.
The StartWithUpload function in the telemetry shim package has been
renamed to MaybeParent because that's its actual effective behavior in
cmd/go, the only place it's called: it won't run as the child because
MaybeChild has already been called and would have run as the child if
the program was the telemetry child, and it won't open counters because
telemetry.Start has been called. Checks are added that those functions
are always called before so that the function name and comment are
accurate.
It might make sense to add a true telemetry.MaybeParent function that
doesn't try to start the child or open counters to make things a little
simpler.
Change-Id: Ie81e2418af85cef18ec41f75db66365f6597b8b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/592535 Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Than McIntosh [Wed, 12 Jun 2024 18:19:24 +0000 (18:19 +0000)]
internal/coverage/cfile: harden the coverage snapshot test
The existing testpoint TestCoverageSnapshot will fail if we happen to
be selecting a set of packages for inclusion in the profile that don't
include internal/coverage/cfile. Example:
$ cd `go env GOROOT`
$ cd src/internal/coverage
$ go test -coverpkg=internal/coverage/decodecounter ./...
...
--- FAIL: TestCoverageSnapshot (0.00s)
ts_test.go:102: 0.276074 0.276074
ts_test.go:104: erroneous snapshots, C1 >= C2 = true C1=0.276074 C2=0.276074
To ensure that this doesn't happen, extract the test in question out
into a separate file with a special build tag, and then have the
original testpoint do a "go test -cover -tags ... " run to make sure
that for that specific test run the cfile package is instrumented.
Fixes #67951.
Change-Id: I8ac6e07e1a6d93275b8c6acabfce85e04c70a102
Reviewed-on: https://go-review.googlesource.com/c/go/+/592200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Than McIntosh [Tue, 28 Mar 2023 13:17:27 +0000 (09:17 -0400)]
cmd/link: use path from "cc --print-prog-name ar" for c-archive buildmode
[This is a roll-forward of CL 479775, which had to be rolled back due
to bad interactions with the wrappers used by the ios-arm64-corellium
builder. ios-arm64-corellium is no longer being maintained AFAICT,
meaning that it should be ok to move ahead with this patch again].
When external linking with -buildmode=c-archive, the Go linker
eventually invokes the "ar" tool to create the final archive library.
Prior to this patch, if the '-extar' flag was not in use, we would
just run "ar". This works well in most cases but breaks down if we're
doing cross-compilation targeting Windows (macos system "ar"
apparently doesn't create the windows symdef section correctly). To
fix the problem, capture the output of "cc --print-prog-name ar" and
invoke "ar" using the path returned by that command.
Fixes #59221.
Change-Id: Ie367541b23641266a6f48ac68adf971501bff9fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/592375
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Commands run:
go get golang.org/x/telemetry@8cad58b
go mod tidy
go mod vendor
Change-Id: I81d37835c6828a8a6a40f21e4e39a0e282aca927
Reviewed-on: https://go-review.googlesource.com/c/go/+/592255 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Robert Griesemer [Wed, 12 Jun 2024 21:28:30 +0000 (14:28 -0700)]
spec: allow range-over-func to omit iteration variables
For #65236.
Change-Id: I5a11811cc52467ea4446db29c3f86b119f9b2409
Reviewed-on: https://go-review.googlesource.com/c/go/+/592295 Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Robert Griesemer [Wed, 12 Jun 2024 20:19:25 +0000 (13:19 -0700)]
go/types, types2: allow range-over-func to omit iteration variables
For #65236.
Change-Id: I63e57c1d8e9765979e9e58b45948008964b32384
Reviewed-on: https://go-review.googlesource.com/c/go/+/592176 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Than McIntosh [Thu, 6 Jun 2024 12:51:57 +0000 (12:51 +0000)]
cmd/compile/internal: add a PGO devirt post-lookup cleanup hook
The PGO-based devirtualization helper pgoir.addIndirectEdges makes a
series of calls into the unified IR reader to import functions that
would not normally be imported but may be the target of a hot indirect
call from the current package. This importing primarily targets at
non-generic functions and methods, but as part of the process we can
encounter types that have methods (including generic methods) whose
bodies need to be read in. When the reader encounters an inlinable
func of this sort, it may (depending on the context) decide not to
read the body right away, but instead adds the func to a list
("todoBodies") to be read in later on in a more convenient context.
In the bug in question, a hot method lookup takes place in
pgoir.addIndirectEdges, and as part of the import process we wind up
with a type T with method M that is in this partially created state,
and in addition T gets added to the unified IR's list of types that
may need method wrappers. During wrapper generation we create a new
wrapper "(*T).M" whose body has a call to "T.M", then farther on down
the pike during escape analysis we try to analyze the two functions;
this causes a crash due to "T.M" being in partially constructed state.
As a fix, add a new "PostLookupCleanup" hook (in the unified IR
reader) that pgoir.addIndirectEdges can invoke that takes care of
reading in the bodies of any functions that have been added to the
"todoBodies" list.
[Note: creating a test case for this problem is proving to be very
tricky; a new test will be added in a subsequent patch].
Fixes #67746.
Change-Id: Ibc47ee79e08a55421728d35341df80a865231cff
Reviewed-on: https://go-review.googlesource.com/c/go/+/591075 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Dmitri Shuralyov [Wed, 12 Jun 2024 17:17:59 +0000 (13:17 -0400)]
doc/next: improve description of proposal 61308
For #61308.
For #65614.
Change-Id: I36b4f2392075d5a3fb9f53a28bd19b997e7be363
Reviewed-on: https://go-review.googlesource.com/c/go/+/592197 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Cherry Mui [Wed, 12 Jun 2024 15:51:34 +0000 (11:51 -0400)]
doc/next: reword map iterator function notes
The notes don't define identifiers m and seq. Describe in words
instead.
While here, rename 3-structs.md to 4-structs.md.
For #65614.
Change-Id: I6690f552903d1870c70e28673c87ac84b7c5c041
Reviewed-on: https://go-review.googlesource.com/c/go/+/592195 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Tue, 11 Jun 2024 16:36:49 +0000 (09:36 -0700)]
net: add GODEBUG=netedns0=0 to disable sending EDNS0 header
It reportedly breaks the DNS server on some modems.
For #6464
For #21160
For #44135
For #51127
For #51153
Fixes #67925
Change-Id: I54a11906159f00246d08a54cc8be7327e9ebfd2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/591995
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Cherry Mui [Tue, 11 Jun 2024 22:39:19 +0000 (18:39 -0400)]
cmd/link: put runtime.end in the last section of data segment
Currently the runtime.end symbol is put into the noptrbss section,
which is usually the last section, except that when fuzzing is
enabled, the last section is actually .go.fuzzcntrs. The
runtime.end symbol has the value pointing to the end of the data
segment, so if it is not in the last section, the value will not
actually be in the range of the section. This causes an assertion
failure in the new Apple linker. This CL fixes this by putting it
in the last section.
Fixes #65169.
Change-Id: I5c991c46a0483a96e5f6e0255a3b444953676026
Reviewed-on: https://go-review.googlesource.com/c/go/+/592095 Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Pratt [Mon, 10 Jun 2024 23:52:03 +0000 (23:52 +0000)]
os: always return syscall.ECHILD from Wait for done process
For processes that don't exist at lookup time, CL 570036 and CL 588675
make Wait return unconditionally return ErrProcessDone when using pidfd,
rather than attempting to make a wait system call.
This is consistent with Signal/Kill, but inconsistent with the previous
behavior of Wait, which would pass through the kernel error,
syscall.ECHILD.
Switch the ErrProcessDone case to return syscall.ECHILD instead for
consistency with previous behavior.
That said, I do think a future release should consider changing ECHILD
to ErrProcessDone in all cases (including when making an actual wait
system call) for better consistency with Signal/Kill/FindProcess.
Fixes #67926.
Cq-Include-Trybots: luci.golang.try:gotip-darwin-amd64_14,gotip-solaris-amd64,gotip-openbsd-amd64
Change-Id: I1f688a5751d0f3aecea99c3a5b35c7894cfc2beb
Reviewed-on: https://go-review.googlesource.com/c/go/+/591816
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Clide Stefani [Fri, 7 Jun 2024 20:37:13 +0000 (16:37 -0400)]
crypto/tls: improve error log produced during TestBogoSuite
The existing implementation logs some errors to the results file created in TestBogoSuite.
This change would additionally log json errors to the results file.
Change-Id: Ib1a6f612ed83f6c5046531ee259c4e85dd71402a
Reviewed-on: https://go-review.googlesource.com/c/go/+/591379 Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Cherry Mui [Tue, 11 Jun 2024 14:21:11 +0000 (10:21 -0400)]
doc/next: document GORISCV64 environment variable
For #65614.
Updates #61476.
Change-Id: Id677aa6d2a59366ab75a26f08a383d2d253f270e
Reviewed-on: https://go-review.googlesource.com/c/go/+/591895
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Cherry Mui [Tue, 11 Jun 2024 14:08:19 +0000 (10:08 -0400)]
doc/next: document GOARM64 environment variable
For #65614.
Updates #60905.
Change-Id: I2dd9df3c7066357cf06268d918bad3c255b38aed
Reviewed-on: https://go-review.googlesource.com/c/go/+/591875
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
Jes Cok [Sat, 8 Jun 2024 01:47:51 +0000 (09:47 +0800)]
time: correct spelling, queing -> queuing
Change-Id: I418953a766db22b134a9569161f06cf8682c1eef
Reviewed-on: https://go-review.googlesource.com/c/go/+/591336
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Dana Burkart [Sat, 8 Jun 2024 03:30:30 +0000 (03:30 +0000)]
time: add to format documentation about dangers of using RFC1123{,Z} for parsing
When using time.RFC1123Z to parse the date header value out of an email,
an error is returned for dates that occur in the first 9 days of a
month. This is because the format strings for RFC 1123 defined in the
time package indicate that the day should be prefixed with a leading 0.
Reading the spec, the line that talks about it seems to indicate that
days can be either 1 or 2 digits:
`date = 1*2DIGIT month 2*4DIGIT`
So a date header with a day like `7` with no leading zero should be
accepted.
Fixes #67887
Change-Id: Ie7ee40d94da2c8c0417957e8b89f9987314949c8
GitHub-Last-Rev: 22a5a52fcb7ee25e5005bb9a014ef8a94d52fb32
GitHub-Pull-Request: golang/go#67888
Reviewed-on: https://go-review.googlesource.com/c/go/+/591335
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Kir Kolyshkin [Thu, 30 May 2024 21:00:40 +0000 (14:00 -0700)]
os: RemoveAll: fix error returned
When unlink fails, it is not yet known if the argument is a directory or not.
Since CL 588495, we figure out if it's a directory when trying to open
it (and, for a directory, return the original unlink error).
The (very minor) issue is, in case of a symlink, a different error is
returned -- usually it's ELOOP, but some systems use other values. Let's
account for that error code, too.
This is a followup to CL 588495.
Change-Id: I4ee10fe9b57f045fbca02f13e5c9ea16972803bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/589376 Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Ben Hoyt [Mon, 10 Jun 2024 08:49:33 +0000 (20:49 +1200)]
os/user: make Lookup* functions properly handle ENOENT
The libc docs say that these functions can return ENOENT, and
per issue #67912, this does happen in practice sometimes. Handle
both the ENOENT and !found cases the same way, for Lookup,
LookupId, LookupGroup, LookupGroupId.
Fixes #67912
Change-Id: I993935af44c83ad785b6cd735fc313a3647daa19
Reviewed-on: https://go-review.googlesource.com/c/go/+/591555 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Cherry Mui [Tue, 11 Jun 2024 14:30:16 +0000 (10:30 -0400)]
cmd/go: update link to RISC-V profile doc
The URL has changed.
Change-Id: I295020c59aaf64a89c4307fca527163095148a67
Reviewed-on: https://go-review.googlesource.com/c/go/+/591897 Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: M Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Cherry Mui [Tue, 11 Jun 2024 14:25:33 +0000 (10:25 -0400)]
doc/next: resolve a TODO for openbsd/riscv64 port
I think we want to keep the "experimental" as we did before. Also
added "64-bit" to be more specific.
For #65614.
Change-Id: I928d0ba6f1b53efa1f882f81f68bfb2446c7ab42
Reviewed-on: https://go-review.googlesource.com/c/go/+/591896 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Robert Griesemer [Tue, 11 Jun 2024 15:57:37 +0000 (08:57 -0700)]
go/types, types2: add missing Unalias calls in type unifier
The unification code has "early exits" when the compared
types are pointer-identical.
Because of Alias nodes, we cannot simply compare x == y but we
must compare Unalias(x) == Unalias(y). Still, in the common case
there are no aliases, so as a minor optimization we write:
x == y || Unalias(x) == Unalias(y)
to test whether x and y are (pointer-) identical.
Add the missing Unalias calls in the place where we forgot them.
Fixes #67872.
Change-Id: Ia26ffe7205b0417fc698287a4aeb1c900d30cc0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/591975 Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
Michael Pratt [Fri, 24 May 2024 15:16:30 +0000 (11:16 -0400)]
os: overhaul handling of PID vs pidfd within Process
There are several issues with pidfd handling today:
* The zero value of a Process makes the handle field appear valid, so
methods attempt to use it as a pidfd rather than falling back to the
PID as they should (#67634).
* If a process doesn't exist, FindProcess returns a Process with Pid ==
-2, which is not a compatible change (#67640).
* pidfd close is racy as-is. A Release call or successful Wait will
clear the handle field and close the pidfd. However, a concurrent call
may have already loaded the handle field and could then proceed to use
the closed FD (which could have been reopened as a different pidfd,
targeting a different process) (#67641).
This CL performs multiple structural changes to the internals of
Process.
First and foremost, each method is refactored to clearly select either
pidfd or raw pid mode. Previously, raw pid mode was structured as a
fallback when pidfd mode is unavailable. This works fine, but it does
not make it clear that a given Process object either always uses pidfd
or always uses raw pid. Since each mode needs to handle different race
conditions, it helps to make it clear that we can't switch between modes
within a single Process object.
Second, pidfd close safety is handled by reference counting uses of the
FD. The last user of the FD will close the FD. For example, this means
that with concurrent Release and Signal, the Signal call may be the one
to close the FD. This is the bulk of this CL, though I find the end
result makes the overall implementation easier to reason about.
Third, the PID path handles a similar race condtion between Wait and
Kill: Wait frees the PID value in the kernel, which could be reallocated
causing Kill to target the wrong process. This is handled with a done
flag and a mutex. The done flag now shares the same state field used for
the handle.
Similarly, the Windows implementation reuses all of the handle reference
counting that Linux uses. This means the implementations more
consistent, and make Windows safe against the same handle reuse
problems. (Though I am unsure if Windows ever reuses handles).
Wait has a slight behavior change on Windows: previously Wait after
Release or an earlier Wait would hang indefinitely (WaitForSingleObject
on syscall.InvalidHandle waits indefinitely). Now it returns the same
errors as Linux (EINVAL and ErrProcessDone, respectively).
Similarly, Release on Windows no longer returns close errors, as it may
not actually be the place where the close occurs.
Than McIntosh [Mon, 10 Jun 2024 14:25:22 +0000 (14:25 +0000)]
cmd/compile/internal/ssa: fix DWARF location expr for .closureptr
CL 586975 added support to the compiler back end to emit a synthetic
".closureptr" variable in range func bodies, plus code to spill the
incoming context pointer to that variable's location on the stack.
This patch fixes up the code in the back end that generates DWARF
location lists for incoming parameters (which sometimes arrive in
registers) in the "-l -N" no-optimization case to also create a
correct DWARF location list for ".closureptr", a two-piece list
reflecting the fact that its value arrives in a register and then is
spilled to the stack in the prolog.
Fixes #67918.
Change-Id: I029305b5248b8140253fdeb6821b877916fbb87a
Reviewed-on: https://go-review.googlesource.com/c/go/+/591595
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Robert Griesemer [Mon, 10 Jun 2024 17:27:26 +0000 (10:27 -0700)]
cmd/compile/internal/syntax: return correct start pos for KeyValueExprs
Fixes #67866.
Change-Id: Id9d345aab87e493b8ed94319c5acaa1900362648
Reviewed-on: https://go-review.googlesource.com/c/go/+/591695 Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Andrew W. Phillips [Tue, 29 Aug 2023 10:55:59 +0000 (20:55 +1000)]
cmd/go/internal/work: avoid panic for a repeated //go:debug setting
The creation of a bytes.Buffer in one code path is missing causing a nil
pointer dereference.
Changed (as rec. by Bryan Mills) to use fmt.Appendf() on []byte instead of
fmt.Fprintf on *bytes.Buffer - simpler and avoids duplicated code (but
requires Go 1.19 or later).
Added test to verify the change (as rec. by Michael Matloob) at
src\cmd\go\testdata\script\build_repeated_godebug_issue62346.txt
Fixes #62346
Change-Id: Ic3267d878a6f7ebedb1cde64e6206de404176b10
Reviewed-on: https://go-review.googlesource.com/c/go/+/523836 Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
Jes Cok [Sat, 8 Jun 2024 01:53:38 +0000 (09:53 +0800)]
cmd/compile/internal/types2: fix typo in comment for StoreTypesInSyntax
Change-Id: Ia73b15b6df5e6f88741f2b54258d7cbad0239ddd
Reviewed-on: https://go-review.googlesource.com/c/go/+/591396 Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Rodrigo Orselli [Fri, 7 Jun 2024 19:51:10 +0000 (19:51 +0000)]
sync: include links to the Go memory model in package documentation
The lack of links to https://go.dev/ref/mem in the sync package
documentation makes it difficult to read for people who have no previous
knowledge of that page. This PR includes the links where needed.
Fixes #67891
Change-Id: I0e1344cc6d7b702f4cb2e55fe0fcee3eb089391a
GitHub-Last-Rev: 427cf58aaeaae2e4b060248dd592e5fe8c6b7df4
GitHub-Pull-Request: golang/go#67892
Reviewed-on: https://go-review.googlesource.com/c/go/+/591395 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Kir Kolyshkin [Thu, 23 May 2024 20:43:45 +0000 (13:43 -0700)]
syscall: rm go:linkname from origRlimitNofile
Since CL 588076 runc can do fine without the kludge. The code accessing the symbol is now guarded with `go:build !go1.23` in all supported runc branches (main: [1], release-1.1: [2]).
Change-Id: I204843a93c36857e21ab9b43bd7aaf046e8b9787
Reviewed-on: https://go-review.googlesource.com/c/go/+/587918
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qiulaidongfeng [Wed, 5 Jun 2024 19:06:31 +0000 (19:06 +0000)]
os/exec: on Windows look for extensions in Run if not already done
CL 512155 fixed #36768, but introduced #62596.
CL 527820 fixed #62596, but meant that the code failed to look up
file extensions on Windows for a relative path.
This CL fixes that problem by recording whether it has already
looked up file extensions.
This does mean that if Path is set manually then we do not update
it with file extensions, as doing that would be racy.
Fixes #66586
Change-Id: I9a0305d1e466c5e07bfbe442566ea12f5255a96e
GitHub-Last-Rev: dc3169f2350f61acac5ef7842b7514013abacbe1
GitHub-Pull-Request: golang/go#67035
Reviewed-on: https://go-review.googlesource.com/c/go/+/581695
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Mon, 3 Jun 2024 21:00:51 +0000 (21:00 +0000)]
iter: don't iterate if stop is called before next on Pull
Consider the following code snippet:
next, stop := iter.Pull(seq)
stop()
Today, seq will iterate exactly once before it notices that its
iteration is invalid to begin with. This effect is observable in a
variety of ways. For example, if the iterator panics, since that panic
must propagate to the caller of stop. But if the iterator is stateful in
anyway, then it may update some state.
This is somewhat unexpected and because it's observable, can be depended
upon. This behavior does not align well with other possible
implementations of Pull, like CPS performed by the compiler. It's also
just odd to let even one iteration happen, precisely because of
unexpected state modification.
Fix this by not iterating at all of the done flag is set before entering
the iterator.
For #67712.
Change-Id: I18162e29df45a2e8968f68379450d92e1de47c4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/590075 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Anthony Knyszek [Fri, 31 May 2024 20:10:09 +0000 (20:10 +0000)]
iter: propagate panics from the iterator passed to Pull
This change propagates panics from the iterator passed to Pull through
next and stop. Once the panic occurs, next and stop become no-ops (the
iterator is invalidated).
For #67712.
Change-Id: I05e45601d4d10acdf51b53e3164bd891c1b324ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/589136 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Paul E. Murphy [Wed, 5 Jun 2024 21:12:49 +0000 (16:12 -0500)]
cmd/compile/ssa: fix (MOVWZreg (RLWINM)) folding on PPC64
RLIWNM does not clear the upper 32 bits of the target register if
the mask wraps around (e.g 0xF000000F). Don't elide MOVWZreg for
such masks. All other usage clears the upper 32 bits.
Fixes #67844.
Change-Id: I11b89f1da9ae077624369bfe2bf25e9b7c9b79bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/590896 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qiulaidongfeng [Thu, 6 Jun 2024 13:50:29 +0000 (13:50 +0000)]
cmd/go: avoid when go.env contain GOTOOLCHAIN=local test fail
The test fail when $GOROOT/go.env contain GOTOOLCHAIN=local
because GOTOOLCHAIN=local is assumed to be a non-default value.
This CL fixed the test failure
by using go.env from the test as $GOROOT/go.env throughout the test.
Test have also been added to ensure that
when $GOROOT/go.env contain GOTOOLCHAIN=local,
GOTOOLCHAIN=local is not taken as a non-default value.
Fixes #67793
Change-Id: Ibc5057d38d36c6c55726a039de1e7c37d6935b52
GitHub-Last-Rev: 12b62464e671021320c54e251dfb1ebcb5925096
GitHub-Pull-Request: golang/go#67807
Reviewed-on: https://go-review.googlesource.com/c/go/+/590196 Reviewed-by: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>