Russ Cox [Tue, 17 Dec 2024 15:40:41 +0000 (10:40 -0500)]
cmd/go: drop fips140 build ID hacks
We were trying to keep all binaries stale in fips140 mode
so that every build would write and leave behind a fips.o
in the work directory for use by validating labs.
That breaks various staleness checks, including the one
in cmd/dist during GOFIPS140=latest ./make.bash.
Revert the fips140 hack. Validating labs will still be able
to find the fips.o when building against a clean cache.
Add the default godebug to the link hash though,
so that it is clear that GOFIPS140=latest
and GOFIPS140=off binaries have different hashes.
(The only effect is the default GODEBUG setting.)
They already had different hashes, because the
default GODEBUG ends up in p.Internal.BuildInfo,
and that gets hashed in a "modinfo" line,
but better to be explicit.
Fixes #70873.
Change-Id: I49a38c180208098c2b6720facef48f4e96d44c54
Reviewed-on: https://go-review.googlesource.com/c/go/+/637116 Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Russ Cox [Wed, 18 Dec 2024 20:42:48 +0000 (15:42 -0500)]
cmd/go: fix two-step toolchain upgrade through go install, GOTOOLCHAIN
If we do one upgrade because of a go install target's go.mod file,
we still might need a second upgrade to implement the GOTOOLCHAIN
minimum. Instead of allowing a two-step switch (which we were
cutting off anyway), skip the first step and go straight to the
GOTOOLCHAIN min upgrade.
Fixes #69051.
Change-Id: I16f060f473574d8b8f84c55fae2fd0cdabc8aa19
Reviewed-on: https://go-review.googlesource.com/c/go/+/637496 Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michal Bohuslávek [Wed, 18 Dec 2024 12:32:37 +0000 (13:32 +0100)]
weak: improve grammar in doc comments
Change-Id: I577b8a6bf2b7d899cc7ff7211c73549c90db9d94
Reviewed-on: https://go-review.googlesource.com/c/go/+/637355 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 Knyszek <mknyszek@google.com>
Ian Lance Taylor [Tue, 17 Dec 2024 23:31:10 +0000 (15:31 -0800)]
testing: support B.Context and F.Context
CL 603959 added T.Context for #36532.
The discussion on the proposal only mentions t.Context.
However, the implementation of CL 603959 also added B.Context and F.Context.
They were added to the API listing, and B.Context was mentioned in
the release notes.
Unfortunately, the new B.Context and F.Context methods always
returned nil, rather than a context.Context value.
This change adds a working implementation of B.Context and F.Context.
For #36532
Fixes #70866
Change-Id: I8a44e6649fb658e4f641ffb7efd08b4374f578ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/637236
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Ian Lance Taylor [Tue, 17 Dec 2024 19:31:17 +0000 (11:31 -0800)]
debug/elf: adjust version API per issue discussion
This updates the new version API for the discussion on #63952.
Note that the current tests do not have symbols with hidden versions.
Leaving that for later.
For #63952
Change-Id: I1ad4b1e485429a216ba8e5b68f7f4299d120628f
Reviewed-on: https://go-review.googlesource.com/c/go/+/637235 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Filippo Valsorda [Mon, 16 Dec 2024 16:44:21 +0000 (17:44 +0100)]
crypto/internal/fips140: add Name and Version
Per ISO/IEC 19790:2012, Section 7.4.3.1.
> A cryptographic module shall [04.12] provide the following services to
> operators.
>
> a) Show module’s versioning information. The cryptographic module
> shall [04.13] output the name or module identifier and the versioning
> information that can be correlated with a validation record (e.g.
> hardware, software and/or firmware versioning information)."
For #69536
Change-Id: I8061f64e4ae60a4666f6abd892cb1301d6bf2452
Reviewed-on: https://go-review.googlesource.com/c/go/+/636558
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
wangshuo [Tue, 17 Dec 2024 12:50:44 +0000 (12:50 +0000)]
cmd, go: fix some typos
Change-Id: I0fd54ae5294eb4ef30cdef05adb8825f69077b14
GitHub-Last-Rev: ccfa48cbe4525dc2bd60e9ac7e2c150e480ba13f
GitHub-Pull-Request: golang/go#70823
Reviewed-on: https://go-review.googlesource.com/c/go/+/635915 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Oleksandr Redko [Tue, 17 Dec 2024 17:05:23 +0000 (19:05 +0200)]
bytes, strings: add cross-references in docstrings
For newly funcs SplitSeq, SplitAfterSeq, FieldsSeq, FieldsFuncSeq.
Updates #61901.
Change-Id: I3c97bfd9c2250de68aaea348c82a05635ee797af
Reviewed-on: https://go-review.googlesource.com/c/go/+/637176
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Oleksandr Redko [Tue, 17 Dec 2024 18:14:16 +0000 (20:14 +0200)]
cmd/go/internal/help: use secure link to swig.org
Change-Id: Ifd315128ceeddf92bc16647869c3ace77ed1f430
Reviewed-on: https://go-review.googlesource.com/c/go/+/637195 Reviewed-by: Michael Matloob <matloob@golang.org>
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>
Damien Neil [Tue, 3 Dec 2024 20:22:49 +0000 (12:22 -0800)]
syscall, internal/syscall/unix: fix fstatat on linux/mips64
On linux/mips64, the syscall.Stat_t struct does not match the
kernel version of the struct. Functions that operate on a Stat_t
translate between it and the kernel struct.
The fstatat function was not doing this translation.
Make it do so.
Export a syscall.Fstatat on mips64 for usage by
internal/syscall/unix. Perhaps we should just do this on all
architectures, but this is the smaller change for now.
Fixes #70659
Change-Id: I38e36473689be25861953b418c9abc5b270a7bcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/633280
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Robert Griesemer [Thu, 12 Dec 2024 19:31:49 +0000 (11:31 -0800)]
spec: explain function invocation and passing of parameters more precisely
- Describe that function invocation allocates space for a functions'
variables.
- Explain parameter passing in terms of assignments.
Change-Id: Ia693d73a570f7d1aa2ac05e6095b4e602e4e9bf2
Reviewed-on: https://go-review.googlesource.com/c/go/+/635800 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Rob Pike <r@golang.org>
Filippo Valsorda [Mon, 16 Dec 2024 18:24:20 +0000 (19:24 +0100)]
crypto/internal/fips140/aes: mark AES-ECB as not approved
NIST SP 800-131Ar3 ipd, scheduled for publication in 2025Q1, marks
AES-ECB as disallowed for encryption, and legacy use for decryption.
There are apparently no details on how the transition is going to work,
so to avoid surprises we just mark direct use of the Block as
non-approved.
We need to use Encrypt from higher level modes without tripping the
service indicator. Within the aes package, we just use the internal
function. For the gcm package we could do something more clever, but
this deep into the freeze, just make an exported function that we commit
to use nowhere else.
I could not figure out a decent way to block ECB on GODEBUG=fips140=only.
For #69536
Change-Id: I972a4b5da8efd0a0ab68d7dd509bec73aa2d6b68
Reviewed-on: https://go-review.googlesource.com/c/go/+/636775 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Matloob [Fri, 13 Dec 2024 22:33:16 +0000 (17:33 -0500)]
cmd/go/testdata/script: update test_flags for new test output
With CL 635856, an error for a package missing go files is now caught at
load time rather than at build time, so it's reported differently.
Update the test to check for the correct output unbreak the builders.
For #70820
Change-Id: I91fcac17961635b9a92782caa58c9a6f057a7e02
Reviewed-on: https://go-review.googlesource.com/c/go/+/637115 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>
Ian Lance Taylor [Mon, 16 Dec 2024 23:38:43 +0000 (15:38 -0800)]
fmt, strconv: document that exponent is always two digits
Except for %b where it is only one.
Fixes #70862
Change-Id: Ic423a799b73bfa534f4083f6544bb9cd639fef06
Reviewed-on: https://go-review.googlesource.com/c/go/+/636915
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Michael Matloob [Fri, 13 Dec 2024 22:33:16 +0000 (17:33 -0500)]
cmd/go: don't create test actions for incomplete packages
If a package is incomplete, don't create the actions for building and
testing it. Instead report the errors for the package's dependencies
and report a setup failed error (similar to what we'd to for a load
error when producing the test packages). This produces similar errors to
what were produced by load.CheckPackageErrors while still produing the
test failure actions per package under test.
(I wasn't sure what to do about the last test case in test_setup_error.
I think it should be treated the same as other load errors?)
Fixes #70820
Change-Id: Ie95e3c158c50ed35a1f27237ef3db40502719993
Reviewed-on: https://go-review.googlesource.com/c/go/+/635856 Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Matloob <matloob@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Michael Anthony Knyszek [Fri, 13 Dec 2024 23:18:59 +0000 (23:18 +0000)]
runtime: usleep in TestWeakToStrongMarkTermination
There's a subtle bug in this test (big surprise): time.Sleep allocates,
so the time.Sleep(100*time.Millisecond) before unblocking gcMarkDone
might itself end up in gcMarkDone.
Work around this by using usleep here instead.
Fixes #70532.
Change-Id: I4c642ebb12f737cdb0d79ccff64b6059fc3d8b34
Reviewed-on: https://go-review.googlesource.com/c/go/+/636155 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Austin Clements [Fri, 13 Dec 2024 02:18:44 +0000 (21:18 -0500)]
testing: don't measure cleanup time after B.Loop
B.Loop resets the timer on the first iteration so that setup code
isn't measured, but it currently leaves the timer running after the
last iteration, meaning that cleanup code will still be measured. Fix
this by stopping the timer when B.Loop returns false to indicate the
end of the benchmark.
Updates #61515
Change-Id: I0e0502cb2ce3c24cf872682b88d74e8be2c4529b
Reviewed-on: https://go-review.googlesource.com/c/go/+/635898 Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Austin Clements [Thu, 12 Dec 2024 23:19:43 +0000 (18:19 -0500)]
testing: improve b.Loop example
The current b.Loop example doesn't focus on the basic usage of b.Loop.
Replace this with a new example that uses (slightly) more realistic
things to demonstrate the most salient points of b.Loop.
We also move the example into an example file so that we can write a
real Benchmark function and a real function to be benchmarks, which
makes this much closer to what a user would actually write.
Updates #61515.
Change-Id: I4d830b3bfe3eb3cd8cdecef469fea0541baebb43
Reviewed-on: https://go-review.googlesource.com/c/go/+/635896
Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Austin Clements [Thu, 12 Dec 2024 20:43:37 +0000 (15:43 -0500)]
testing: improve B.Loop docs, use B.Loop in examples
This updates the testing documentation to frame B.Loop as the
canonical way to write benchmarks. We retain documentation on b.N
benchmarks because people will definitely continue to see them (and
write them), but it's demoted to clearly second class.
This also attempts to clarify and refine the B.Loop documentation
itself.
Austin Clements [Fri, 13 Dec 2024 20:36:47 +0000 (15:36 -0500)]
cmd/go: drop FailedBuild field if gotestjsonbuildtext=1
go test -json has two new effects in Go 1.24: it implies go build
-json, and it adds a FailedBuild field in test events. For
compatibility, CL 629335 added gotestjsonbuildtext=1, which disables
the implicit go build -json, but that CL didn't affect the FailedBuild
field. In principle this shouldn't matter because it's just another
JSON field, but just so we don't have to worry about some intermediate
behavior, this CL makes gotestjsonbuildtext=1 disable the FailedBuild
field as well.
Updates #62067
Updates #70402
Change-Id: I006d1ea0468980ee2564495324e8b4ed082898af
Reviewed-on: https://go-review.googlesource.com/c/go/+/635899
Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: 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>
This is part of a series of CLs that aim to reduce how often interface
arguments escape for the print functions in fmt.
Currently, method values are one of two reasons reflect.Value.Interface
always escapes its reflect.Value.
Our later CLs modify behavior around method values, so we add some tests
of function formatting (including method values) to help reduce the
chances of breaking behavior later.
We also add in some allocation tests focused on interface arguments for
the print functions. These currently do not show any improvements
compared to Go 1.21.
These tests were originally in a later CL in our stack (CL 528538),
but we split them out into this CL and moved them earlier in the stack.
Updates #8618
Change-Id: Iec51abc3b7f86a2711e7497fc2fb7a678b9f8f73
Reviewed-on: https://go-review.googlesource.com/c/go/+/529575 Reviewed-by: Carlos Amedee <carlos@golang.org>
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>
Michael Pratt [Fri, 13 Dec 2024 15:26:50 +0000 (10:26 -0500)]
runtime: migrate missing map linkname allowlists
The swissmap implementation forgot to copy some of the linkname
allowlists from the old implementation. Copy them from map_noswiss.go.
Some were missing linkname entirely; others were linknamed but missing
the hall of shame comment.
For #54766.
Change-Id: Icc715384123e73d868b4cb729ab639abcd6bbfd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/635995 Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: Ib1b14b8880c6de5606f7f425a5fc1c8749d8a4b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/635799
TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Ian Lance Taylor [Thu, 12 Dec 2024 22:07:13 +0000 (14:07 -0800)]
syscall: on freebsd-386 only update written for certain errors
Testing on the freebsd-386 gomote seems to show that sendfile returns
a non-zero number of bytes written even when it returns EINVAL.
This confuses the caller. Change the Go code to only return non-zero
on success or EINTR or EAGAIN, which are the only cases where the
man page says that sendfile updates the number of bytes.
For #70763
Change-Id: Icc04e6286b5b29a2029237711d50fe4973234f0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/635815 Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Oleksandr Redko [Thu, 12 Dec 2024 18:08:35 +0000 (20:08 +0200)]
net: fix example function name for IP.To4
Change-Id: Ia9a2c3a9f53792173cd1fb9f8e1a078fe3444945
Reviewed-on: https://go-review.googlesource.com/c/go/+/635136
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Cherry Mui [Thu, 12 Dec 2024 19:31:45 +0000 (14:31 -0500)]
cmd/internal/obj: disallow linknamed access to builtin symbols
Currently, a symbol reference is counted as a reference to a
builtin symbol if the name matches a builtin. Usually builtin
references are generated by the compiler. But one could manually
write one with linkname. Since the list of builtin functions are
subject to change from time to time, we don't want users to depend
on their names. So we don't count a linknamed reference as a
builtin reference, and instead, count it as a named reference, so
it is checked by the linker.
Change-Id: Id3543295185c6bbd73a8cff82afb8f9cb4fd6f71
Reviewed-on: https://go-review.googlesource.com/c/go/+/635755 Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Wed, 11 Dec 2024 22:02:28 +0000 (14:02 -0800)]
internal/poll: in SendFile treat ENOTSUP like EOPNOTSUPP
Fixes #70763
Change-Id: Ifb79b5b0529f7977df0fe1b59d224b8b31df2c9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/635396 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Ian Lance Taylor [Wed, 11 Dec 2024 04:05:06 +0000 (20:05 -0800)]
cmd/cgo: use full prototype for main in C code
Avoids pedantic errors from modern C compilers.
Fixes #70769
Change-Id: Ibe0d9960e998eb0346b97d7bd69eb7de0d0e6c60
Reviewed-on: https://go-review.googlesource.com/c/go/+/635095 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Wed, 11 Dec 2024 03:48:11 +0000 (19:48 -0800)]
debug/elf: adjust version API per issue discussion
This updates the new version API for the discussion on #63952.
This change reveals that in fact none of the tests set the
VERSYM_HIDDEN bit. The code before this CL set the hidden flag
for symbols that appear in DynamicVersionNeed, but that is not
an accurate representation of the ELF. The readelf program
does print undefined symbols that way (with a single '@'),
but that doesn't mean that the hidden flag is set.
Leaving tests with the hidden bit set for later.
For #63952
Change-Id: Ida60831e0c9922dfc10f10c7a64bc76a2b197537
Reviewed-on: https://go-review.googlesource.com/c/go/+/635079 Reviewed-by: Austin Clements <austin@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>
Filippo Valsorda [Wed, 11 Dec 2024 13:50:00 +0000 (14:50 +0100)]
crypto: use provided random Reader in FIPS mode
This removes the difference in behavior between FIPS mode on and off.
Instead of the sentinel type we could have moved the Reader to the
drbg package and checked for equality, but then we would have locked the
crypto/rand.Reader implementation to the one in the FIPS module (which
we might have to support for years).
In internal/ed25519.GenerateKey we remove the random parameter entirely,
since that function is not actually used by crypto/ed25519.GenerateKey,
which instead commits to being deterministic.
Fixes #70772
Change-Id: Ic1c7ca2c1cd59eb9cd090a8b235c0ce218921ac5
Reviewed-on: https://go-review.googlesource.com/c/go/+/635195 Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Jonathan Amsterdam [Wed, 11 Dec 2024 19:38:57 +0000 (14:38 -0500)]
log/slog: make DiscardHandler example package-level
Fixes #70782.
Change-Id: I8e8b763040bd10147eb7d1a30ac0774e28f90911
Reviewed-on: https://go-review.googlesource.com/c/go/+/635217
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Sam Thanawalla [Wed, 11 Dec 2024 15:41:05 +0000 (15:41 +0000)]
cmd/go: add more tests for GOAUTH's user provided authenticator
For #26232
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Change-Id: I4b6eb63d4c1d71983e1ae764a6a38744a5f01317
Reviewed-on: https://go-review.googlesource.com/c/go/+/635255
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Ian Lance Taylor [Wed, 11 Dec 2024 16:59:04 +0000 (08:59 -0800)]
cmd/compile: update broken link
Fixes #70778
Change-Id: Ie5ed53aa39446beb0316eb134cc705ea06b37435
Reviewed-on: https://go-review.googlesource.com/c/go/+/635295
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Antonio Ojea [Wed, 11 Dec 2024 15:03:59 +0000 (15:03 +0000)]
net: avoid unnecessary interface lookup fetching all interface addresses
InterfaceAddrs returns a list of the system's unicast interface addresses.
In order to do so, the function reuses the existing helpers and
list first all addresses with the netlink call RTM_GETADDR, then
all interfaces with RTM_GETLINK, and later it merge both lists
(each address references an interface).
However, the list of interfaces and addresses are obtained at
different times and there can be inconsistencies and, if an
address references an interface that is not present in the list
of interfaces, the function fails with an error.
Since the function InterfaceAddress is only about the system
addresses, there is no need to list all the interfaces, and we can
obtain the list of addresses directly from the netlink call RTM_GETADDR.
There is no need to correlate this list with the list of interfaces, as
the OS is the source of truth and should be the one providing the
consistency between addresses and interfaces.
Fixes #51934
Change-Id: I3b816e8146b1c07fdfe1bf6af338f001ef75734f
Reviewed-on: https://go-review.googlesource.com/c/go/+/635196 Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: 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>
zfdx123 [Wed, 11 Dec 2024 04:17:11 +0000 (04:17 +0000)]
internal/goos: fix bug in gengoos.go
CL 601357 mistakenly added an extra period.
Change-Id: I54db621663797f094059a4eb86bf5d9626fa59d6
GitHub-Last-Rev: c756e0a82427c44b00bd88547dc40bf88c85fc1f
GitHub-Pull-Request: golang/go#70733
Reviewed-on: https://go-review.googlesource.com/c/go/+/634517
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>
Cherry Mui [Tue, 10 Dec 2024 17:00:10 +0000 (12:00 -0500)]
cmd/internal/objfile: break out dissassemblers to another package
Currently, cmd/internal/objfile provides dissassembly routines for
various architectures, which depend on dissassemblers from x/arch.
cmd/internal/objfile is imported in tools that need dissassembly
(objdump, pprof) and tools that don't need dissassembly (nm,
addr2line). Adding/improving disassembly support for more
architectures can cause binary size increase, and for some tools
(nm, addr2line) it is not necessary.
This CL breaks out dissassembly routines to a different package,
which is only imported in tools that need dissassembly. Other
tools can depend on cmd/internal/objfile without the disassembly
code from x/arch.
This reduces binary sizes for those tools. On darwin/arm64,
Kir Kolyshkin [Tue, 10 Dec 2024 20:10:13 +0000 (12:10 -0800)]
syscall: remove a wrong comment in Clearenv
The comment being removed was added by commit ff3173849e
(which predates Gerrit and Rietveld, so no CL link), and
at the time it made sense.
Since CL 148370043 (and up to the current implementation of Clearenv)
the env map, which is populated by copyenv, is actually used, so the
comment is no longer valid.
It is also misleading, so it's best to remove it.
Change-Id: I8bd2e8bca6262759538e5bcbd396f0c71cca6a4c
Reviewed-on: https://go-review.googlesource.com/c/go/+/635078 Reviewed-by: Carlos Amedee <carlos@golang.org> 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>
Ian Lance Taylor [Wed, 11 Dec 2024 00:10:27 +0000 (16:10 -0800)]
reflect: consistently document when value must be settable
Fixes #70760
Change-Id: Ia00723698b7e502fa2c63f8f1dbe1143af22e0a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/634799 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Damien Neil [Tue, 10 Dec 2024 17:49:45 +0000 (09:49 -0800)]
runtime: avoid panic in expired synctest timer chan read
When reading from time.Timer.C for an expired timer using
a fake clock (in a synctest bubble), the timer will not
be in a heap. Avoid a spurious panic claiming the timer
moved between synctest bubbles.
Drop the panic when a bubbled goroutine reads from a
non-bubbled timer channel: We allow bubbled goroutines
to access non-bubbled channels in general.
Fixes #70741
Change-Id: I27005e46f4d0067cc6846d234d22766d2e05d163
Reviewed-on: https://go-review.googlesource.com/c/go/+/634955
Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Tom Thorogood [Tue, 10 Dec 2024 12:52:49 +0000 (23:22 +1030)]
crypto/internal/fips140/ecdsa: fix reseed_counter check for HMAC_DRBG_Generate_algorithm
SP 800-90A Rev. 1 10.1.2.5 step 7 requires
reseed_counter = reseed_counter + 1
as the final step before returning SUCCESS.
This increment of reseedCounter was missing, meaning the reseed interval
check at the start of Generate wasn't actually functional.
Given how it's used, and that it has a reseed interval of 2^48, this
condition will never actually occur but the check is still required by
the standard.
For #69536
Change-Id: I314a7eee5852e6d0fa1a0a04842003553cd803e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/634775 Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Michael Anthony Knyszek [Mon, 9 Dec 2024 19:21:48 +0000 (19:21 +0000)]
runtime: make special offset a uintptr
Currently specials try to save on space by only encoding the offset from
the base of the span in a uint16. This worked fine up until Go 1.24.
- Most specials have an offset of 0 (mem profile, finalizers, etc.)
- Cleanups do not care about the offset at all, so even if it's wrong,
it's OK.
- Weak pointers *do* care, but the unique package always makes a new
allocation, so the weak pointer handle offset it makes is always zero.
With Go 1.24 and general weak pointers now available, nothing is
stopping someone from just creating a weak pointer that is >64 KiB
offset from the start of an object, and this weak pointer must be
distinct from others.
Fix this problem by just increasing the size of a special and making the
offset a uintptr, to capture all possible offsets. Since we're in the
freeze, this is the safest thing to do. Specials aren't so common that I
expect a substantial memory increase from this change. In a future
release (or if there is a problem) we can almost certainly pack the
special's kind and offset together. There was already a bunch of wasted
space due to padding, so this would bring us back to the same memory
footprint before this change.
Also, add tests for equality of basic weak interior pointers. This
works, but we really should've had tests for it.
Fixes #70739.
Change-Id: Ib49a7f8f0f1ec3db4571a7afb0f4d94c8a93aa40
Reviewed-on: https://go-review.googlesource.com/c/go/+/634598
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Michael Knyszek <mknyszek@google.com>
Paul Cacheux [Sun, 8 Dec 2024 20:45:48 +0000 (21:45 +0100)]
runtime: remove datadog-agent from prof labels hall of shame
github.com/DataDog/datadog-agent has stopped using runtime_setProfLabel
and runtime_getProfLabel, remove them from the hall of shame.
Updates #67401
Change-Id: I4a66c5e70397d43d7f064aeae5bad064e168316f
Reviewed-on: https://go-review.googlesource.com/c/go/+/634476
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Michael Anthony Knyszek [Sat, 7 Dec 2024 02:58:00 +0000 (02:58 +0000)]
weak: align weak.Pointer documentation with runtime.AddCleanup
In hindsight, I think the "advice" I wrote is a bit heavy-handed and
better suited for something like the GC guide. Listing the use-cases
seems good, and all the possible things that go wrong seems to do the
trick in terms of deterrence, like it does with finalizers.
Also, include some points I missed, like the tiny allocator warning and
the fact that weak pointers are not guaranteed to ever return nil.
Also, a lot of this actually shouldn't have been in the package docs.
Many of the warnings only apply to weak pointers, but not other data
structures that may live in this package in the future, like weak-keyed
maps.
Change-Id: Id245661540ffd93de4b727cd272284491d085c1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/634376 Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Petr Osetrov [Fri, 6 Dec 2024 21:51:36 +0000 (21:51 +0000)]
bufio: make the description of Peek's behavior better
Previously, based on the description, it was not obvious that Peek could
change the buffer. It may have been mistakenly assumed that Peek would
always return an error if n is greater than b.Buffered().
Change-Id: I095006dd2ba1c2138bb193396cb24e2dda42d771
GitHub-Last-Rev: 9d48f8ac81f46d5b8f4a1885af28cbccd1747c3b
GitHub-Pull-Request: golang/go#70712
Reviewed-on: https://go-review.googlesource.com/c/go/+/634175 Reviewed-by: Carlos Amedee <carlos@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> Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Sean Liao [Mon, 2 Dec 2024 18:32:36 +0000 (18:32 +0000)]
cmd/go: document the build cache as safe for concurrent use
Fixes #26677
Change-Id: I2ca0408503000ccaddb0bd1fd359381ddd4fb699
Reviewed-on: https://go-review.googlesource.com/c/go/+/632895 Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Dmitri Shuralyov [Sat, 7 Dec 2024 22:48:27 +0000 (17:48 -0500)]
lib/wasm: provide fs.constants.O_DIRECTORY definition
CL 606658 added a constants.Get("O_DIRECTORY").Int() call at init time,
which panics in browsers because O_DIRECTORY is undefined. It needs to
be a JavaScript number to avoid that.
Fixes #70723.
Change-Id: I727240bd25b47401d14a5e1a364d460708803f1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/634455
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Zxilly Chou <zhouxinyu1001@gmail.com>
Austin Clements [Sat, 7 Dec 2024 01:43:16 +0000 (20:43 -0500)]
runtime: improve AddCleanup documentation
Steer people from SetFinalizer to AddCleanup. Address some of the
*non*-constraints on AddCleanup. Add some of the subtlety from the
SetFinalizer documentation to the AddCleanup documentation.
Updates #67535.
Updates #70425.
Change-Id: I8d13b756ca866051b8a5c19327fd5a76f5e0f3d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/634318 Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com>
Michael Pratt [Fri, 6 Dec 2024 20:37:34 +0000 (15:37 -0500)]
runtime: add note that Callers never returns an entry PC
The presence of a pc > entry check in CallersFrame implies we might
actually see pc == entry, when in reality Callers will never return such
a PC. This check is actually just a safety check for avoid reporting
completely nonsensical from bad input.
all.bash reports two violations to this invariant:
TestCallersFromWrapper, which explicitly constructs a CallersFrame input
with an entry PC.
runtime/pprof.printStackRecord, which passes pprof stacks to
CallersFrame (technically not a valid use of CallersFrames!).
runtime/pprof.(*Profile).Add can add the entry PC of
runtime/pprof.lostProfileEvent to samples.
(CPU profiles do lostProfileEvent + 1. I will send a second CL to fix
Add.)
Change-Id: Iac2a2f0c15117d4a383bd84cddf0413b2d7dd3ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/634315
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Paul Cacheux [Fri, 6 Dec 2024 13:06:36 +0000 (14:06 +0100)]
cmd/internal/goobj: add missing symbol align field in top level doc
Fix the documentation of the symbol's align field that is present in the
code but not in the top level documentation
Change-Id: I753f2379b22487899ceee8ebc9c2e659d74ea986
Reviewed-on: https://go-review.googlesource.com/c/go/+/633777 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Dmytro Yeroshkin [Fri, 6 Dec 2024 15:49:52 +0000 (15:49 +0000)]
encoding/base64, encoding/base32: add doc details to DecodeString and AppendDecode
Currently only Encoding.Decode has the information that `\r` and
`\n` are ignored. However, this also applies to the other decoding
methods. Since this is not intuitive behavior, we should add this
information to the other impacted methods.
Change-Id: I6f71fe1f4280fe75f2694a3cc1b759652eb8b8c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/634215 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Chris Ingram <chrisingram@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Truc Le <trucleduc@google.com>
Conrad Irwin [Sun, 1 Dec 2024 05:08:44 +0000 (22:08 -0700)]
cmd/go: add tool meta-pattern to go help packages
For #48429
Change-Id: I6932853c3156a68d099a749431d15d2c37785649
Reviewed-on: https://go-review.googlesource.com/c/go/+/632555 Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
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>
Conrad Irwin [Fri, 6 Dec 2024 05:25:14 +0000 (22:25 -0700)]
cmd/go: report tool errors in go list all
Before tools there was no way to directly import a package in another
module, and so missing packages were always marked as "all" due to being
dependencies of a package in a main module.
Tools break that assumption, and so to report errors in tool packages
correctly we need to mark packages as being in "all" even if they do not
exist.
Fixes #70582
Change-Id: I3273e0ec7910894565206de77986f5c249a5658c
Reviewed-on: https://go-review.googlesource.com/c/go/+/634155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Michael Matloob [Tue, 26 Nov 2024 01:29:11 +0000 (20:29 -0500)]
cmd/go: use AppendPath(OrigEnv) as env for tool executable
Before this change, when go tool wass used to start a tool defined in a
go.mod tool directive, it used the environment the go command was
running in. The issue with doing that is that the go command sets
various environment variables from the computed environment when
invoking a subcommand. That is used to standardise the environment for
the various tools invoked by the go command, but it is not the
expectatation of tools invoked by the go command, especially since those
environment variables may change the behavior of the tool run. Instead
use the same environment we use in go run to start the executable: the
original environment (with minor modifications) saved before we start
explicitly setting the envornment, with GOROOT/bin added to the path so
that sub commands that run the go tool use the proper go tool binary.
Fixes #70544
Change-Id: Ifbf0040a2543113638eec7232323eb9de1d61529
Reviewed-on: https://go-review.googlesource.com/c/go/+/631836 Reviewed-by: Conrad Irwin <conrad.irwin@gmail.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Anthony Knyszek [Thu, 5 Dec 2024 21:52:49 +0000 (21:52 +0000)]
all: update vendored dependencies [generated]
The Go 1.24 RC is due for next week. This is a time to once again update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.
For #36905.
[git-generate]
go install golang.org/x/build/cmd/updatestd@latest
go install golang.org/x/tools/cmd/bundle@latest
updatestd -goroot=$(pwd) -branch=master
Change-Id: If4fd03a18590ff3b6e701a9698370c57c69979c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/634041
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Michael Matloob [Thu, 5 Dec 2024 20:31:39 +0000 (15:31 -0500)]
cmd/go: consistently use DefaultExecName for executable name
go tool, go run, and the executable caching logic have all used
path.Base of a package's import path to set the name of the executable
produced. But the base name for a package name that's the same as a
module name ending in a major version is just that major version, which
is not very useful. For go build and go install, we use
load.DefaultExecName as the name of the binary which will select the
second to last element of the import path as the name of the executable
produced. This change changes go tool, go run, and the executable
caching logic to all use DefaultExecName consistently to pick the name
of the executable.
Change-Id: I8e615bbc6a4f9cc4549165c31954fab181d63318
Reviewed-on: https://go-review.googlesource.com/c/go/+/634039 Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Conrad Irwin <conrad.irwin@gmail.com>
Conrad Irwin [Sun, 1 Dec 2024 06:22:49 +0000 (23:22 -0700)]
cmd/go: add -modfile and -modcacherw to go tool
When adding support for module tools, we added the ability for `go tool`
to edit the module cache. For users with `GOFLAGS=-modcacherw` this
could have led to a situation where some of the files in the mod cache
were unexpectedly not deletable.
We also allow -modfile so that people can select which module they are
working in when looking for tools.
We still do not support arbitrary build flags for tools with `go tool`.
If you want those, use `go run` or `go build`, etc. instead.
Updates #48429
Change-Id: Ic3c56bb8b6ba46114196465ca6ee2dcb08b9dcc0
Reviewed-on: https://go-review.googlesource.com/c/go/+/632575 Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Jorropo [Fri, 6 Dec 2024 05:51:04 +0000 (06:51 +0100)]
testing: fix divide by zero when benchmark is faster than OS's clock resolution
I did not added a test because `benchmark_test.go` is `package testing_test`
and I don't care to change that because calling predictN is not testing the
thing I would want to test.
Ideally we would run benchmark in a VM with a highjacked clocksource that never
marches forward, or using faketime but that looks fairly involved for a quickie
fix.
Fixes #70709
Change-Id: I8b4d697aff7cba33da388cb0ae8e2c2b550b9690
Reviewed-on: https://go-review.googlesource.com/c/go/+/633419 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Cherry Mui [Thu, 5 Dec 2024 16:39:07 +0000 (11:39 -0500)]
cmd/compile: update default PGO profile
Since last time the default.pgo profile is collected, there has
been a lot of development in the compiler. It's time to refresh
the compiler's PGO profile.
Profile collected by running the cmd/compile/profile.sh script on
the gotip-linux-arm64_c4ah72-perf_vs_release gomote.
Damien Neil [Mon, 2 Dec 2024 20:45:55 +0000 (12:45 -0800)]
cmd/internal/objabi, internal/runtime: increase nosplit limit on OpenBSD
OpenBSD is bumping up against the nosplit limit, and openbsd/ppc64
is over it. Increase StackGuardMultiplier on OpenBSD, matching AIX.
Change-Id: I61e17c99ce77e1fd3f368159dc4615aeae99e913
Reviewed-on: https://go-review.googlesource.com/c/go/+/632996 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Ian Lance Taylor [Thu, 5 Dec 2024 23:44:26 +0000 (15:44 -0800)]
crypto/hkdf: add package doc comment
For #61477
Change-Id: I3d3ebf573a21f1f56edfffb3fea53c0b5cbfccd8
Reviewed-on: https://go-review.googlesource.com/c/go/+/634095 Reviewed-by: Roland Shoemaker <roland@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@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Gopher Robot [Thu, 5 Dec 2024 21:25:20 +0000 (21:25 +0000)]
doc/next: delete
The release note fragments have been merged and added
as _content/doc/go1.24.md in x/website in CL 634056.
For #68545.
Change-Id: I7b3840df01b8c3699681c0cd21a16af70f74d31d
Reviewed-on: https://go-review.googlesource.com/c/go/+/634057
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Junyang Shao [Wed, 4 Dec 2024 20:11:18 +0000 (20:11 +0000)]
testing: improve documentation, examples, release notes for
testing.b.Loop.
This CL added documentation of the no-inlining semantic of b.Loop, with
a concrete example. This CL also tries to improve the release note to be
more descriptive.
Fixes #61515
Change-Id: I1e13cc92d5d6bdbf40fb44f44475e249747b807f
Reviewed-on: https://go-review.googlesource.com/c/go/+/633536 Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Junyang Shao <shaojunyang@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com>
Michael Matloob [Tue, 3 Dec 2024 21:23:18 +0000 (16:23 -0500)]
cmd/go/testdata/script: skip EndSequence entries in build_trimpath_cgo
The TestScript/build_trimpath_cgo test for cmd/go has been accessing a
nil pointer when it tries to look up LineEntry.File.Name on a line entry
with EndSequence set to true. The doc for EndSequence specifies that if
EndSequence is set, only it and the Address field are meaningful. Skip
the entries with EndSequence set when building the set of files.
Fixes #70669
Change-Id: I421a2a9348e727e3ac4a3d42baa4d206cfbc047b
Reviewed-on: https://go-review.googlesource.com/c/go/+/633038
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@golang.org>
Conrad Irwin [Sun, 1 Dec 2024 05:13:52 +0000 (22:13 -0700)]
doc/next: introduce module tools
Fixes #48429
Change-Id: Ie1954fc3bedd7d36cafaf3835b6c3a92326393f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/632556 Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Russ Cox [Thu, 5 Dec 2024 03:08:35 +0000 (22:08 -0500)]
crypto/internal/fips140/bigmod: add more //go:norace annotations
//go:norace does not carry over when a function is inlined.
Add //go:norace to functions that inline loops over Nat words.
Improves race tests, also asan, msan.
Cherry Mui [Thu, 5 Dec 2024 16:35:37 +0000 (11:35 -0500)]
doc/next: add release notes for Wasm changes
Document wasmexport and WASI reactor/library mode. Also document
that we now permit more types for wasmimport.
Fixes #65199.
Updates #66984.
For #68545.
Change-Id: Id26a8c9496650cd154daed679b82223af1848eea
Reviewed-on: https://go-review.googlesource.com/c/go/+/634036 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Sean Liao [Thu, 28 Nov 2024 16:23:53 +0000 (16:23 +0000)]
cmd/go: drop -v from go help get
Fixes #37301
Change-Id: I6d6ac818a73b907638f62d56bd5a7f00a6e6a5ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/632178
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Sean Liao [Wed, 4 Dec 2024 21:56:45 +0000 (21:56 +0000)]
embed: document exclusions more explicitly
Fixes #45197
Fixes #45744
Change-Id: Ic221da1b652f693c7aa37287932c0a8726f46765
Reviewed-on: https://go-review.googlesource.com/c/go/+/633815 Reviewed-by: Michael Knyszek <mknyszek@google.com> 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>
thepudds [Thu, 5 Dec 2024 04:36:17 +0000 (23:36 -0500)]
weak: fix subheading syntax in package doc
Go doc comments only support one level of heading.
Change-Id: I458f211bc7547a0676a59fdcb72f52ca480bf184
Reviewed-on: https://go-review.googlesource.com/c/go/+/633881
Auto-Submit: 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> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Michael Anthony Knyszek [Wed, 4 Dec 2024 19:33:26 +0000 (19:33 +0000)]
weak: massage package docs a little bit
This is an attempt to clarify the "advice" section of the package docs a
little bit and encourage a specific style of use for weak structures.
It's not perfect, but it's something.
Change-Id: Id84b76d207619cc2e78439c5c903ec9575199734
Reviewed-on: https://go-review.googlesource.com/c/go/+/633675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Sean Liao [Wed, 4 Dec 2024 21:50:30 +0000 (21:50 +0000)]
math/bits: update reference to debruijn paper
The old link no longer works.
Fixes #70684
Change-Id: I8711ef7d5721bf20ef83f5192dd0d1f73dda6ce1
Reviewed-on: https://go-review.googlesource.com/c/go/+/633775
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Matloob [Tue, 3 Dec 2024 20:09:41 +0000 (15:09 -0500)]
cmd/go/internal/cache: always check error from stat in markUsed
markUsed was not checking that the error from os.Stat was nil before
trying to access the FileInfo entry returned by it. Instead, always
check the error and return false if it's non-nil (usually because the
file does not exist). This can happen if an index entry exists in the
cache, but the output entry it points to does not. markUsed is called at
different points for the index entry and for the output entry, so it's
possible for the index entry to be marked used, and then for another go
process to trim the cache, deleting the output entry. I'm not sure how
likely that is, or if this is what has been triggering the user observed
instances of #70600, but it's enough for a test case.
Fixes #70600
Change-Id: Ia6be14b4a56736d06488ccf93c3596fff8159f22
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/633037 Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Jorropo [Wed, 4 Dec 2024 03:50:29 +0000 (04:50 +0100)]
sync/atomic: add missing leak tests for And & Or
Theses tests were forgot because when CL 462298 was originally written
And & Or atomics were not available in go.
Git were smart enough to rebase over And's & Or's addition.
After most reviews and before merging it were pointed I should
make theses new intrinsics noescape.
When doing this last minute addition I forgot to add tests.
Change-Id: I457f98315c0aee91d5743058ab76f256856cb782
Reviewed-on: https://go-review.googlesource.com/c/go/+/633416 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Jorropo [Wed, 4 Dec 2024 12:07:08 +0000 (13:07 +0100)]
math/rand/v2: replace <= 0 with == 0 for Uint function docs
This harmonize the docs with (*Rand).Uint* functions.
And it make it clearer, I wasn't sure if it would try to interpret
the uint as a signed number somehow, it does not pull any surprises
make that clear.
Change-Id: I5a87a0a5563dbabfc31e536e40ee69b11f5cb6cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/633535
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>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Alexey Palazhchenko [Wed, 4 Dec 2024 03:19:08 +0000 (03:19 +0000)]
runtime: remove "hall of shame" comment from public documentation
See https://pkg.go.dev/runtime@go1.23.4#FuncForPC
The updated comment uses the same format as bytes.Repeat and math.Float32bits.
Change-Id: Idfbc38645e6b0f03fb07f294c4c79b997d9a01a1
GitHub-Last-Rev: 00fa155c75fb625be84edeadff49276e6cddc42c
GitHub-Pull-Request: golang/go#70671
Reviewed-on: https://go-review.googlesource.com/c/go/+/633475
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> Reviewed-by: Michael Knyszek <mknyszek@google.com>