Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

support nested vendor/ dirs #985

Closed
aybabtme opened this issue Aug 9, 2017 · 9 comments
Closed

support nested vendor/ dirs #985

aybabtme opened this issue Aug 9, 2017 · 9 comments
Labels

Comments

@aybabtme
Copy link

aybabtme commented Aug 9, 2017

The Go tool supports recursively looking up dependencies that may be vendored in ./vendor directories and their parents. It seems that dep doesn't support vendoring dependencies in nested dirs. Example:

src/do.co/monorepo/vendor
src/do.co/monorepo/large_project/with_many/specific_needs/vendor

In this example, monorepo/vendor contains global, generally needed dependencies that may have been vendored using another tool, while monorepo/large_project/with_many/specific_needs/vendor contains dependencies needed only by that project, which we want to use dep to manage.

This seems to currently not be possible. dep appears to be ignoring the dependencies vendored in monorepo/vendor and try to pull them again in monorepo/large_project/with_many/specific_needs/vendor.

@sdboyer
Copy link
Member

sdboyer commented Aug 9, 2017

hi! thanks for the issue.

yes, flattening vendor directories up to the single, topmost level is foundational to dep's design. nested vendor directories can cause numerous problems, and eliminating them was an intentional choice. changing that design is not something we can do.

dep is not primarily designed for use in monorepos right now. it is possible, but only for monorepo layouts with specific properties. i have a nascent plan about how we might make it useful for arbitrary monorepos, but i need a) time and b) folks with monorepos willing to collaborate with me on figuring it out 😉

in the meantime, though, i'm marking this for docs, as we should at least have an FAQ entry that details how dep can be used within a monorepo today.

@sdboyer sdboyer added the docs label Aug 9, 2017
@aybabtme
Copy link
Author

aybabtme commented Aug 9, 2017

@sdboyer perfect! My contrived example comes from the fact that we can't use dep right now to vendor for our whole monorepo, it appears not to work. But I thought, maybe I can introduce it at a smaller level.

I'll try to loop back with info about why dep doesn't work on our monorepo, if that's useful to you.

@sdboyer
Copy link
Member

sdboyer commented Aug 9, 2017

@aybabtme that'd be great! i have a few orgs i've talked to about their monorepos, but i still don't have anything written about where the real pain points are.

@aybabtme
Copy link
Author

aybabtme commented Aug 9, 2017

@sdboyer cool is there a specific doc/ticket where we should provide this info?

Our biggest hurdle so far has been speed: we have thousands of vendored dependencies and similarly many internal packages, this seems to cause problems to dep as it takes many minutes to run commands. Because of this, making dep work with our repo has been hard in itself, since progress and iteration time is very high.

Another thing is that our code layout is:

$ echo $GOPATH
~/cthulhu/docode
$ tree docode/src/ -L 2
docode/src/
└── do
    ├── doge
    ├── exp
    ├── services
    ├── teams
    ├── tools
    └── vendor

@aybabtme
Copy link
Author

cc @fatih

@sdboyer
Copy link
Member

sdboyer commented Aug 10, 2017

is there a specific doc/ticket where we should provide this info?

this ticket's a fine place to give that feedback. you can also email me, if you'd rather keep it private.

Our biggest hurdle so far has been speed

yeah, we've been deferring on performance for a while, but we have a lot of headroom, and are making headway on the major things that will help - #121, #431. a month or two, maybe?

@sdboyer
Copy link
Member

sdboyer commented Aug 27, 2017

i'm gonna close this out, just to try to keep the issue queue tidy. when y'all have a chance to get to that feedback, please feel free to reopen 😄

@sdboyer sdboyer closed this as completed Aug 27, 2017
@bhcleek
Copy link

bhcleek commented Dec 1, 2017

@sdboyer I have some more specific feedback for you about this. If you'll re-open this issue, I can put it here. Otherwise, please let me know if you'd rather I just open a new issue.

@sdboyer
Copy link
Member

sdboyer commented Dec 2, 2017

@bhcleek new issue is best, i think.

amshinde added a commit to amshinde/kata-runtime that referenced this issue Jul 24, 2019
It is not really recommended to have nested vendor directories.
dep does not work well with nested directories:
golang/dep#985
Recommendation is to use flatten the vendor directories.

Hence remove any nested vendor directories.

Fixes kata-containers#1909

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-tests that referenced this issue Jul 25, 2019
This repository contains multiple Gopkg.* files which defines
dependencies for each stand-alone application within this repository.
This was posing an issue where there was no predictable way of
confirming that vendor folder is in sync with the versions defined in
Gopkg files. dep tool does not handle multiple sub folder definitions
and is not a feature that is in their pipeline. This effort is to unify
all the dependencies to allow `dep check` on the repository. Check
golang/dep#985 for dep issues with nesting.

Fixes: kata-containers#1794
Fixes: kata-containers#1733
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-tests that referenced this issue Jul 26, 2019
This repository contains multiple Gopkg.* files which defines
dependencies for each stand-alone application within this repository.
This was posing an issue where there was no predictable way of
confirming that vendor folder is in sync with the versions defined in
Gopkg files. dep tool does not handle multiple sub folder definitions
and is not a feature that is in their pipeline. This effort is to unify
all the dependencies to allow `dep check` on the repository. Check
golang/dep#985 for dep issues with nesting.

Fixes: kata-containers#1794
Fixes: kata-containers#1733
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-tests that referenced this issue Jul 26, 2019
This repository contains multiple Gopkg.* files which defines
dependencies for each stand-alone application within this repository.
This was posing an issue where there was no predictable way of
confirming that vendor folder is in sync with the versions defined in
Gopkg files. dep tool does not handle multiple sub folder definitions
and is not a feature that is in their pipeline. This effort is to unify
all the dependencies to allow `dep check` on the repository. Check
golang/dep#985 for dep issues with nesting.

Fixes: kata-containers#1794
Fixes: kata-containers#1733
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-tests that referenced this issue Jul 26, 2019
This repository contains multiple Gopkg.* files which defines
dependencies for each stand-alone application within this repository.
This was posing an issue where there was no predictable way of
confirming that vendor folder is in sync with the versions defined in
Gopkg files. dep tool does not handle multiple sub folder definitions
and is not a feature that is in their pipeline. This effort is to unify
all the dependencies to allow `dep check` on the repository. Check
golang/dep#985 for dep issues with nesting.

Fixes: kata-containers#1794
Fixes: kata-containers#1733
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-tests that referenced this issue Jul 26, 2019
This repository contains multiple Gopkg.* files which defines
dependencies for each stand-alone application within this repository.
This was posing an issue where there was no predictable way of
confirming that vendor folder is in sync with the versions defined in
Gopkg files. dep tool does not handle multiple sub folder definitions
and is not a feature that is in their pipeline. This effort is to unify
all the dependencies to allow `dep check` on the repository. Check
golang/dep#985 for dep issues with nesting.

Fixes: kata-containers#1794
Fixes: kata-containers#1733
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants