golang / dep

Go dependency management tool experiment (deprecated)

Home Page:https://golang.github.io/dep/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panic when dep solver tries to call fail method

moadqassem opened this issue · comments

What version of dep are you using (dep version)?

 dep:
 version     : v0.5.4
 build date  : 2019-06-14
 git hash    : 1f7c19e
 go version  : go1.12.6
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

What dep command did you run?

dep ensure -update github.com/kubermatic/machine-controller

What did you expect to see?

I am expecting the passed dependency to be updated.

What did you see instead?

I am seeing a panic:


goroutine 1 [running]:
github.com/golang/dep/gps.(*solver).findValidVersion(0xc0000ee100, 0xc0002e6820, 0xc001d58bd0, 0x3, 0x3, 0x0, 0xc001d58bd0)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/gps/solver.go:945 +0x4cc
github.com/golang/dep/gps.(*solver).backtrack(0xc0000ee100, 0x16e3660, 0xc00002a0b0, 0x0, 0x0, 0x0)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/gps/solver.go:1079 +0xbdc
github.com/golang/dep/gps.(*solver).solve(0xc0000ee100, 0x16e3660, 0xc00002a0b0, 0x5, 0xc0000a2568, 0xc00050d5e8)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/gps/solver.go:566 +0x3b9
github.com/golang/dep/gps.(*solver).Solve(0xc0000ee100, 0x16e3660, 0xc00002a0b0, 0x1abf9e0, 0xc00002c119, 0x24, 0xc000098330)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/gps/solver.go:440 +0x1eb
main.(*ensureCommand).runUpdate(0xc00017d6e0, 0xc0000ec880, 0xc0000215f0, 0x1, 0x1, 0xc0000e9200, 0x16eb5e0, 0xc000248480, 0xc00002c0f4, 0x49, ...)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/cmd/dep/ensure.go:356 +0x1c1
main.(*ensureCommand).Run(0xc00017d6e0, 0xc0000ec880, 0xc0000215f0, 0x1, 0x1, 0x0, 0x0)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/cmd/dep/ensure.go:216 +0x755
main.(*Config).Run(0xc00007cea0, 0x0)
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/cmd/dep/main.go:212 +0x111c
main.main()
	/private/tmp/dep-20190614-48387-1iw5fry/src/github.com/golang/dep/cmd/dep/main.go:84 +0x636

To be honest I am not quite sure if the panic occours, becuase the dependency which it tries to get has been already popped of the queue and the getDependenciesOn is expecting to find it. I am expecting this because there is no check for the []dependency slice. The current solution for this, is just check the []dependency slice first and then try to call the fail method on it:

I have opened a PR to fix the panic, however more investigation would be nice.

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!