Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: syscall deprecation or not #60596

Closed
dancerj opened this issue Jun 5, 2023 · 2 comments
Closed

os: syscall deprecation or not #60596

dancerj opened this issue Jun 5, 2023 · 2 comments

Comments

@dancerj
Copy link

dancerj commented Jun 5, 2023

What version of Go are you using (go version)?

$ go version
go version go1.20.3 linux/amd64

Does this issue reproduce with the latest release?

not sure

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/uekawa/.cache/go-build"
GOENV="/home/uekawa/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/uekawa/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/uekawa/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="x86_64-pc-linux-gnu-clang"
CXX="x86_64-pc-linux-gnu-clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3873322193=/tmp/go-build -gno-re

What did you do?

called ProcessState.Sys()

What did you expect to see?

ProcessState.Sys() returns a non-deprecated result.

What did you see instead?

ProcessState.Sys() returns syscall.WaitStatus()

and syscall is marked as deprecated in the documentation
https://cs.opensource.google/go/go/+/master:src/syscall/syscall.go;l=21?q=syscall.go&ss=go%2Fgo

@prattmic
Copy link
Member

syscall is deprecated, but changing the return type of os.ProcessState.Sys would be an incompatible change. It is particularly bad in the case of Sys because it returns any, so almost every caller explicitly mentions syscall.WaitStatus.

The alternative would be introducing a new method with a new return type and deprecating Sys, but that is a lot of churn without much concrete value. syscall.WaitStatus works fine, even if it is in a deprecated package.

@ianlancetaylor
Copy link
Contributor

Filed #60797 to undeprecate the syscall package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants