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/vet: go 1.18 vet undocumented behavior change with use of -vettool #50195

Closed
leighmcculloch opened this issue Dec 15, 2021 · 3 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@leighmcculloch
Copy link
Contributor

leighmcculloch commented Dec 15, 2021

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

$ go version
go version go1.18beta1 darwin/amd64

Does this issue reproduce with the latest release?

No, this issue does not reproduce with go1.17.5.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/leighmcculloch/.local/bin"
GOCACHE="/Users/leighmcculloch/Library/Caches/go-build"
GOENV="/Users/leighmcculloch/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/leighmcculloch/.local/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/leighmcculloch/.local/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/leighmcculloch/.local/bin/go/latest"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/leighmcculloch/.local/bin/go/latest/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18beta1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
GOMOD="/Users/leighmcculloch/Code/stellar--go/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/q5/xb4dl4bs3cs32khlg0ryy0vw0000gp/T/go-build3668798394=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I ran go vet using the -vettool option.

go vet -all -composites=false -unreachable=false -tests=false ./...
go vet -vettool=$(which shadow) ./...

What did you expect to see?

I expected to see go vet, when run with -vettool, to only run the vettool and not to run all the other vet checks. This is the behavior of go vet prior to Go 1.18.

I also expected to see the shadow tool get used to vet the code.

What did you see instead?

I saw go vet output errors about composites, and I saw no outputs about issues that would normally be identified when running with -vettool.

It seems like the -vettool option is no longer taking any affect.

This issue is related to stellar/go#4143.

@timothy-king timothy-king added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 15, 2021
@leighmcculloch
Copy link
Contributor Author

I've attempted to reproduce this on another shell, and now I'm not seeing the same issue, so there's something environmental at play here that has happened on my local machine once, and is happening consistently inside GitHub Actions.

@leighmcculloch
Copy link
Contributor Author

leighmcculloch commented Dec 15, 2021

Ok, I believe the issue is the way we install the shadow tool in our scripts. We are using go get to do the install, which won't actually affect an install of a binary with Go 1.18. The affect this has is that there is no shadow binary, and it is as if I am running go vet with an empty -vettool.

@timothy-king
Copy link
Contributor

Can you include the [possibly sanitized] output of go vet -x or go vet -n?

@golang golang locked and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants