Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Shuralyov 1bfbee0e20 all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update code generators to use only the new go:build lines,
not the old +build ones.

For golang/go#60268.

Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@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>
2023-10-11 21:54:30 +00:00
Kir Kolyshkin fdc7ef4071 all: remove ioutil usage from tests
This removes the remaining (and trivial) use of deprecated ioutil
package from test files.

Replacements are easy:

	ioutil.ReadAll -> io.ReadAll
	ioutil.ReadDir -> os.ReadDir
	ioutil.ReadFile -> os.ReadFile
	ioutil.WriteFile -> os.WriteFile

While at it, simplify some error reporting.

Change-Id: I60a242fd3c08d8fe571a18f16716439a9acdd59d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526299
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2023-09-12 16:41:27 +00:00
Kir Kolyshkin 0e97d69659 all: use t.TempDir in tests
This removes all usage of ioutil.TempDir in tests (and a few cases of
os.TempDir as well, while we're at it), which simplifies test cleanup a
lot.

Compile tested (go test -c) for most platforms (except zos).

Change-Id: I9178f5ec615c0a6cfef36e8de78c6b72e055b7cb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526297
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.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>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2023-09-08 15:25:11 +00:00
Tobias Klauser 2a33a30b79 execabs: let hasExec return false on wasip1
Wasm cannot execute processes. Follow CL 479622 and update hasExec to
match internal/testenv.HasExec.

Updates golang/go#58141

Change-Id: Ie44dc356ee589784c44906694fda387fb1448ad5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/485655
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-04-18 17:08:16 +00:00
Ian Lance Taylor 6877dccfc2 execabs: don't override Go 1.19 error with our error
Go 1.19 incorporates the functionality of execabs directly.
If it has already reported an error, don't report our own error.

In particular Go 1.19 moved the error from lookPathErr to Err.
The code was already checking to not override lookPathErr.
With this change we also do not override Err.

Tested with Go 1.17 through Go 1.20.

Fixes golang/go#58606

Change-Id: I110127a3925f3800cc058d93e704604a59aa38f7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/469735
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-02-21 18:19:21 +00:00
Sebastiaan van Stijn d684c6f886 execabs: isGo119ErrDot: use errors.Is instead of string-matching
Addresses the TODO added in CL 403256.

Change-Id: Iae44242e00b6a309cc0f1e336462bc2d4995a5e2
GitHub-Last-Rev: 1adfdb7994
GitHub-Pull-Request: golang/sys#142
Reviewed-on: https://go-review.googlesource.com/c/sys/+/448877
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-11-10 21:11:17 +00:00
Bryan C. Mills 988cb79eb6 execabs: add legacy "//+build" constraints
Go releases before Go 1.17 are no longer supported, and Go 1.17
supports the newer "//go:build" syntax, so the older "//+build"
variation is no longer required by Go's support policy. However, the
x/sys module is very low-level and empirically some users are still on
unsupported Go releases, so there is little harm in adding the older
variations.

Fixes golang/go#52668.

Change-Id: Ieb8e64e450b9d795f2753fc5f99b36816a3dbff3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/403695
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2022-05-03 16:30:25 +00:00
Russ Cox b6088ccd6c execabs: make safe for Go 1.19
To preserve the same errors that LookPath used to return,
LookPath needs to know to ignore the new Go 1.19 exec.ErrDot errors.

For golang/go#43724.

Change-Id: I8938813a1a4e14bf697f05879e3ab212611644da
Reviewed-on: https://go-review.googlesource.com/c/sys/+/403256
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-02 12:42:56 +00:00
Tobias Klauser 9b0068b266 execabs: disable tests on ios and js/wasm
TestCommand and TestLookPath fail on the js/wasm builder and likely
fail on ios as well.

Like the tests in internal/execabs, skip them for these platforms.

This fixes the js/wasm builder after CL 284753.

For golang/go#11811

Change-Id: I1038128bd4c7bd410ac1357dedda5e3eef5c7bbb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/285712
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-01-23 11:12:55 +00:00
Roland Shoemaker b64e53b001 execabs: create execabs package
This package provides an alternative to os/exec that guarantees
never to satisfy a PATH lookup using an executable in the current
directory.

Change-Id: Id978f8039fe21687059c788836c79ae8e0930e92
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/949732
Reviewed-by: Katie Hockman <katiehockman@google.com>
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-on: https://go-review.googlesource.com/c/sys/+/284753
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-01-19 21:28:57 +00:00