qmuntal [Tue, 11 Feb 2025 18:23:11 +0000 (18:23 +0000)]
make.bat,race.bat: simplify --dist-tool handling
make.bat accepts the --dist-tool flag on multiple flag positions
and also allows omitting the trailing dash. Doing so adds complexity
and is not aligned with the make.bash and make.rc behavior. Remove that
flexibility to simplify the code and make it more consistent. This also
fixes a bug where dist.exe wouldn't be removed from cmd\dist when
running make.bat --dist-tool.
Also, there is no need for race.bat to invoke make.bat with --dist-tool.
It uses it to get the GOHOSTARCH env value, but we can already get
that from the built-in PROCESSOR_ARCHITECTURE env variable.
Change-Id: Ia673562c1ae6aff9bd3ec7aa8cdd25ff187eeb79
Reviewed-on: https://go-review.googlesource.com/c/go/+/648615 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Change-Id: I4a6ef9a99dfe520f3177e0e7c258326475690f5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/648455
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Change-Id: I31240af30a73ee9f0ef00f47129738860378ea8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/648436 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I337bf824a71fce6c796a1440b7f08c4f5413d92f
Reviewed-on: https://go-review.googlesource.com/c/go/+/648435 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Michael Anthony Knyszek [Tue, 28 Jan 2025 20:54:34 +0000 (20:54 +0000)]
internal/trace: interpret string ID arguments for experimental events
Currently one of the reasons experimental events are tricky to use is
because:
- There's no way to take advantage of the existing infrastructure, like
strings and stacks, and
- There's no way to attach arbitrary data to an event (except through
strings, possibly).
Fix this by abstracting away the raw arguments in an ExperimentalEvent
and requiring access to the arguments via a new method, ArgValue. This
returns a Value, which gives us an opportunity to construct a typed
value for the raw argument dynamically, and a way to access existing
tables. The type of the argument is deduced from conventions for the
argument's name. This seems more than sufficient for experimental
events.
To make this work, we also need to add a "string" variant to the Value
type. This may be a little confusing since they're primarily used for
metrics, but one could imagine other scenarios in which this is useful,
such as including build information in the trace as a metric, so I think
this is fine.
This change also updates the Value API to accomodate a String method for
use with things that expect a fmt.Stringer, which means renaming the
value assertion methods to have a "To" prefix.
Change-Id: I43a2334f6cd306122c5b94641a6252ca4258b39f
Reviewed-on: https://go-review.googlesource.com/c/go/+/645135 Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Michael Anthony Knyszek [Mon, 27 Jan 2025 21:42:34 +0000 (21:42 +0000)]
internal/trace: clean up parser.go
parser.go is an old file that contains trace v1 definitions and a second
equivalent definition for stack frames. These are redundant and useless.
Delete these definitions and rename the file to fakep.go, which
describes the only thing left in this file, a bunch of fake P IDs used
by the trace viewer.
We should consider moving the fake P definitions elsewhere, too.
Change-Id: Ifd0768bd73c39009069445afe0155f1e352f00c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/644875 Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Anthony Knyszek [Wed, 29 Jan 2025 17:17:04 +0000 (17:17 +0000)]
runtime: use internal/trace/tracev2 definitions
This change deduplicates trace wire format definitions between the
runtime and the trace parser by making the internal/trace/tracev2
package the source of truth.
Change-Id: Ia0721d3484a80417e40ac473ec32870bee73df09
Reviewed-on: https://go-review.googlesource.com/c/go/+/644221
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The bat files can use "if" + parentheses to make it easier to
understand how the if-case is handled rather than the more cryptic
"if" + "goto".
While here, replace some "goto"s with direct "exit" calls.
Change-Id: I20e1804439b5088f8f1e5cbf8676f3d58560109d
Reviewed-on: https://go-review.googlesource.com/c/go/+/648375
Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: 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>
Sean Liao [Fri, 19 Jul 2024 22:28:54 +0000 (23:28 +0100)]
net/http/httptest: match net/http ContentLength behavior for http.NoBody
Fixes #68476
Change-Id: I05122e5ec5e6b290eec93f3db444fcf1de19c030
Reviewed-on: https://go-review.googlesource.com/c/go/+/599815
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Daniel Martí <mvdan@mvdan.cc>
Sean Liao [Sun, 9 Feb 2025 13:32:27 +0000 (13:32 +0000)]
cmd/go/internal/modload: don't set GIT_SSH_COMMAND
Allows git core.sshcommand to take effect when set by the user.
This was originally added to work around an issue in
OpenSSH < 7.3 (2016), see https://go.dev/issue/13453 .
A fixed version of OpenSSH should be widely available enough
that it is no longer necessary
Fixes #71482
Change-Id: I6f44cc354e8a4063e226cac78ec27117fcc40e93
Reviewed-on: https://go-review.googlesource.com/c/go/+/647995 Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Daniel Martí <mvdan@mvdan.cc>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Michael Anthony Knyszek [Mon, 10 Feb 2025 23:54:56 +0000 (23:54 +0000)]
internal/trace: increment sync counter before final Sync on error
CL 648195 was supposed to have fixed #71615, but it didn't include an
update to r.syncs. I can confirm this CL fixes the issue even when
running the test many times in a row.
Fixes #71615.
Change-Id: I97db3d639dc5bc8648a191696f90b0e5087307c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/648315
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>
cuishuang [Fri, 7 Feb 2025 09:11:36 +0000 (17:11 +0800)]
strings: add examples for Lines, SplitSeq, SplitAfterSeq, FieldsSeq and FieldsFuncSeq
Change-Id: I1e5085ff2ed7f3d75ac3dc34ab72be6b55729fb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/647575
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com> 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>
Damien Neil [Thu, 30 Jan 2025 23:53:06 +0000 (15:53 -0800)]
os: add Root.Chmod
For #67002
Change-Id: Id6c3a2096bd10f5f5f6921a0441dc6d9e6cdeb3b
Reviewed-on: https://go-review.googlesource.com/c/go/+/645718
Commit-Queue: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Daniel McCarney [Fri, 10 Jan 2025 16:10:12 +0000 (11:10 -0500)]
crypto/internal/fips140test: add RSA ACVP tests
Adds ACVP test coverage for the RSA algorithm based on the NIST spec:
https://pages.nist.gov/ACVP/draft-celi-acvp-rsa.html
Includes coverage for keyGen, sigGen and sigVer across a variety of
modulus sizes. For sigGen and sigVer both PKCS1v1.5 and PSS are
supported with a variety of SHA2 digests.
The static test data from go-acvp only includes sigVer vectors/expected.
The keyGen and sigGen test types aren't amenable to fixed data testing.
Updates #69642
Change-Id: Ia61a69115f2d2a984b95435a37d4c9c6db90a89a
Reviewed-on: https://go-review.googlesource.com/c/go/+/642135 Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
The implementation in our FIPS module fixes some parameters, requiring
tailoring of the advertised capability to match. Notably:
* We only support macModes CMAC-AES-128, -192, and -256
* We only support supportedLengths 256 (matching the [32]byte output
from CounterKDF.DeriveKey)
* We only support fixedDataOrder "before fixed data"
* We only support counterLength 16
No acvp_test.config.json update accompanies this support because the
ACVP tests for this algorithm aren't amenable to fixed data testing.
Updates #69642
Change-Id: I9e02d6c8cb6e209ac8e4c9fba926fffbad916098
Reviewed-on: https://go-review.googlesource.com/c/go/+/639776 Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@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>
Adds ACVP test coverage for the SP 800-90A rev 1 ctrDRBG algorithm based
on the NIST spec:
https://pages.nist.gov/ACVP/draft-vassilev-acvp-drbg.html#section-7.2
The implementation in our FIPS module is a minimal implementation
tailored to the specific needs of stdlib crypto. As a result we
customize the ACVP capability registration so that:
* predResistanceEnabled is false
* only mode AES-256 is supported
* for that mode,
* derFuncEnabled is false
* persoStringLen is 0 to disable personalization
* additionalInputLen is 384 to match the [48]byte argument in our API
Other capability values are chosen based on Table 4's ctrDRBG AES-256
w/o `derFuncEnabled` row:
https://pages.nist.gov/ACVP/draft-vassilev-acvp-drbg.html#section-7.4
We do enable reseed in the capability, necessitating two acvptool
commands: one that expects only 6 args and doesn't reseed
("ctrDRBG/AES-256"), and one that expects 8 args and does
("ctrDRBG-reseed/AES-256").
Updates #69642
Change-Id: I0f01a2f9496f45b130ee7d10916708093236f473
Reviewed-on: https://go-review.googlesource.com/c/go/+/639795 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Anthony Knyszek [Mon, 10 Feb 2025 20:10:22 +0000 (20:10 +0000)]
internal/trace: emit a Sync event even if the next generation is broken
Since CL 644215 each Sync event now represents the coming generation,
with a final Sync event emitted even when there's nothing ahead. This
change however failed to emit a Sync event at the end of a completely
valid generation when the next generation was invalid, causing the
runtime test TestCrashWhileTracing to start failing.
Fix this by emitting a final Sync event even when the next generation is
broken. We hold onto the error in parsing the next generation and emit
it after that final Sync event.
(Should these "final" Sync events distinguish themselves in some way?)
Fixes #71615.
Change-Id: I1f8abee5abaa39e1219e6fa05e9f82f1478db4c9
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/648195
Auto-Submit: 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>
There's no acvp_test.config.json update for this algorithm as one test
type type requires random key generation and can't be separated from the
test type that doesn't, making it a bad fit for static data testing.
Updates #69642
Change-Id: I3b6538fad1c1e5c8b14b638ff3b933f11e98f75a
Reviewed-on: https://go-review.googlesource.com/c/go/+/637916 Reviewed-by: Roland Shoemaker <roland@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: Dmitri Shuralyov <dmitshur@google.com>
Only SHA1, SHA2-224, SHA2-256, SHA2-384, and SHA2-512 are valid hash
algorithms for the SSH KDF algorithm. We do not include SHA-1 since it
is out of scope for our FIPS module.
Similarly only TDES, AES-128, AES-192 and AES-256 are valid ciphers, and
we do not include TDES.
Updates #69642
Change-Id: I70e45b77a91bd8aa631da30fab54c97e974f433c
Reviewed-on: https://go-review.googlesource.com/c/go/+/636355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Keith Randall [Mon, 9 Dec 2024 20:55:33 +0000 (12:55 -0800)]
cmd/compile: avoid ifaceeq call if we know the interface is direct
We can just use == if the interface is direct.
Fixes #70738
Change-Id: Ia9a644791a370fec969c04c42d28a9b58f16911f
Reviewed-on: https://go-review.googlesource.com/c/go/+/635435
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> 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>
WANG Xuerui [Sun, 9 Feb 2025 10:57:49 +0000 (18:57 +0800)]
cmd/go/internal/work: allow a bunch of loong64-specific flags
Recognize and allow all LoongArch-specific CFLAGS as standardized
in the LoongArch Toolchain Conventions v1.1, and implemented in current
versions of GCC and Clang, to enable advanced cgo use cases on loong64.
These flags are also allowed for linker invocations in case of possible
LTO.
While at it, also add support for -mtls-dialect as some C programs
may benefit performance-wise from the optional TLSDESC usage. This flag
is not specific to loong64 though; it is available for amd64, arm,
arm64, loong64, riscv64 and x86.
Fixes #71597.
Change-Id: I35d2507edb71fa324ae429a3ae3c739644a9cac1
Reviewed-on: https://go-review.googlesource.com/c/go/+/647956
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: Cherry Mui <cherryyz@google.com> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Meidan Li <limeidan@loongson.cn>
Tom Thorogood [Sun, 9 Feb 2025 02:12:25 +0000 (12:42 +1030)]
net/http: use standard time formatting methods
time.Time has had an AppendFormat method since go1.5 so there's no
need to carry around a custom implementation.
Change-Id: I8e7e5a9ac34e8bf251f5d70555405777ce4e22a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/647955
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Michael Anthony Knyszek [Wed, 29 Jan 2025 17:16:02 +0000 (17:16 +0000)]
internal/trace: merge event and tracev2 packages
These two packages were historically separate in an attempt to provide a
unified description of trace v1 and trace v2 formats. In practice this
turned out to be pointless, since it made more sense to keep the trace
v1 parser in a self-contained bubble with a converter to v2. Future
trace wire format migrations should probably just follow the same
general strategy, if there's a substantial change. (Minor changes can be
handled more organically.)
Change-Id: Ic765df62065fe53cfae59b505297527c3fa42dfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/645395
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Michael Anthony Knyszek [Fri, 24 Jan 2025 21:04:01 +0000 (21:04 +0000)]
internal/trace/internal/testgen: force trace version selection
Currently testgen only generates Go 1.22 tests. Allow generating tests
for different versions, especially now that we've tightened up which
events can be emitted by different versions.
Change-Id: Ia64309c6934f34eace03b3229d05fca5acfc7366
Reviewed-on: https://go-review.googlesource.com/c/go/+/644220 Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Michael Anthony Knyszek [Fri, 24 Jan 2025 20:56:47 +0000 (20:56 +0000)]
internal/trace: be stricter about allowed events in v2 trace versions
Currently all v2 trace versions, Go 1.22 and Go 1.23, share a full set
of specs. This is mostly OK, but it means quite a few events will be
accepted for 1.22 traces that should be rejected. This change fixes that
by limiting which event specs are returned by version.Version.Specs for
Go 1.22.
While we're here, let's be stricter about event names too, and move
tracev2.EventString to be a method on the version, so we can be more
precise. An intended consequence of this move is that tracev2 no longer
depends on fmt, since we will want the runtime to depend on tracev2 in
the near future.
Change-Id: If7285460c8ba59ab73da00993b7b12e61cdfe6a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/644219
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Michael Anthony Knyszek [Fri, 24 Jan 2025 20:36:51 +0000 (20:36 +0000)]
internal/trace: rename go122 to tracev2
This change follows up from the previous one which renamed oldtrace to
tracev1, defining everything Go 1.22+ as trace v2.
This change also re-maps some packages in preparation for sharing with
other parts of the standard library, like the runtime. It also cleans up
some other uses of 'go122' that are just a bit misleading. The mappings
are as follows:
Damien Neil [Fri, 7 Feb 2025 17:55:15 +0000 (09:55 -0800)]
runtime: establish happens-before between goroutine and bubble exit
synctest.Run waits for all bubbled goroutines to exit before returning.
Establish a happens-before relationship between the bubbled goroutines
exiting and Run returning.
For #67434
Change-Id: Ibda7ec2075ae50838c0851e60dc5b3c6f3ca70fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/647755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Michael Anthony Knyszek [Fri, 7 Feb 2025 23:22:50 +0000 (23:22 +0000)]
os: hide SetFinalizer from users of Root
Currently Root embeds a root and calls SetFinalizer on &r.root. This
sets the finalizer on the outer root, which is visible to users of
os.Root, and thus they can mutate the finalizer attached to it.
This change modifies Root to not embed its inner root, but rather to
refer to it by pointer. This allows us to set the finalizer on this
independent inner object, preventing users of os.Root from changing the
finalizer. This follows the same pattern as os.File's finalizer.
Fixes #71617.
Change-Id: Ibd199bab1b3c877d5e12ef380fd4647b4e10221f
Reviewed-on: https://go-review.googlesource.com/c/go/+/647876
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Only SHA2-256 and SHA2-384 are valid hash algorithms for the TLS1.3 KDF
algorithm.
The BoringSSL acvptool "lowers" the more complicated TLS 1.3 KDF ACVP
test cases into simple invocations of our module wrapper's pre-existing
HKDF commands, and the new "HKDFExtract/$HASH" and
"HKDFExpandLabel/$HASH" commands added in this branch.
Updates #69642
Change-Id: I5fb1af5b5b33c1845b27cf8968e6523e89bcc589
Reviewed-on: https://go-review.googlesource.com/c/go/+/636117 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
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>
Change-Id: Ia6899def452fcb63a03603b7919fcb0c3576474b
Reviewed-on: https://go-review.googlesource.com/c/go/+/622395 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Change-Id: Ic3c95411c23cab7427e63105170de41e5766f809
Reviewed-on: https://go-review.googlesource.com/c/go/+/647935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
pgxiaolianzi [Fri, 7 Feb 2025 08:37:50 +0000 (08:37 +0000)]
text/template: handle UnsafePointer in isTrue
Change-Id: I4d0b5919d109f768ba04ab519e8f948a5749a752
GitHub-Last-Rev: 6f27f1193c21bb10e3b81660b4271f2c1f33be1e
GitHub-Pull-Request: golang/go#70520
Reviewed-on: https://go-review.googlesource.com/c/go/+/631076
Run-TryBot: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Cherry Mui [Fri, 7 Feb 2025 22:42:02 +0000 (17:42 -0500)]
bytes: use "subslice" instead of "substring" in doc comments
The bytes package iterators return subslices, not substrings.
Updates #61901.
Change-Id: Ida91d3e33a0f178edfe9a267861adf4f13f9a965
Reviewed-on: https://go-review.googlesource.com/c/go/+/647875 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
cmd/compile: don't merge symbols on riscv64 when dynamic linking
Each plugin is compiled as a separate shared object,
with its own symbol table. When dynamic linking plugin symbols
are resolved within the plugin's scope, not globally merged to
avoid conflicts.
Change-Id: I9e6986085855c17fbd6c39b937cb6129d216f5e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/435015
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Robert Griesemer [Thu, 6 Feb 2025 21:51:51 +0000 (13:51 -0800)]
go/types, types2: better error messages for channel sends and receives
Use the same code pattern for sends and receives and factor it out
into a new helper method Checker.chanElem.
Provide the exact error cause rather than simply referring to the
core type.
For #70128.
Change-Id: I4a0b597a487b78c057eebe06c4ac28f9bf1f7719
Reviewed-on: https://go-review.googlesource.com/c/go/+/647455
Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Mon, 23 Dec 2024 19:44:42 +0000 (11:44 -0800)]
os: improve comments for process support, minor code cleanup
Change-Id: I97ecbc6fc0c73c6d8469144f86a7ad8c2655a658
Reviewed-on: https://go-review.googlesource.com/c/go/+/638581 Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Ian Lance Taylor [Mon, 23 Dec 2024 19:27:13 +0000 (11:27 -0800)]
os: simplify Process.Release
Consolidate release/deactivation into a single doRelease method.
It needs to check GOOS for backward compatibility, but it's
simpler to keep all the logic in one place.
Change-Id: I242eb084d44d2682f862a8fbf55c410fb8c53358
Reviewed-on: https://go-review.googlesource.com/c/go/+/638580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Ian Lance Taylor [Mon, 23 Dec 2024 05:23:55 +0000 (21:23 -0800)]
os: use AddCleanup, not SetFinalizer, for Process
There is no reason to use a cleanup/finalizer for a Process that
doesn't use a handle, because Release doesn't change anything visible
about the process.
For #70907
Change-Id: I3b92809175523ceee2e07d601cc2a8e8b86321e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/638579 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@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Michael Anthony Knyszek [Fri, 24 Jan 2025 20:17:20 +0000 (20:17 +0000)]
internal/trace: rename "oldtrace" to trace v1
This is part of a refactoring to better distinguish trace wire format
versions. Even though details may change between Go versions and they
might be backwards-incompatible, the trace format still broadly has two
wire formats: v1 and v2.
A follow-up change will rename go122 to v2 to make this more consistent.
Change-Id: If4fe1c82d8aeabc8baa05f525e08a9e7d469a5c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/644217
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Michael Anthony Knyszek [Thu, 9 Jan 2025 18:17:49 +0000 (18:17 +0000)]
internal/trace: refactor how experimental batches are exposed
This change modifies how per-generation experimental batches are
exposed. Rather than expose them on the ExperimentalEvent, it exposes it
as part of the Sync event, so it's clear to the caller when the
information becomes relevant and when it should be parsed.
This change also adds a field to each ExperimentalEvent indicating which
experiment the event is a part of.
Because this information needs to appear *before* a generation is
observed, we now ensure there is a sync event both before and after each
generation. This means the final sync event is now a special case;
previously we would only emit a sync event after each generation.
This change is based on feedback from Austin Clements on the
experimental events functionality.
For #62627.
Change-Id: I48b0fe12b22abb7ac8820a9e73447bfed8419856
Reviewed-on: https://go-review.googlesource.com/c/go/+/644215
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Fri, 7 Feb 2025 02:04:00 +0000 (18:04 -0800)]
bufio: skip network test if unixpacket socket not supported
Change-Id: I03434fdc4916fc8d195de2617edc28ec4b66a172
Reviewed-on: https://go-review.googlesource.com/c/go/+/647535
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> Reviewed-by: Damien Neil <dneil@google.com>
Damien Neil [Thu, 30 Jan 2025 18:55:36 +0000 (10:55 -0800)]
testing/synctest: add an example of testing networked code
For #67434
Change-Id: If7dcd3bf7bb69e1730856405d55cffc72ce0e132
Reviewed-on: https://go-review.googlesource.com/c/go/+/645675 Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
qmuntal [Thu, 6 Feb 2025 10:13:19 +0000 (11:13 +0100)]
make.bat: pass through all arguments to "dist bootstrap"
nolocal is (almost) no longer needed after CL 647115. If we remove it,
then we can pass through all arguments to the Go command, which is
useful for running tests with additional flags, like -json or -v.
This CL also updates all.bat to use "go tool dist" instead of
"%GOTOOLDIR%/dist", as %GOTOOLDIR% is no longer set after making
make.bat uncoditionally set nolocal.
Change-Id: I97dc687faa5686d023f7d7d2b96637295995fe67
Reviewed-on: https://go-review.googlesource.com/c/go/+/647117 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qmuntal [Thu, 6 Feb 2025 09:55:59 +0000 (10:55 +0100)]
{all,clean,make,race,run}.bat: use || instead of "if errorlevel 1"
"if errorlevel 1" is and old construct that returns true if the
errorlevel is greater than or equal to 1. There are better alternatives
since Windows NT. For example, the || operator runs the RHS operand if
the preceding command failed, determined by checking that the errorlevel
is different from 0. This approach is more robust -it also works with
negative errorlevels- and is less verbose.
Change-Id: I2070d654d8f9dd41a6cd586ba5ad5f4fea0638ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/647136 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Adds ACVP test coverage for deterministic ECDSA based on the NIST spec:
https://pages.nist.gov/ACVP/draft-fussell-acvp-ecdsa.html
Notably there is no corresponding acvp_test.config.json update in this
commit because ACVP DetECDSA only specifies sigGen mode.
The ACVP ECDSA sigGen tests are not amenable to testing against
static data because the test vectors don't provide a key pair to use for
the signature, just the message. The module wrapper has to generate its
own keypair and return the public key components with the signature.
DetECDSA produces deterministic signatures only when signing the same
message with the same key.
Change-Id: I9921f52e943c96b32e02e79cb5556ba0fabeae17
Reviewed-on: https://go-review.googlesource.com/c/go/+/635341
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Quim Muntal [Thu, 6 Feb 2025 21:16:34 +0000 (13:16 -0800)]
Revert "cmd/go: report gcc ld error message when linking fails"
This reverts CL 646315.
Reason for revert: broke cgo_undef test
Change-Id: Ic992a1666a446736c605a8caefa77f791dceb64c
Reviewed-on: https://go-review.googlesource.com/c/go/+/647415 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
qmuntal [Thu, 6 Feb 2025 08:19:20 +0000 (09:19 +0100)]
run.bat: pass through all arguments to "go tool dist test"
nolocal is no longer needed after CL 647115. If we remove it, then
we can pass through all arguments to the Go command, which is
useful for running tests with additional flags, like -json or -v.
Change-Id: I5c48d9b90720c039bf2ec3d9213e7ce5cea33818
Reviewed-on: https://go-review.googlesource.com/c/go/+/647116 Reviewed-by: Damien Neil <dneil@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>
qmuntal [Thu, 6 Feb 2025 08:07:08 +0000 (09:07 +0100)]
{all,clean,make,race,run}.bat: remove %GOBUILDEXIT% and %GOBUILDFAIL%
%GOBUILDEXIT% is used to avoid closing the terminal window when the
build or the tests fail on a dev machine. It is only set in CI to get
a non-zero exit code in case of failure.
%GOBUILDFAIL% is used to pass the exit code from a child batch file to
the parent batch file. It is set to 1 in the child batch file if the
build or the tests fail.
These two variables add complexity to the batch files and impose some
limitations on how they are implemented. For example, the child files
can't use setlocal, as it would make the parent file unable to read the
%GOBUILDFAIL% variable.
This CL removes these two variables and replaces them with unconditional
calls to "exit /b 1" in case of failure, which is more idiomatic and
composable. The trick is that the "/b" parameter makes the exit only
apply to the current batch file, not the entire shell session (unless
the bat file is the root, in which case the parameter is ignored), so
the parent batch file can continue executing, potentially checking the
errorlevel of the child batch file (which we always set to 1).
Change-Id: Ib053fb181ab14d58679551e03485700de77878d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/647115
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> Reviewed-by: Damien Neil <dneil@google.com>
Joel Sing [Sun, 24 Nov 2024 03:38:33 +0000 (14:38 +1100)]
cmd/internal/obj/riscv: update references to RISC-V specification
Update references to version 20240411 of the RISC-V specifications.
Reorder and regroup instructions to maintain ordering. Also be
consistent with formatting.
The instruction encodings table was seemingly missed in CL 616115.
Change-Id: I47b7c8538383ff3b0503ba59db570c3d4f0d5653
Reviewed-on: https://go-review.googlesource.com/c/go/+/631935 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> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Pengcheng Wang <wangpengcheng.pp@bytedance.com>
There is not much point in having per architecture files that all contain
the same content. Instead, merge the various xor_<goarch>.go files into a
single xor_asm.go file that has appropriate build tags.
Change-Id: I555d44b2fd83f260a4855d83cacb9e101d689bc0
Reviewed-on: https://go-review.googlesource.com/c/go/+/639856 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Joel Sing [Fri, 3 Jan 2025 08:06:07 +0000 (19:06 +1100)]
crypto/subtle: add additional benchmarks for XORBytes
Provide alignment benchmarks for XORBytes, as well as including
8192 byte blocks in the existing benchmarks. This allows us to
better evaluate performance with unaligned inputs.
Change-Id: Iad497c594c0425389ae02ca848aede5cb0ac3afd
Reviewed-on: https://go-review.googlesource.com/c/go/+/639316 Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
qmuntal [Tue, 4 Feb 2025 10:16:40 +0000 (11:16 +0100)]
cmd/link: add -e (no limit on errors) flag
The compiler and assembler have a -e flag that disables the limit
on the number of errors before the build fails. This flag is useful
for debugging, the linker should have it too.
Change-Id: I892cfd6ee1519e9e86261af7d05e1af2ded21684
Reviewed-on: https://go-review.googlesource.com/c/go/+/646435 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Mon, 23 Dec 2024 05:15:30 +0000 (21:15 -0800)]
os: simplify process status
Since it no longer holds a reference count, just use values.
For #70907
Change-Id: I19a42583988d4f8a9133b1c837356ca0179d688c
Reviewed-on: https://go-review.googlesource.com/c/go/+/638578
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Ian Lance Taylor [Mon, 23 Dec 2024 05:00:58 +0000 (21:00 -0800)]
os: don't store reference count in Process.state
We only need a reference count in processHandle.
For #70907
Fixes #71564
Change-Id: I209ded869203dea10f12b070190774fb5f1d3d71
Reviewed-on: https://go-review.googlesource.com/c/go/+/638577
Commit-Queue: 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> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Ian Lance Taylor [Mon, 27 Jan 2025 18:21:57 +0000 (10:21 -0800)]
lib/time: build with Ubuntu backward compatibility options
Change-Id: I7e241eb602e45eea3c730793c14d8a5f666f9181
Reviewed-on: https://go-review.googlesource.com/c/go/+/644077
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Mon, 27 Jan 2025 05:52:58 +0000 (21:52 -0800)]
bufio: don't do empty Write at start of WriteTo
The empty Write will cause the wrong thing to happen when using
io.Copy to copy to a package-based stream.
Fixes #71424
Change-Id: I046a27539447182692ac76a8bdd422327345dd8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/644535 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Damien Neil <dneil@google.com>
Ian Lance Taylor [Thu, 9 Jan 2025 22:42:16 +0000 (14:42 -0800)]
encoding/base64: use internal/byteorder
This permits us to remove the dependency on reflect.
Change-Id: I60b1e9fd713f340bfd5eec2edfa58fc724a8e2d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/641936 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Tue, 7 Jan 2025 18:47:01 +0000 (10:47 -0800)]
crypto/internal/fips140/drbg: add package comment
For #69536
Change-Id: I70d2ed10555fed244f08c898899399e3032e17b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/640597 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>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Thu, 6 Feb 2025 23:01:17 +0000 (15:01 -0800)]
cmd/go: adjust testsuite to add reraised panic message
A couple of tests generate different output due to CL 645916
for issue #71517.
Fixes #71593
Fixes #71594
Change-Id: Ifaeff4e9de8d881202bd9e6394c9b9cff8959596
Reviewed-on: https://go-review.googlesource.com/c/go/+/647495
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: Damien Neil <dneil@google.com>
Luka Krmpotic [Thu, 6 Feb 2025 21:33:18 +0000 (21:33 +0000)]
unicode/utf8: remove init from utf8_test
TestConstants and init test the same thing, remove init,
it does not exist in utf16_test.go either.
Fixes #71579
Change-Id: Ie0afd640bebde822733b6eac0bf98a17872f4e5f
GitHub-Last-Rev: d7224c18376e00038261279abdfa954abc3a8303
GitHub-Pull-Request: golang/go#71582
Reviewed-on: https://go-review.googlesource.com/c/go/+/647335
Commit-Queue: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
thepudds [Thu, 6 Feb 2025 13:07:38 +0000 (08:07 -0500)]
weak: prevent unsafe conversions using weak pointers
Prevent conversions between Pointer types,
like we do for sync/atomic.Pointer.
Fixes #71583
Change-Id: I20e83106d8a27996f221e6cd9d52637b0442cea4
Reviewed-on: https://go-review.googlesource.com/c/go/+/647195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Ian Lance Taylor [Thu, 26 Dec 2024 00:01:58 +0000 (16:01 -0800)]
cmd/cgo: use strings.Builder to build long strings
Change-Id: I33ba7c8a7b731647cdff3ffe7c4274f76f8923ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/638736 Reviewed-by: Cherry Mui <cherryyz@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>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Jesse Rittner [Sat, 25 Jan 2025 21:21:53 +0000 (16:21 -0500)]
net: fix ListenMulitcastUDP to work properly when interface has no IPv4
The existing implementation would either fail or bind to the wrong interface
when the requested interface had no IPv4 address, such as when the Ethernet cable
was unplugged.
Now on Linux, it will always bind to the requested interface.
On other operating systems, it will consistently fail if the requested interface
has no IPv4 address.
Fixes #70132
Change-Id: I22ec7f9d4adaa4b5afb21fc448050fb4219cacee
Reviewed-on: https://go-review.googlesource.com/c/go/+/644375 Reviewed-by: Damien Neil <dneil@google.com> 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>
qmuntal [Mon, 3 Feb 2025 20:05:51 +0000 (21:05 +0100)]
cmd/go: report gcc ld error message when linking fails
The output of the gcc ld command is useful to understand why a package
that uses cgo can't use internal linking. We should log it.
Change-Id: Id524065fc5348be57387f2b67d1e00861f9adf15
Reviewed-on: https://go-review.googlesource.com/c/go/+/646315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Change-Id: I251c2898ccf3c9931d162d87dabbd49cf4ec73a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/641757 Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: 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>
Ian Lance Taylor [Thu, 6 Feb 2025 01:22:43 +0000 (17:22 -0800)]
runtime/cgo: clarify that C code must not retain pointer
For #71566
Change-Id: I6dc365dd799d7b506b4a55895f1736d3dfd4684b
Reviewed-on: https://go-review.googlesource.com/c/go/+/647095 Reviewed-by: Alan Donovan <adonovan@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>
Commit-Queue: Ian Lance Taylor <iant@google.com>
This change introduced a security issue as @ flags are first resolved as
files by the darwin linker, before their meaning as flags, allowing the
flag filtering logic to be entirely bypassed.
Thanks to Juho Forsén for reporting this issue.
Fixes #71476
Fixes CVE-2025-22867
Change-Id: I3a4b4a6fc534de105d930b8ed5b9900bc94b0c4e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1900 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/646996 Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Dmitri Shuralyov [Tue, 4 Feb 2025 03:50:29 +0000 (22:50 -0500)]
internal/trace: skip TestTraceCgoCallback on freebsd-amd64-race builders
For #71556.
Change-Id: I754f113bfdad244d0e978cf559bf45f2f4d7bf06
Reviewed-on: https://go-review.googlesource.com/c/go/+/646396 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Dmitri Shuralyov [Wed, 5 Feb 2025 18:52:56 +0000 (13:52 -0500)]
internal/routebsd: fix typo in sockAddrLen identifer name
For #70528.
Change-Id: I0db75cb998aeb299676384fe59bf241db18ebc5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/646975 Reviewed-by: Cherry Mui <cherryyz@google.com> 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>
Dmitri Shuralyov [Wed, 5 Feb 2025 00:54:25 +0000 (19:54 -0500)]
cmd/go: skip bzr tests if 'bzr help' has non-zero exit code
It appears to be quite easy to end up with a broken 'bzr' installation.
For example, if bzr was installed via a system-wide package manager and
intends to work with a system-wide Python installation, it may break if
another 'python3' binary is added to PATH.
If something as simple as 'bzr help' fails to exit with zero code,
consider it broken and skip tests that require a working bzr binary
just like if the 'bzr' binary isn't present in PATH at all.
This makes these tests more robust and capable of producing useful
signal in more environments. Separately from this, we'll want to
restore a working bzr installation on the linux-arm64 builders, but
at least there's still one on linux-amd64 builders.
For #71563.
Fixes #71504.
Change-Id: Ia147196f12b90a0731ebbfab63b5de308212ed65
Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64-longtest,gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/646715
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Ian Lance Taylor [Tue, 4 Feb 2025 23:11:42 +0000 (15:11 -0800)]
internal/routebsd: fix parsing network address of length zero
This applies CL 646555 from the net repository to this copy.
For #70528
Change-Id: Ib7e23accfa3f278392e7bdca6f8544b8f1395e7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/646676 Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
TryBot-Bypass: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Change-Id: I867222b0f907b29d32b2676e55c6b5789ec56511
Reviewed-on: https://go-review.googlesource.com/c/go/+/642716 Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Mark Ryan [Fri, 25 Aug 2023 09:22:02 +0000 (11:22 +0200)]
cpu/internal: provide runtime detection of RISC-V extensions on Linux
Add a RISCV64 variable to cpu/internal that indicates both the presence
of RISC-V extensions and performance information about the underlying
RISC-V cores. The variable is only populated with non false values on
Linux. The detection code relies on the riscv_hwprobe syscall
introduced in Linux 6.4. The patch can detect RVV 1.0 and whether
the CPU supports fast misaligned accesses. It can only detect RVV 1.0
on a 6.5 kernel or later (without backports).
Updates #61416
Change-Id: I2d8289345c885b699afff441d417cae38f6bdc54
Reviewed-on: https://go-review.googlesource.com/c/go/+/522995 Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com>
Now that it's ratified we can add rva23u64 as a valid value for the
GORISCV64 environment variable. This will allow the compiler and
assembler to generate instructions made mandatory by the new profile
without a runtime check. Examples of such instructions include those
introduced by the Vector and Zicond extensions.
Setting GORISCV64=rva23u64 defines the riscv64.rva20u64,
riscv64.rva22u64 and riscv64.rva23u64 build tags, sets the internal
variable buildcfg.GORISCV64 to 23 and defines the macros
GORISCV64_rva23u64, hasV, hasZba, hasZbb, hasZbs, hasZfa, and
hasZicond for use in assembly language code.
Updates #61476
Change-Id: I7641c23084fa52891c9a18df58f4013cb6597d88
Reviewed-on: https://go-review.googlesource.com/c/go/+/633417 Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Ian Lance Taylor [Tue, 4 Feb 2025 18:33:38 +0000 (10:33 -0800)]
net/rpc: move frozen notice to the start of the package doc
For #71559
Change-Id: I68b9518a26cab75789d596839267abab7997bc2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/646575 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@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: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Amirhossein Akhlaghpour [Mon, 3 Feb 2025 05:56:31 +0000 (05:56 +0000)]
os: fix race condition in readdir by atomically initializing dirinfo
This change ensures that dirinfo in the File struct is initialized atomically,
avoiding redundant allocations when multiple goroutines access it concurrently.
Instead of creating separate buffers, we now use CompareAndSwap to guarantee
thread-safe initialization and reduce unnecessary memory usage.
Although this is not a strict race condition, the update enhances efficiency by
eliminating duplicate allocations and ensuring safer concurrent access.
Fixes #71496.
Change-Id: If08699a94afa05611cdf67e82a5957a8d8f9d5c8
GitHub-Last-Rev: 1e1f6191439cf3ad32f3ba54bba5a0185dd55b14
GitHub-Pull-Request: golang/go#71501
Reviewed-on: https://go-review.googlesource.com/c/go/+/645720
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
apocelipes [Wed, 5 Feb 2025 00:37:18 +0000 (00:37 +0000)]
net: use strings.SplitSeq and bytes.SplitSeq
Replace `for _, s := range {strings, bytes}.Split(v, sep)` with
`for s := range {strings, bytes}.SplitSeq(v, sep)`, to simplify
the code and reduce some memory allocations.
Change-Id: Idead4de1e3928fc75cc5ba8caeff85542f1243d5
GitHub-Last-Rev: 5fb196a073e7583b23b1ebb446d6c067580ed63a
GitHub-Pull-Request: golang/go#71554
Reviewed-on: https://go-review.googlesource.com/c/go/+/646216 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>