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

go/types: TestStdlib fails due failed import in vendored pprof #25367

Closed
ysmolski opened this issue May 13, 2018 · 9 comments
Closed

go/types: TestStdlib fails due failed import in vendored pprof #25367

ysmolski opened this issue May 13, 2018 · 9 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@ysmolski
Copy link
Member

ysmolski commented May 13, 2018

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

~/golang/src (master=) % go version
go version devel +6876447952 Sat May 12 16:26:36 2018 +0000 darwin/amd64

How to reproduce

/golang/src % go test go/types
--- FAIL: TestStdlib (6.66s)
	stdlib_test.go:223: /Users/thorn/golang/src/cmd/vendor/github.com/google/pprof/pprof.go:24:2: could not import github.com/chzyer/readline (can't find import: "github.com/chzyer/readline")
	stdlib_test.go:223: /Users/thorn/golang/src/cmd/vendor/github.com/google/pprof/pprof.go:79:18: invalid operation: r.rl (variable of type *invalid type) has no field or method Stderr
	stdlib_test.go:223: /Users/thorn/golang/src/cmd/vendor/github.com/google/pprof/pprof.go:69:18: invalid operation: r.rl (variable of type *invalid type) has no field or method Stderr
	stdlib_test.go:223: /Users/thorn/golang/src/cmd/vendor/github.com/google/pprof/pprof.go:58:7: invalid operation: r.rl (variable of type *invalid type) has no field or method SetPrompt
	stdlib_test.go:223: /Users/thorn/golang/src/cmd/vendor/github.com/google/pprof/pprof.go:59:14: invalid operation: r.rl (variable of type *invalid type) has no field or method Readline
FAIL
FAIL	go/types	7.313s

Introduced in 46047e6 by @hyangah
Library "github.com/chzyer/readline" is not installed on my system and not vendored as well.

@agnivade agnivade added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels May 13, 2018
@agnivade agnivade added this to the Go1.11 milestone May 13, 2018
@agnivade
Copy link
Contributor

Wonder how the try-bots passed this.

@ysmolski
Copy link
Member Author

Maybe this test is not run by try-bots?

% go test -short go/types
ok  	go/types	0.370s

@agnivade
Copy link
Contributor

That's right. Try-bots just run -short tests if I am not mistaken.

@mvdan
Copy link
Member

mvdan commented May 13, 2018

I was under the impression that Go's pprof vendor wouldn't use readline, so we wouldn't have to pull it in as a dependency. If so, this is hopefully just a mistake with an easy fix.

@hyangah
Copy link
Contributor

hyangah commented May 15, 2018

We don't use the file, so we can delete it.

@mvdan
Copy link
Member

mvdan commented May 15, 2018

We should come up with a strategy to keep this from happening again, though. Even if the go/types test gets run by the builders, it wouldn't be part of the trybots, so I'm sure that the file would get re-added sooner than later.

If we were using a dependency management tool, this would be trivial - it's a main package, so it should not be vendored. Perhaps a better short-term solution is to add src/cmd/vendor/github.com/google/pprof/*.go to some gitignore file.

@gopherbot
Copy link

Change https://golang.org/cl/113295 mentions this issue: cmd/vendor/.../pprof: delete pprof.go file

@hyangah
Copy link
Contributor

hyangah commented May 15, 2018

Currently there is no formal procedure to update this, so I will just write a script for update.

@mvdan
Copy link
Member

mvdan commented May 15, 2018

Do you mean that vendor.json has been getting updated manually? I assumed that it was done with a tool like govendor, but I failed to get that one to work properly.

@golang golang locked and limited conversation to collaborators May 17, 2019
@rsc rsc unassigned hyangah Jun 23, 2022
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. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants