Skip to content
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

cmd/go: 'go get -u' for git submodules under a custom import path fails #21841

Closed
motemen opened this issue Sep 12, 2017 · 2 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@motemen
Copy link
Contributor

motemen commented Sep 12, 2017

What version of Go are you using (go version)?

go version go1.9 darwin/amd64

Does this issue reproduce with the latest release?

Yes, go1.9 is the latest release

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/motemen/dev/go:/Users/motemen/dev"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zf/x09xcy657yxdlzdwvn627ht00000gn/T/go-build151764918=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

motemen.github.io/test-repository is a custom import path and its content is at https://github.com/motemen/test-repository. The repository has a submodule go-nuts, which is pointing at https://github.com/motemen/go-nuts.

% go get motemen.github.io/test-repository/go-nuts/httputil # succeeds
% go get -u -v motemen.github.io/test-repository/go-nuts/httputil # go get -u fails

What did you expect to see?

a successful go get -u.

What did you see instead?

go get -u -v's output:

Fetching https://motemen.github.io/test-repository/go-nuts/httputil?go-get=1
Parsing meta tags from https://motemen.github.io/test-repository/go-nuts/httputil?go-get=1 (status code 404)
get "motemen.github.io/test-repository/go-nuts/httputil": found meta tag get.metaImport{Prefix:"motemen.github.io/test-repository", VCS:"git", RepoRoot:"https://github.com/motemen/test-repository"} at https://motemen.github.io/test-repository/go-nuts/httputil?go-get=1
get "motemen.github.io/test-repository/go-nuts/httputil": verifying non-authoritative meta tag
Fetching https://motemen.github.io/test-repository?go-get=1
Parsing meta tags from https://motemen.github.io/test-repository?go-get=1 (status code 200)
package motemen.github.io/test-repository/go-nuts/httputil: motemen.github.io/test-repository is a custom import path for https://github.com/motemen/test-repository, but /Users/motemen/dev/go/src/motemen.github.io/test-repository/go-nuts is checked out from https://github.com/motemen/go-nuts

It seems that gitRemoteRepo uses git config remote.origin.url, which reports only the submodule's remote, rather than the parent repository's remote. But in this case we want the parent repository's one.

@rakyll rakyll added this to the Go1.10 milestone Sep 12, 2017
@rsc
Copy link
Contributor

rsc commented Dec 1, 2017

Sadly, broken since Go 1.8. Not going to get to it for Go 1.10 either. I would suggest not using submodules. I am not sure how long that support has ever worked nor how long it will last at this point.

@rsc rsc modified the milestones: Go1.10, Go1.11 Dec 1, 2017
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 2, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jul 2, 2018
@bcmills bcmills changed the title cmd/go: 'go get -u' for submodules under a custom import path fails cmd/go: 'go get -u' for git submodules under a custom import path fails Oct 24, 2018
@bcmills
Copy link
Contributor

bcmills commented Oct 24, 2018

This has been broken for a long time, and go get in GOPATH mode is hopefully not going to last too much longer. Module mode doesn't support Git submodules, so I don't think this is worth fixing at this point.

@bcmills bcmills closed this as completed Oct 24, 2018
@golang golang locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants