tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.53k stars 454 forks source link

Allow vendoring of main packages #457

Open sethgrid opened 8 years ago

sethgrid commented 8 years ago

We have build tools and scripts. Because godep does not allow for main packages to be vendored, we are faced with a crappy situation: don't vendor or vendor the binary. Checking in a binary is no bueno. To add color here: we run ./bin/whatever.sh. In there, we want to do things like run ffjson or other build helpers. Some (many?) of these build helpers are main packages. I want to vendor them with Godep so I can ensure my build process stays constant. As it stands, I currently have to have go get blah.blah.blah in the ./bin/whatever instead of having it in Godep. An option like go save ./... -allow-main would be super handy.

freeformz commented 8 years ago

It does, although it's a little janky and doesn't work well with the vendor experiment. We use it internally @ Heroku.

godep save ./... github.com/mattes/migrate saves both local deps and the main that is github.com/mattes/migrate.

Janky parts:

  1. You need to always save both of those.
  2. It doesn't work well with vendor/ in that you can't then go install github.com/mattes/migrate. You have to prefix your local project's package name to it + vendor like so go install github,com/heroku/project/vendor/github.com/mattes/migrate. This is a limitation of how the vendor/ experiment works. If you are using old style godep workspaces then it's simply godep go install github.com/mattes/migrate.

Does that help?

sethgrid commented 8 years ago

I'll take a look at that; thanks