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

Failing to pin staticcheck #118

Open
lyda opened this issue Aug 16, 2022 · 3 comments
Open

Failing to pin staticcheck #118

lyda opened this issue Aug 16, 2022 · 3 comments

Comments

@lyda
Copy link

lyda commented Aug 16, 2022

bingo version output: v0.6

go version output: go version go1.18.5 linux/amd64

What happened:

$ git clone [email protected]:bwplotka/bingo.git
[...]
$ cd bingo
$ bingo list
Name		Binary Name					Package @ Version								Build EnvVars	Build Flags
----		-----------					-----------------								-------------	-----------
copyright	copyright-v0.0.0-20210112004814-138d5e5695fe	github.com/efficientgo/tools/[email protected]			
embedmd		embedmd-v1.0.0					github.com/campoy/[email protected]								
faillint	faillint-v1.8.0					github.com/fatih/[email protected]								
goimports	goimports-v0.0.0-20210112230658-8b4aab62c064	golang.org/x/tools/cmd/[email protected]				
golangci-lint	golangci-lint-v1.45.2				github.com/golangci/golangci-lint/cmd/[email protected]					
mdox		mdox-v0.9.0					github.com/bwplotka/[email protected]									
misspell	misspell-v0.3.4					github.com/client9/misspell/cmd/[email protected]							
proxy		proxy-v0.10.0					github.com/gomods/athens/cmd/[email protected]							
$ bingo get honnef.co/go/tools/cmd/[email protected]
Error: get command failed: get: staticcheck.mod: getting honnef.co/go/tools/cmd/[email protected]: fallback to local go mod cache resolution failed after go get failure: go: added github.com/BurntSushi/toml v0.4.1
go: added golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e
go: added golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
go: added golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
go: added golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a
go: added golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: added honnef.co/go/tools v0.3.0: no module was cached matching given package honnef.co/go/tools/cmd/staticcheck
$ bingo list
Name		Binary Name					Package @ Version								Build EnvVars	Build Flags
----		-----------					-----------------								-------------	-----------
copyright	copyright-v0.0.0-20210112004814-138d5e5695fe	github.com/efficientgo/tools/[email protected]			
embedmd		embedmd-v1.0.0					github.com/campoy/[email protected]								
faillint	faillint-v1.8.0					github.com/fatih/[email protected]								
goimports	goimports-v0.0.0-20210112230658-8b4aab62c064	golang.org/x/tools/cmd/[email protected]				
golangci-lint	golangci-lint-v1.45.2				github.com/golangci/golangci-lint/cmd/[email protected]					
mdox		mdox-v0.9.0					github.com/bwplotka/[email protected]									
misspell	misspell-v0.3.4					github.com/client9/misspell/cmd/[email protected]							
proxy		proxy-v0.10.0					github.com/gomods/athens/cmd/[email protected]							

What you expected to happen: Expected staticcheck to be added to the list of pinned binaries.

How to reproduce it (as minimally and precisely as possible): See above

Logs (use bingo get -v <thing you do> for verbose output):

getting target honnef.co/go/tools/cmd/[email protected] (module  )
exec 'go mod init -modfile=/home/kevin/src/titanhq/dev/bingo/.bingo/staticcheck-e.tmp.mod _'
exec 'go get -modfile=/home/kevin/src/titanhq/dev/bingo/.bingo/staticcheck-e.tmp.mod -d honnef.co/go/tools/cmd/[email protected]'
resolveInGoModCache: /home/kevin/src/go/pkg/mod/cache/download/honnef.co/go/tools/cmd/staticcheck/@v directory does not exists
resolveInGoModCache: /home/kevin/src/go/pkg/mod/cache/download/honnef.co/go/tools/cmd/@v directory does not exists
resolveInGoModCache: Found /home/kevin/src/go/pkg/mod/cache/download/honnef.co/go/tools/@v directory
resolveInGoModCache: .info file for sha 2022.1 does not exists. Looking for different module
resolveInGoModCache: /home/kevin/src/go/pkg/mod/cache/download/honnef.co/go/@v directory does not exists
Error: no module was cached matching given package honnef.co/go/tools/cmd/staticcheck
main.resolveInGoModCache
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:554
main.resolvePackage
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:392
main.getPackage
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:595
main.get
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:288
main.main.func2
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:146
main.main.func5
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:215
github.com/oklog/run.(*Group).Run.func1
	/home/kevin/src/go/pkg/mod/github.com/oklog/[email protected]/group.go:38
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1571
fallback to local go mod cache resolution failed after go get failure: go: added github.com/BurntSushi/toml v0.4.1
go: added golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e
go: added golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
go: added golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
go: added golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a
go: added golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: added honnef.co/go/tools v0.3.0
main.resolvePackage
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:393
main.getPackage
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:595
main.get
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:288
main.main.func2
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:146
main.main.func5
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:215
github.com/oklog/run.(*Group).Run.func1
	/home/kevin/src/go/pkg/mod/github.com/oklog/[email protected]/group.go:38
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1571
staticcheck.mod: getting honnef.co/go/tools/cmd/[email protected]
main.get
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/get.go:289
main.main.func2
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:146
main.main.func5
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:215
github.com/oklog/run.(*Group).Run.func1
	/home/kevin/src/go/pkg/mod/github.com/oklog/[email protected]/group.go:38
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1571
get
main.main.func2
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:147
main.main.func5
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:215
github.com/oklog/run.(*Group).Run.func1
	/home/kevin/src/go/pkg/mod/github.com/oklog/[email protected]/group.go:38
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1571
get command failed
main.main
	/home/kevin/src/go/pkg/mod/github.com/bwplotka/[email protected]/main.go:223
runtime.main
	/usr/local/go/src/runtime/proc.go:250
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1571

Anything else we need to know: Not sure. I do wonder if the honnef.co server is hosting the go repo correctly - is there some meta data missing? Maybe @dominikh might comment on that?

@ananthb
Copy link

ananthb commented Aug 18, 2022

I'm having the exact same problem with stringer on go1.19.

@lyda
Copy link
Author

lyda commented Aug 22, 2022

This does work: bingo get honnef.co/go/tools/cmd/[email protected]

It seems that the real issue is the honnef.co repo is missing some tags.

@dominikh
Copy link

As far as I am aware, we have all the tags (both git tags and <meta> tags) necessary. Which is reflected by the fact that neither go get, go.dev, or the Go proxy have difficulty dealing with our packages.

If I were to wager a guess from the log you provided, I would say that bingo is confused by the fact that when you go get [email protected], the tag that actually gets fetched is v0.3.0. If bingo walks the file system, expecting to find a directory for 2022.1 that will naturally fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants