Commit graph

60209 commits

Author SHA1 Message Date
Robert Griesemer ee29dbe43e go/types, types2: don't lose alias information during unification
While at it, rename asTypeParam to asBoundTypeParam for clarity.

For #67547.
Fixes #67628.

Change-Id: I2f447c4cd4d72f5315fe9323d82fcb9bf33657c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/588797
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-29 02:09:51 +00:00
RTann c26be72d68 archive/zip: fix UncompressedSize godoc
Change-Id: I0c142eb18af7b03759041e894bbce0f365ea9d7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/588116
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-28 21:41:09 +00:00
Michael Matloob 8e2b3ac705 cmd/go: add release notes for go telemetry, and telemetry env values
This change fills in the release notes for the go telemetry command as
well as the unsettable GOTELEMETRY and GOTELEMETRYDIR go env values.

For #67111

Change-Id: Id6943f79f7ab2457787e1639d8d5fb1c1e2649dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/587923
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-28 19:06:07 +00:00
Michael Matloob 94aeedc33a cmd/go/internal/load: clone pgo variant's PackagePublic.Imports in split
Before this change the pgo and non-pgo variants Imports slices pointed
to the same array, so modifying the pgo variant's Imports slice to add
the .ForMain suffix modified the non-pgo vairant's Imports slice too.
This change clones the imports slice to avoid that.

Fixes #66218

Change-Id: Ic936086f2c31f2056988d6546216142e4fce4d8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/588275
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-28 17:00:51 +00:00
Dmitri Shuralyov 377646589d text/template: clarify error when too few or too many return values
Prior to CL 561115, calling a function without any return values would
print "function called with 0 args; should be 1 or 2". Afterwards, the
error message became "too many return values".

Keep the improvement of referring to return values rather than args,
and bring back clarity about their actual and permitted numbers.

Change-Id: I2c014e4633208cc7052fac265a995a8f2fe68151
Reviewed-on: https://go-review.googlesource.com/c/go/+/588355
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 22:23:55 +00:00
Michael Anthony Knyszek a2eae66c30 doc: add release notes for a couple minor tracing features
For #65614.

Change-Id: I759bf671b8f84c5224798b0dfaee6b158fdcc95a
Reviewed-on: https://go-review.googlesource.com/c/go/+/587927
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 21:37:09 +00:00
Zxilly c506f035d9 text/template: add detailed info for goodFunc check
goodFunc now returns a error describe the exact error it met.
builtin call function can print the name of the callee function
if the goodFunc check failed.

For input {{call .InvalidReturnCountFunc}}

before:
  can't evaluate field InvalidReturnTypeFunc in type *template.T
after:
  invalid function signature for .InvalidReturnTypeFunc: second argument should be error; is bool

Change-Id: I9aa53424ac9a2bffbdbeac889390f41218817575
GitHub-Last-Rev: 7c1e0dbd08
GitHub-Pull-Request: golang/go#65509
Reviewed-on: https://go-review.googlesource.com/c/go/+/561115
Reviewed-by: Rob Pike <r@golang.org>
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>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-24 21:22:24 +00:00
Michael Anthony Knyszek b89f946c88 internal/trace: remove last references to internal/trace/v2
This change removes the last few references to internal/trace/v2.
Notably, it shows up in the generators' imports, so they'll fail to run
currently.

Change-Id: Ibc5a9c1844634ea7620558e270ca3db9921ba56e
Reviewed-on: https://go-review.googlesource.com/c/go/+/587930
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 21:15:28 +00:00
Kir Kolyshkin 22a80e78ea syscall: Setrlimit: always clean rlimitNofileCache
Since the introduction of origRlimitNofileCache in CL 476097 the only way to
disable restoring RLIMIT_NOFILE before calling execve syscall
(os.StartProcess etc) is this:

	var r syscall.Rlimit
	syscall.Getrlimit(syscall.RLIMIT_NOFILE, &r)
	syscall.Setrlimit(syscall.RLIMIT_NOFILE, &r)

The problem is, this only works when setrlimit syscall succeeds, which
is not possible in some scenarios.

Let's assume that if a user calls syscall.Setrlimit, they
unconditionally want to disable restoring the original rlimit.

For #66797.

Change-Id: I20d0365df4bd6a5c3cc8c22b0c0db87a25b52746
Reviewed-on: https://go-review.googlesource.com/c/go/+/588076
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
2024-05-24 21:10:10 +00:00
Cherry Mui 5c7d774538 cmd/link: propagate FromAssembly attribute when cloning symbols to external
When a symbol is cloned to external (in order to edit it),
propagate the FromAssembly attribute, so the linker knows it is
(originally) an assembly symbol, and can treat it specially (e.g.
for stack maps).

This should fix the Linux/RISCV64 builder.

Change-Id: Icc956bcc43b79f328983a60835b05fd50f22326a
Reviewed-on: https://go-review.googlesource.com/c/go/+/587926
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-24 20:26:10 +00:00
Cherry Mui 23778fcb27 cmd/link: print the seed in TestRandLayout
When the test fails, print the seed, to help debug.

Change-Id: I1530ce433f3c6b573fbba061452f57c7649cad77
Reviewed-on: https://go-review.googlesource.com/c/go/+/587925
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 20:26:02 +00:00
Michael Anthony Knyszek 54efef99b2 iter: deflake TestPull by letting exiting goroutines finish
Currently TestPull is flaky because goroutines spawned to run subtests
exit asynchronously when they finish and TestPull has explicit checks
for the number of existing goroutines.

This is pretty much only a problem between subtests executing, because
within each subtest the coroutine goroutine spawned for iter.Pull always
exits fully synchronously before the final `next` or `stop` returns.

So, we can resolve the problem by ensuring the first goroutine count the
test takes likely doesn't contain any exiting goroutines. The trick is
to set GOMAXPROCS=1 and spin in runtime.Gosched until the number of
goroutines stabilizes to some reasonable degree (we pick 100 consecutive
iterations; there are only a handful of possible goroutines that can
run, so this is giving that handful around 20 chances to actually run to
completion).

When running TestPull under stress2, this issue is easily reproducible
before this CL. After this CL, it no longer reproduces under these
conditions.

Fixes #66017.

Change-Id: I4bf0a9771f7364df7dd58f8aeb3ae26742d5746f
Reviewed-on: https://go-review.googlesource.com/c/go/+/587917
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 19:15:10 +00:00
Andy Pan 1c924572d0 runtime: fix the inconsistency of kq parameter of addWakeupEvent
Change-Id: I4f1668ed9085cf19c3eff17c237601a91d0660db
Reviewed-on: https://go-review.googlesource.com/c/go/+/587876
Reviewed-by: Carlos Amedee <carlos@golang.org>
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>
2024-05-24 17:15:46 +00:00
Andy Pan 7bc7039a6a syscall: prevent redundant newline from empty $extraimports
Currently mksyscall script produces one redundant newline
when $extraimports is empty, leading to a gofmt warning
reported by "git codereview change".

Change-Id: I57b0fa040347375698973e777285deded16ab62e
Reviewed-on: https://go-review.googlesource.com/c/go/+/587877
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 17:15:02 +00:00
qiulaidongfeng a7f6da78d2 cmd/go: env changed flag respects $GOROOT/go.env
From $GOROOT/go.env file got GOPROXY and GOSUMDB and GOTOOLCHAIN default value.

Fixes #67542

Change-Id: I0cb2e1ab6a32963288ae463a9b0bd92ac6719447
GitHub-Last-Rev: fda9be48b9
GitHub-Pull-Request: golang/go#67564
Reviewed-on: https://go-review.googlesource.com/c/go/+/587160
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2024-05-24 17:13:51 +00:00
kenshi kamata 85115da5d3 errors: change interface{} to any in comment
Change-Id: Ibf28c4b3026019427a2485230e14929ed80a1727
Reviewed-on: https://go-review.googlesource.com/c/go/+/587255
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: Carlos Amedee <carlos@golang.org>
2024-05-24 17:13:04 +00:00
Alan Donovan 60e6986612 .github/ISSUE_TEMPLATE/03-gopls.yml: use textarea for gopls version
The output of "gopls version" is multiple lines.

Change-Id: Ic00734b05011098d408db6f49f86c4e2c8edfa24
Reviewed-on: https://go-review.googlesource.com/c/go/+/587924
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2024-05-24 17:09:04 +00:00
Dmitri Shuralyov 960cd14124 doc/README: suggest a way to preview next content, tweak release steps
Smaller edits are usually fine to do without previewing, since Markdown
can be intuitive. But for larger changes including re-ordering sections
and such, it can be helpful to quickly see the end result. Write down a
way to do that.

Update the release steps to capture that the doc/next content will move
to x/website before RC 1, when the complete release note draft is ready.

For #64169.

Change-Id: Ie554ed5294ce819fd0689e2249e6013826f0c71f
Reviewed-on: https://go-review.googlesource.com/c/go/+/587922
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-05-24 16:43:34 +00:00
Russ Cox f85c40438f internal/runtime/exithook: make safe for concurrent os.Exit
Real programs can call os.Exit concurrently from multiple goroutines.
Make internal/runtime/exithook not crash in that case.

The throw on panic also now runs in the deferred context,
so that we will see the full stack trace that led to the panic.
That should give us more visibility into the flaky failures on
bugs #55167 and #56197 as well.

Fixes #67631.

Change-Id: Iefdf71b3a3b52a793ca88d89a9c270eb50ece094
Reviewed-on: https://go-review.googlesource.com/c/go/+/588235
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
2024-05-24 16:41:13 +00:00
Michael Matloob 378c48df3b cmd/go/internal/modload: fix bug in error message
CL 513756 moved the usage of modGo after it was set to its proper value,
so the error message text always listed the version of go as
"unspecified". Fix the error message in the case where the version was
set in the go.mod, and provide an error message where it wasn't.

Fixes #67587

Change-Id: I763f6be7ee811da32fcb7e785682fd6f48145981
Reviewed-on: https://go-review.googlesource.com/c/go/+/588075
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-24 15:54:40 +00:00
Michael Matloob 2785f4fad6 cmd/go/internal/telemetrystats: fix assignment to ok
Change-Id: I7ee6198949bd2ea7e92d3e75c94ead04c31be491
Reviewed-on: https://go-review.googlesource.com/c/go/+/588236
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-24 15:44:55 +00:00
Robert Griesemer 3ea2be1e47 go/types, types2: pull up Unalias call to cover all of cycleFinder.typ
Without a test because it's unclear the situation can actually occur,
but the code is correct because it now mimics the behavior without
explicit Alias nodes.

For #67547.

Change-Id: I21a31af28880ca6d599fe465563d9574c26ed1f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/588117
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>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-24 13:54:20 +00:00
Kir Kolyshkin 35ef4a9f33 runtime: x_cgo_getstackbound: initialize pthread attr
In glibc versions older than 2.32 (before commit 4721f95058),
pthread_getattr_np does not always initialize the `attr` argument,
and when it fails, it results in a NULL pointer dereference in
pthread_attr_destroy down the road.

This is the simplest way to avoid this, and an alternative to CL 585019.

Updates #65625.

Change-Id: If490fd37020b03eb084ebbdbf9ae0248916426d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/587919
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>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2024-05-24 03:44:11 +00:00
Robert Griesemer 2fe2e4d593 go/types, types2: document why Unalias is not needed in some places
Documentation change only.

For #67547.

Change-Id: I0da480299c33239bcd1e059f8b9c6d48d8f26609
Reviewed-on: https://go-review.googlesource.com/c/go/+/587820
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2024-05-23 23:17:08 +00:00
Robert Griesemer 13e3068b9c go/types, types2: add missing Unalias call to type string functionality
For #67547.

Change-Id: I999cd31f9a01f91e7984b4e7012c81e8bd9c6b06
Reviewed-on: https://go-review.googlesource.com/c/go/+/587940
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>
2024-05-23 21:17:10 +00:00
Dmitri Shuralyov acc93dac83 doc/next: populate TODOs found with relnote todo
This is the first round of TODOs created based on relnote todo output.
There are many entries that need to be documented, expanded, reworded,
and this change makes progress on setting that up.

For this cycle, relnote todo implemented a simple heuristic of finding
CLs that mention accepted proposals (see issue 62376, or comment
https://go.dev/issue/62376#issuecomment-2101086794 specifically).
The "Items that don't need to be mentioned in Go 1.23 release notes but
are picked up by relnote todo." section in todo.md contains an attempt
at reviewing that list. The large number of items needed to be reviewed
made it impractical to spend much time on any individual one.

For #65614.

Change-Id: Id9d5f1795575a46df2ec4ed0088de07ee6075a90
Reviewed-on: https://go-review.googlesource.com/c/go/+/588015
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-05-23 20:49:22 +00:00
Meng Zhuo 019353d532 test/codegen: add Mul test for riscv64
Change-Id: I51e9832317e5dee1e3fe0772e7592b3dae95a625
Reviewed-on: https://go-review.googlesource.com/c/go/+/586797
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 18:51:17 +00:00
limeidan 128a99decd cmd/link/internal/loong64: correct the musl dynamic linker path
Musl libc already supports loongarch64, the dynamic linker path is the
same as other architectures: /lib/ld-musl-$ARCH.so.1

Ref: https://git.musl-libc.org/cgit/musl/tree/INSTALL#n141

Change-Id: Ie31d4254f6e14a5d634b2a7b5fa4c6270e2c0dc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/569475
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Qiqi Huang <huangqiqi@loongson.cn>
2024-05-23 18:50:04 +00:00
Alan Donovan bf91eb3a8b std: fix calls to Printf(s) with non-constant s
In all cases the intent was not to interpret s as a format string.
In one case (go/types), this was a latent bug in production.
(These were uncovered by a new check in vet's printf analyzer.)

Updates #60529

Change-Id: I3e17af7e589be9aec1580783a1b1011c52ec494b
Reviewed-on: https://go-review.googlesource.com/c/go/+/587855
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2024-05-23 18:42:28 +00:00
Michael Matloob c34c124f40 cmd/go/internal/telemetrystats: handle cases where there's no patch
If there's no second dot assume the version is just a major.minor.

Change-Id: I765d6e8d7c1e63c695a0a3b0c047d86b989f95d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/587796
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-23 17:38:57 +00:00
Damien Neil 3ed007d754 net/http: remove TestTransportDialCancelRace
This test was added to cover a specific race condition
in request cancellation, applying only to the deprecated
Transport.CancelRequest cancellation path. The test
assumes that canceling a request at the moment
persistConn.RoundTrip begins guarantees that it will
be canceled before being sent.

This does not apply to the newer forms of canceling
a request: Request.Cancel and context-based cancellation
both send the cancel signal on a channel, and do not
check for cancellation before sending a request.

A recent refactoring unified the implementation
of cancellation, so the Transport.CancelRequest
path now translates into context-based cancellation
internally. This makes this test flaky, since
sometimes the request completes before we read
from the context's done channel.

Drop the test entirely. It's verifying the fix
for a bug in a code path which no longer exists,
and the property that it's testing for (canceling
a request at a very specific point in the internal
request flow) is not interesting.

Fixes #67533

Change-Id: I8d71540f1b44a64e0621d31a1c545c9351ae897c
Reviewed-on: https://go-review.googlesource.com/c/go/+/587935
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2024-05-23 16:36:03 +00:00
fanzha02 63c1e141bc cmd/compile: intrinsify atomic And/Or on arm64
The atomic And/Or operators were added by the CL 528797,
the compiler does not intrinsify them, this CL does it for
arm64.

Also, for the existing atomicAnd/Or operations, the updated
value are not used, but at that time we need a register to
temporarily hold it. Now that we have v.RegTmp, the new value
is not needed anymore. This CL changes it.

The other change is that the existing operations don't use their
result, but now we need the old value and not the new value for
the result.

And this CL alias all of the And/Or operations into sync/atomic
package.

Peformance on an ARMv8.1 machine:
                      old.txt       new.txt
                      sec/op         sec/op         vs base
And32-160            8.716n ± 0%    4.771n ± 1%  -45.26% (p=0.000 n=10)
And32Parallel-160    30.58n ± 2%   26.45n ± 4% -13.49% (p=0.000 n=10)
And64-160            8.750n ± 1%    4.754n ± 0%  -45.67% (p=0.000 n=10)
And64Parallel-160    29.40n ± 3%    25.55n ± 5%  -13.11% (p=0.000 n=10)
Or32-160             8.847n ± 1%    4.754±1%  -46.26% (p=0.000 n=10)
Or32Parallel-160     30.75n ± 3%    26.10n ± 4%  -15.14% (p=0.000 n=10)
Or64-160             8.825n ± 1%    4.766n ± 0%  -46.00% (p=0.000 n=10)
Or64Parallel-160     30.52n ± 5%    25.89n ± 6%  -15.17% (p=0.000 n=10)

For #61395

Change-Id: Ib1d1ac83f7f67dcf67f74d003fadb0f80932b826
Reviewed-on: https://go-review.googlesource.com/c/go/+/584715
Auto-Submit: Austin Clements <austin@google.com>
TryBot-Bypass: Austin Clements <austin@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Fannie Zhang <Fannie.Zhang@arm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 15:49:20 +00:00
Dmitri Shuralyov a5339da341 doc/next: document go mod tidy -diff flag
Add a release note for the flag that CL 585401 added.

For #27005.
For #65614.

Change-Id: Ib26eb1b85c511d3cb41a29a8d9354577dd9a0e14
Reviewed-on: https://go-review.googlesource.com/c/go/+/587695
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
2024-05-23 14:44:59 +00:00
Than McIntosh 9b5d27faf9 cmd/go,testdeps: move import of internal/coverage/cfile to testmain
Instead of having testing/internal/testdeps import the
internal/coverage/cfile package directly, have the code in testmain
pass in pointers to cfile functions during setup in the case that
we're running a "go test -cover" binary. This reduces the size of
regular non-coverage test binaries back to what they were before CL
585820.

Updates #67401.
Fixes #67588.

Change-Id: Iaf1a613bc7d3c9df9943189065d0161ca9120d34
Reviewed-on: https://go-review.googlesource.com/c/go/+/587795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2024-05-23 14:01:23 +00:00
Cherry Mui f109bdd127 runtime: update TestExitHooks error strings
The error strings were changed in CL 586259 and no longer include
"internal error". Update the strings in the test.

Should fix the longtest builders.

Change-Id: If227d4b79a8bf5e52a32c3b2eceb086241f079aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/587757
Auto-Submit: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-23 13:59:13 +00:00
Jes Cok 62711d61e5 maps: slightly improve iter tests
Change-Id: I330a06539e36f442470690187df9c3988c12bd50
Reviewed-on: https://go-review.googlesource.com/c/go/+/586855
Reviewed-by: 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: Dmitri Shuralyov <dmitshur@google.com>
2024-05-23 03:44:19 +00:00
Russ Cox bb88d28bf5 time: add a few more benchmarks
Preparation for upcoming optimizations.

For #63844.

Change-Id: I61803dd8b699e51c391614c99ebbd005df5261cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/586256
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-23 03:13:47 +00:00
Roland Shoemaker 9eeb627f60 crypto/tls: add ech client support
This CL adds a (very opinionated) client-side ECH implementation.

In particular, if a user configures a ECHConfigList, by setting the
Config.EncryptedClientHelloConfigList, but we determine that none of
the configs are appropriate, we will not fallback to plaintext SNI, and
will instead return an error. It is then up to the user to decide if
they wish to fallback to plaintext themselves (by removing the config
list).

Additionally if Config.EncryptedClientHelloConfigList is provided, we
will not offer TLS support lower than 1.3, since negotiating any other
version, while offering ECH, is a hard error anyway. Similarly, if a
user wishes to fallback to plaintext SNI by using 1.2, they may do so
by removing the config list.

With regard to PSK GREASE, we match the boringssl  behavior, which does
not include PSK identities/binders in the outer hello when doing ECH.

If the server rejects ECH, we will return a ECHRejectionError error,
which, if provided by the server, will contain a ECHConfigList in the
RetryConfigList field containing configs that should be used if the user
wishes to retry. It is up to the user to replace their existing
Config.EncryptedClientHelloConfigList with the retry config list.

Fixes #63369

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I9bc373c044064221a647a388ac61624efd6bbdbf
Reviewed-on: https://go-review.googlesource.com/c/go/+/578575
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 03:10:12 +00:00
Robert Griesemer 83ff4fd571 go/types, types2: factor out check for updated type arguments (cleanup)
Change-Id: I3e2668e4a24c145f121199a5f7f4278ff5d5f1da
Reviewed-on: https://go-review.googlesource.com/c/go/+/587676
Reviewed-by: Robert Griesemer <gri@google.com>
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>
2024-05-23 03:04:07 +00:00
Robert Griesemer f294ddeb29 go/types, types2: instantiate generic alias types
For #46477.

Change-Id: Ifa47d3ff87f67c60fa25654e54194ca8b31ea5a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/567617
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2024-05-23 03:01:18 +00:00
Russ Cox ff2070d939 runtime: move exit hooks into internal/runtime/exithook
This removes a //go:linkname usage in the coverage implementation.

For #67401.

Change-Id: I0602172c7e372a84465160dbf46d9fa371582fff
Reviewed-on: https://go-review.googlesource.com/c/go/+/586259
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-23 02:32:19 +00:00
Mordy Ovits fd1363240a doc: fix two instances of "the the" in godebug.md
Remove two instances of "the the" introduced recently
in CL 562343 and CL 562975.

Change-Id: Ib32ca80fcd6764343021c84135bd65853945c9ea
GitHub-Last-Rev: 0bd2c0b4bd
GitHub-Pull-Request: golang/go#67594
Reviewed-on: https://go-review.googlesource.com/c/go/+/587717
Reviewed-by: Ian Lance Taylor <iant@google.com>
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@google.com>
2024-05-23 01:45:30 +00:00
Michael Matloob d8b92c2e2d cmd/go/internal/work: add telemetry counters for build cache hits/misses
The following counters are added in this cl
    go/buildcache/hit
    go/buildcache/miss
    go/buildcache/stdlibrecompiled (incremented at most once per
        invocation)

Change-Id: Ia78e136feac8226cb35e554503b672343cc30262
Reviewed-on: https://go-review.googlesource.com/c/go/+/587577
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
2024-05-23 01:31:25 +00:00
Russ Cox 4cac885741 all: document legacy //go:linkname for modules with ≥200 dependents
Ignored these linknames which have not worked for a while:

github.com/xtls/xray-core:
	context.newCancelCtx removed in CL 463999 (Feb 2023)

github.com/u-root/u-root:
	funcPC removed in CL 513837 (Jul 2023)

tinygo.org/x/drivers:
	net.useNetdev never existed

For #67401.

Change-Id: I9293f4ef197bb5552b431de8939fa94988a060ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/587576
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 01:17:26 +00:00
Russ Cox 05cbbf985f all: document legacy //go:linkname for modules with ≥500 dependents
For #67401.

Change-Id: I7dd28c3b01a1a647f84929d15412aa43ab0089ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/587575
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 01:16:53 +00:00
Russ Cox 1d3d6ae725 all: document legacy //go:linkname for modules with ≥1,000 dependents
For #67401.

Change-Id: If23a2c07e3dd042a3c439da7088437a330b9caa4
Reviewed-on: https://go-review.googlesource.com/c/go/+/587222
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-23 01:16:50 +00:00
Russ Cox 519b0116a1 all: document legacy //go:linkname for modules with ≥2,000 dependents
For #67401.

Change-Id: I3ae93042dffd0683b7e6d6225536ae667749515b
Reviewed-on: https://go-review.googlesource.com/c/go/+/587221
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 01:16:47 +00:00
Russ Cox 9a3ef86173 all: document legacy //go:linkname for modules with ≥5,000 dependents
For #67401.

Change-Id: Ifea84af92017b405466937f50fb8f28e6893c8cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/587220
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
2024-05-23 01:15:13 +00:00
David Chase 50c298a5a3 cmd/compile: repairing variable names and comments
Change-Id: I2e775e92dcebf068426b3e2acbe088679c318ec4
Reviewed-on: https://go-review.googlesource.com/c/go/+/587578
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-23 01:05:44 +00:00
David Chase 997b6969fd internal/abi, cmd/compile, runtime: deduplicate rangefunc consts
Change-Id: I61ec5a7fa0c10f95ae2261c3349743d6fda2c1d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/587596
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
2024-05-23 01:04:30 +00:00