Open chancez opened 8 years ago
@chancez Thinking about this I'm not sure that no subpackages in glide.lock means that all the subpackages should be kept. I think that only the root packages should be kept (like glide-vc is doing now) and the glide.lock should always contain every needed subpackage.
Sorry but I'm a little bit in an hurry and hadn't time to verify/test this. Do you have a simple reproducer? (or I'll try it tomorrow).
@sgotti If no subpackages are listed, glide includes the entire repo into the vendor directory. This is easy, add the following snippets above to any glide.lock and run glide.install, you'll see it installs all of the packages within github.com/coreos/pkg into vendor. If you use glide-vc you'll see nothing is kept.
@chancez glide always includes the full repository in the vendor directory (see also the glide-vc readme and this post: http://engineeredweb.com/blog/2016/go-why-not-strip-unused-pkgs/), that's the reason why glide-vc was born (to remove unneeded packages).
So (but will verify this tomorrow) if a subpackage is not listed in glide.lock this means that glide doesn't consider it as needed. If you have a specific problem and a simple repository with a glide.yaml I could test it. You can also use glide list
to get a list of the packages glide thinks are needed.
Hmm let me think about this more.
Ex given a glide.lock (not complete, trimmed to demonstrate):
Glide-vc will clean all things that are not
github.com/coreos/pkg/flagutil
as expected:Given the following glide.lock I would expect every subpackage in
github.com/coreos/pkg
to be retained:However, it won't keep any packages within
github.com/coreos/pkg
in this case:Using
--keep
has no useful effect here.