-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: get -u fails with git submodules #7764
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
Ad "Make GOPATH point to that git submodule". GOPATH is a directory path. How it supposed to point to a file? The go tool works with packages (in the first approximation) and supports the convention package == folder. If GOPATH is /foo/bar then package's file with import path "baz/qux" are sought for in _folder_ /foo/bar/src/baz/qux. IMO #WontFix |
CL https://golang.org/cl/142180043 mentions this issue. |
CL https://golang.org/cl/9815 mentions this issue. |
@tamird sent the above change. Being unsure that fetching git submodules on "go get" is the right thing to do, I asked for some background; they said:
I'm not sure if this is reasonable or not. @dsymonds @bradfitz @rsc @davecheney thoughts? |
This feels like a use case that is niche enough (and git submodules are relatively rare) that it is not worth changing |
The absence of submodule support makes it impossible to conveniently wrap non go-getable repos to make them go-getable. This is a common need whenever a non-go project is used in a go project (see above). Also, the added complexity to |
I agree with @dsymonds that this stuff might be better handled by the various vendoring tools. At least for git. Rationale: Those conversions are very error prone. People also keep forgetting to commit/refresh the git submodule reference while working with a repository containing submodules. I have even seen missing git submodule checkouts used as an advantage by putting an integration test-suite with full of ruby dependencies into a submodule and keep the go gettable sources small and neat that way. |
Are there any other open issues around externals (for svn, hg, etc?) I think the need for this and other externals support increases with vendoring being added in to the go tool (https://groups.google.com/forum/#!msg/golang-dev/74zjMON9glU/4lWCRDCRZg0J). |
I think we should do this. It makes the vendoring proposal much more useful, because it widens the scope of things that 'go get' works for. (And I thought it was already what 'go get' did.) |
Change createCmd, downloadCmd, tagSyncCmd, tagSyncDefault to allow multiple commands. When using the vendoring experiment, fetch git submodules in `go get`, and update them in `go get -u`. This is a reincarnation of https://codereview.appspot.com/142180043. For #7764. Change-Id: I8248efb851130620ef762a765ab8716af430572a Reviewed-on: https://go-review.googlesource.com/9815 Reviewed-by: Russ Cox <rsc@golang.org>
Side note: as an ugly-ish workaround, one could probably create a link to the "sub-gopath" (
in other words, in concrete commands, e.g. below seems to work with Go 1.4:
(although I'm not fully sure yet if that's 100% compatible with git submodules...? sorry.) EDIT: uhm; sorry, I may have misunderstood the original issue; for me, above script seems to work ok and as I'd expect with submodules on Go 1.4 even without the link, i.e. with |
@rsc, just curious, when are issues like this supposed to be closed? I believe the fix was merged into 1.5. |
It's behind the vendor experiment; I'd expect this to stay open until GA. |
I think this is good to close now that 1.6 is GA. |
by daniel.fanjul.alcuten:
The text was updated successfully, but these errors were encountered: