-
Notifications
You must be signed in to change notification settings - Fork 18k
vendor: go build error when in some dependence #12432
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
Comments
I don't see how the go tool could reasonably know that your two copies of a are the same package. They are different source files in different directories. Go does not require that all package names be unique. I think that the tool you use to set up this directory structure will need to recognize common packages and consolidate them into a single place. I don't see how else it could work. Closing this because I don't see that the go tool can do anything here. |
I don't understand why it is vendor-tools responsibility to handle this scenario and not Go. I'm facing the same issue, it is really inconvenient. Are there any functional blockers preventing the implementation of such feature? |
Vendor tools manage vendored dependencies. It seems natural that they should handle deduplication of vendored pacakges. |
After thoughts, I think I got it: the problem is putting dependencies in different /vendor folders and not aggregating them in the one being go build'd ? So, theoretically, we could but a dependency definition in different packages. Before we call 'go build', /vendor folders of every module should be empty. Then, in the 'main one' (the one being go build'd), we fetch the dependencies of all the packages and putting them into its /vendor folder. At the end, go will find only one occurrence of a package into that folder. Does that makes sense? Am I missing something? |
@benjboyer you're missing a lot of discussion about package management in Go. You might want to describe to the go-package-management and golang-dev mailing lists, and take a look at the list archives to see a lot of what you've missed. It's not a simple issue. |
@benjboyer the main problem here is that impossible to verify automatically that |
how do you resolve a conflict, even manually, if the package your importing is from another repository outside your control, and is exporting things with references to other standard repos like x tools repo? |
Question about it here https://groups.google.com/forum/#!topic/golang-nuts/liKQ6gtU4hk |
I just try to build my project with GO15VENDOREXPERIMENT support with glide.
But I found there is something wrong when build it.
Code Tree:
vendor/a
andvendor/b/vendor/a
are same package.vendor/a/a.go
vendor/b/b.go
main.go
When run
go build
, error occur:Is there other goodway to manage those relationships between packages?
Will
go build
dealvendor/
specially to meet the use?The text was updated successfully, but these errors were encountered: