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
Milestone

Comments

@randall77
Copy link
Contributor

@randall77 randall77 commented Dec 4, 2020

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

@randall77 randall77 commented Dec 4, 2020

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

@ianlancetaylor ianlancetaylor commented Dec 4, 2020

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

@randall77 randall77 commented Dec 4, 2020

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

@randall77 randall77 commented Dec 4, 2020

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

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 4, 2020

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

@randall77
Copy link
Contributor Author

@randall77 randall77 commented Dec 4, 2020

Ok, thanks, making progress now.

@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

@gopherbot gopherbot commented Dec 8, 2020

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

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 8, 2020

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

@gopherbot gopherbot closed this in 31496cf Dec 8, 2020
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants