dep ensure deletes the vendored packages not in gopkg.toml

Created on 1 Mar 2018  路  6Comments  路  Source: golang/dep

I have a c library that I link with my go app. Source of this library is vendored in ./vendor directory along with other go dependencies (managed by dep). When I run dep ensure however, it seems to delete the c lib directory in ./vendor. Is there any way that I can instruct dep to keep everything that's not tracked by gopkg.toml intact?

ensure

Most helpful comment

I'm not sure I get the issue, so I'll ask some questions to understand better:

  • Is the c code vendored by dep? Or did you add it manually?
  • What are the prune options defined in Gopkg.toml?

dep assumes that it owns vendor/ and will delete it when it needs to change any dependencies. If you want to add any packages and control them, use something else besides vendor/

All 6 comments

I'm not sure I get the issue, so I'll ask some questions to understand better:

  • Is the c code vendored by dep? Or did you add it manually?
  • What are the prune options defined in Gopkg.toml?

dep assumes that it owns vendor/ and will delete it when it needs to change any dependencies. If you want to add any packages and control them, use something else besides vendor/

  • c code is not vendored by dep.
  • I haven't specified prune option. So it should be the default.

I'm using a custom script to vendor c code because it uses git submodules and complicates things a bit on my end. It would be great if I could tell dep not to touch certain directories in vendor.

I have a similar issue in a project that requires some packages managed with gx (IPFS package manager)- these cannot be managed outside gx. Would be great if I could use dep for all non-gx packages by telling it to stop deleting vendor/gx.

This can also be noticed with:

https://github.com/go-goracle/goracle

@buddyspike Hey buddy, Did you find any solutions to keep your own package?

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdboyer picture sdboyer  路  3Comments

alethenorio picture alethenorio  路  3Comments

rogpeppe picture rogpeppe  路  4Comments

abeMedia picture abeMedia  路  3Comments

jeffwillette picture jeffwillette  路  3Comments