-
Notifications
You must be signed in to change notification settings - Fork 540
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
Add ability to remove nested vendor and Godeps/_workspace directories #339
Conversation
Thanks for doing this.
Instead of scanning for its usage and given that this option is deprecated and not allowed with go 1.6 (godep uses standard vendor dirs) probably the fastest solution will be to not remove them. |
@sgotti good catch. I was looking at Kubernetes because it's a more complicated example than most. Some of the packages it imports have Godeps storing the dependencies in the |
I don't think Kubernetes has any deps that rewrite, or at least those don't get used by us. That said, yeah, rewriting is a good loophole here that probably needs to be either un-rewritten or left as-is (probably with a warning). Anyone who is doing rewriting needs to stop, or tools like glide will be come hopeless. |
This patch looks like what we want. You need to be careful, though, that you don't let the tail wag the dog. As much as I appreciate your enthusiasm, many of these issues are subtle, and the kubernetes approach is just one of potentially many valid approaches. As maintainer, you get the fun job of considering all you users and trying to strike balance. That said, aside from the rewrites mess, I would totally use this. |
@thockin glad it's something you'd want! 👏 fwiw, i don't think this is a rash thing to do in general - there are well-defined ways that vendor works, and a strong and clear conceptual basis for stripping the dirs. |
@thockin We have desire for something as elegant and simple (not sure it's really simple) as is available in Rust, Python, JavaScript, PHP, and other languages. The way the Go ecosystem for dependencies has grown up we have to be a little pragmatic until we have a better overall situation (hopefully someday). I'm trying to figure out where to be pragmatic. Feedback helps shape that. I'm not going to let the tail wag the dog but I will take everything I can to be pragmatic. I'm an engineer not a scholar. I'm looking for solutions not theoretically proper. It might surprise you but there is a fair rewriting that needs to be undone to remove the @sgotti This is opt-in for a reason. It has potential to break things. Before releasing we'd need to add some messaging around that. |
Man... this is gonna be dangerous. I agree with adding some messaging. I wish there was a way to make this really clear to users (up front) that this is an experimental feature, and that it is destructive. That said, I feel like the community has expressed a strong desire to at least have the option of doing this. I still think we should go ahead with it. |
If we started with only nuking recursive /vendor dirs, there's less danger, That said, I think "Godep rewriting is not supported" is not such a bad On Thu, Mar 17, 2016 at 3:12 PM, Matt Butcher [email protected]
|
@@ -73,6 +74,10 @@ func Update(installer *repo.Installer, skipRecursive, strip bool) { | |||
// from the project. A removed dependency should warn and an added dependency | |||
// should be added to the glide.yaml file. See issue #193. | |||
|
|||
if stripVendor { | |||
confcopy = godep.RemoveGodepSubpackages(confcopy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codewise, do you want to hardcode anything godep in a non-godep dir? If it were me, I would do something like:
main():
plugins := []ToolPlugin{NewGoToolPlugin()}
plugins = append(plugins, godep.ProbePlugins()...)
plugins = append(plugins, gom.ProbePlugins()...)
// etc
...where ToolPlugin is an interface. One of the methods on ToolPlugin might be RemoveVendoredJunk()
. So here you would just loop over all plugins and have them remove their own vendored junk.
Something like that...(I am a big fan of opaque plugins)
I've been ponder this and a few things are relevant:
With that I think it's ready to go. |
Add ability to remove nested vendor and Godeps/_workspace directories
@technosophos @sgotti @thockin can you please take a look at this.