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

cmd/go: install pkg@version: print deprecation messages #59230

Open
seankhliao opened this issue Mar 24, 2023 · 5 comments
Open

cmd/go: install pkg@version: print deprecation messages #59230

seankhliao opened this issue Mar 24, 2023 · 5 comments
Labels
GoCommand cmd/go help wanted modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@seankhliao
Copy link
Member

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

$ go version
go version devel go1.21-2ef70d9d0f9 Tue Mar 21 06:53:28 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/arccy/.cache/go-build"
GOENV="/home/arccy/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS="-trimpath "-ldflags=-s -w""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/arccy/.data/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/arccy/.data/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/arccy/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/arccy/sdk/gotip/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.21-2ef70d9d0f9 Tue Mar 21 06:53:28 2023 +0000"
GCCGO="gccgo"
GOAMD64="v3"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD="/home/arccy/tmp/testrepo0151/go.mod"
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build287293194=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ go install go.seankhliao.com/testrepo0150@latest
go: downloading go.seankhliao.com/testrepo0150 v0.0.0-20230324184925-aa9dc37d2fb8

What did you expect to see?

deprecation message printed like with go get

$ go get go.seankhliao.com/testrepo0150@latest
go: module go.seankhliao.com/testrepo0150 is deprecated: use v2
go: added go.seankhliao.com/testrepo0150 v0.0.0-20230324184925-aa9dc37d2fb8

What did you see instead?

no deprecation message

cc @bcmills @matloob

@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Mar 24, 2023
@bcmills bcmills added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Apr 3, 2023
@bcmills bcmills added this to the Backlog milestone Apr 3, 2023
@bcmills bcmills added the modules label Apr 3, 2023
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 3, 2023
@bcmills
Copy link
Member

bcmills commented Apr 3, 2023

@bcmills
Copy link
Member

bcmills commented Apr 3, 2023

Should go run also print deprecations and retractions? That could potentially intermix stderr output from the go command with stderr output from the command being run, but I suppose that's the risk you take when using go run instead of splitting run and either install or build. 🤷‍♂️

@ronaudinho
Copy link

ronaudinho commented Apr 18, 2023

would adding CheckDeprecation right after this line be an acceptable fix? if so, I'd like to send a patch.

Should go run also print deprecations and retractions?

  • deprecations: the proposed change should affect go install or go run when it uses pkg@version, but not when only pkg is supplied.

  • retractions: I believe it is already handled here

9bany added a commit to 9bany/go that referenced this issue May 30, 2023
The existing implementation has been printing
a deprecation message when running go get pkg@version,
which is unnecessary. Remove the check for
deprecation in the go get command.

Fixes golang#59230
@gopherbot
Copy link

Change https://go.dev/cl/499176 mentions this issue: cmd/go: get pkg@version: remove print deprecation messages

9bany added a commit to 9bany/go that referenced this issue Jun 1, 2023
The existing implementation does not print a deprecation message when running `go install pkg@version`. This fix will add a print deprecation message for the `go run install` command.

Fixes golang#59230
@gopherbot
Copy link

Change https://go.dev/cl/528775 mentions this issue: cmd/go: show deprecation message on go run/install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go help wanted modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants