Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.16k stars 539 forks source link

Glide vendors all packages, not just specified subpackages #652

Open karalabe opened 7 years ago

karalabe commented 7 years ago

When only a subpackage is used from a larger one, glide will pull in the entire repository, even though the subpackage is explicitly specified in the .yaml file. This results in tons of new dependencies and code being pulled in.

E.g. A priority queue library pulls in the entire QT because there's some example on a completely different repository path that happens to use WebEngine.

AaronO commented 7 years ago

@karalabe Not a fix per say, but I built a small tool called go-vendor-clean, it's not yet open source, but I use it in conjunction with glide to get glide's versioning but lean/small vendor/ folders.

go-vendor-clean supports glide, godep and still works if you have neither.

It's something we haven't yet open-sourced but use internally GitBook, let me know if you're interested and maybe I can speed up the release process.

screen shot 2016-10-24 at 6 41 12 pm

karalabe commented 7 years ago

I looked into a glide alternative from Rancher, called trash, which seems to easily handle everything I needed (and it's tiny at 700 LOC so I fixed the couple corner cases where it didn't work correctly and upstreamed it).

AaronO commented 7 years ago

@karalabe Didn't know of trash, it looks pretty cool ! A more lightweight/pragmatic alternative to glide.

glide was the closest conceptually to npm, which is what the rest of our team is familiar with (since a substantial part of our code is node).

I'll add trash.conf support to go-vendor-clean.

go-vendor-clean is quite aggressive since it removes all non-go compilable files from /vendor/ (.md, ...) along with test files (see above screenshot). Some people may want to keep that, but we wanted to keep our /vendor/ dirs as small as possible so it works for us :)