-
Notifications
You must be signed in to change notification settings - Fork 1k
"dep ensure pkg@^ver" causing "dep prune" to be undone and corrupts the lock file #640
Comments
Ahh, that's a frustrating series of occurrences, I'm sorry 😞. You're hitting on a cluster of several ongoing issues, nearly all of which we have work in-flight to fix.
Right, this is by design, and much of why folks want
(In the future we'll be able to avoid fully regenerating
Sorta side note, but adding a new dependency is a bit of a confusing area; see #303. We do have an in-process plan (#277, #489) for making it clearer and more orthogonal.
It's not actually corrupted, that's just a horribly confusing error message 😢 The This is hard to see right now, though, because I am a little surprised you had a hash mismatch immediately after that |
Thanks for the detailed explanation. It just sounds interesting that
Nope. |
This is the fundamental nature of the problem - it's not possible to know a priori whether any given dependency, at any given version, will (with its dependencies) constitute a disjoint subgraph, or if it will have shared dependencies that require us to reconcile with the existing depgraph and search harder for a solution. That unpredictability is one of the crucial reasons that the search - or at least, our current approach to it - is NP-hard.
Very odd, then. Suggests we have a bug, though I'm a little loathe to devote too much energy to chasing it down when we're about to change the whole way |
Closing this in favor of #944 |
So currently I am in a project where I successfully vended many dependencies and ran
dep prune
to eliminate unused packages undervendor/
.Now I am trying to add
github.com/pkg/errors
dependency, so I run:Once this command executes, all unused packages of my already saved dependencies come back, effectively undoing what
dep prune
did.At this point I cannot execute "dep prune" anymore as it appears like the lock file is corrupted:
At least it did vendor github.com/pkg/errors successfully but millions of lines of code I did not use came back, plus I can't run dep prune anymore. So I
rm -rf Gopkg.* vendor/
and start over withdep init
.The text was updated successfully, but these errors were encountered: