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: add framepointer analysis pass from x/tools CL 248686 #43014

Closed
randall77 opened this issue Dec 4, 2020 · 8 comments
Closed

cmd/vet: add framepointer analysis pass from x/tools CL 248686 #43014

randall77 opened this issue Dec 4, 2020 · 8 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@randall77
Copy link
Contributor

The framepointer analysis pass was checked into x/tools at CL 248686. We need to vendor that into the stdlib so it can be used by vet.

@randall77 randall77 added this to the Go1.16 milestone Dec 4, 2020
@randall77
Copy link
Contributor Author

Not sure how to make this work. I do

$ cd GOROOT/src/cmd
$ go get -d golang.org/x/tools@latest
$ go mod tidy
$ go mod vendor

It succeeds, but the framepointer package doesn't appear. Only the ifaceassert package gets updated. So it is doing something, but not what I need it to do.

It also looks like the previous import was done on 2020/11/10, which is after the framepointer analysis pass was checked in (which was 11/2). So it didn't make it in then either.

Anyone understand what is going on?

@dmitshur

@ianlancetaylor
Copy link
Contributor

My understanding is that go mod vendor only brings in required packages, and cmd/vet/main.go does not import golang.org/x/tools/go/analysis/passes/framepointer.

@randall77
Copy link
Contributor Author

There are 28 subdirectories of src/cmd/vendor/golang.org/x/tools/go/analysis/passes, but 44 subdirectories in https://godoc.org/golang.org/x/tools/go/analysis/passes.

@randall77
Copy link
Contributor Author

Ah, so I need to import a nonexistent package first, and then run the vendor tool.

@ianlancetaylor
Copy link
Contributor

I think so. And you probably need to pass framepointer.Analyzer to unitchecker.Main.

@randall77
Copy link
Contributor Author

Ok, thanks, making progress now.

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 5, 2020
@dmitshur dmitshur changed the title cmd/vendor: pull in framepointer vet analysis pass cmd/vet: add framepointer analysis pass from x/tools CL 248686 Dec 5, 2020
@gopherbot
Copy link

Change https://golang.org/cl/276372 mentions this issue: cmd/vet: vendor in x/tools, enable framepointer vet check

@gopherbot
Copy link

Change https://golang.org/cl/276373 mentions this issue: doc: add description of new framepointer vet check

gopherbot pushed a commit that referenced this issue Dec 9, 2020
Update #43014

Change-Id: I5fbfaa16e6acb8859fd0b1188f532f5a225f6349
Reviewed-on: https://go-review.googlesource.com/c/go/+/276373
Trust: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@golang golang locked and limited conversation to collaborators Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants