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: GO15VENDOREXPERIMENT go get errors out when using submodules in /vendor #12573

Closed
StephanDollberg opened this issue Sep 10, 2015 · 7 comments
Milestone

Comments

@StephanDollberg
Copy link

As per golang-nuts:

I am trying to get vendoring working with submodules which is supposed to be working according to s/go15vender. The building part works fine but the "go get" part doesn't.

To reproduce I created a test repo by doing the following:

Created a test package and added a submodule via:

 git submodule add https://github.com/dgrijalva/jwt-go vendor/github.com/dgrijalva/jwt-go

Committed everything.

Now, if I do:

GO15VENDOREXPERIMENT=1 go get github.com/StephanDollberg/govendorsubmodulestest

I get the error:

# cd .; git --git-dir=/$GOPATH/src/github.com/StephanDollberg/govendorsubmodulestest/.git submodule update --init --recursive
No submodule mapping found in .gitmodules for path 'vendor/github.com/dgrijalva/jwt-go'
package github.com/StephanDollberg/govendorsubmodulestest: exit status 1

The interesting thing is that if I do a go get -u after that it checks out the submodule correctly. Looking at the error and the source of the go command I think it has to do with --git-dir not working together with the submodule command.

I tested this on Windows, Mac OSX and Linux (all Intel 64bit) with go 1.5.1 and several git versions (2.3, 2.4, 2.5).

@kovetskiy
Copy link

any progress on this issue?

@StephanDollberg
Copy link
Author

Not from my side no. The other dupe is labeled Go 1.6 so I doubt there will be any quick fix for this.

@kovetskiy
Copy link

@StephanDollberg labeled Go 1.6 where is? I see Labels None yet.

@StephanDollberg
Copy link
Author

Yeah, not on this one but on #12612.

@oschwald
Copy link

This is affecting several users of my geoip2 module as discussed in oschwald/geoip2-golang#13. I might have to replace my submodule usage, but it would be really nice to get this fixed.

@StephanDollberg
Copy link
Author

Agree with you. Workaround in the time being is to run go get -u after the initial go get.

erbridge added a commit to limetext/tasks that referenced this issue Sep 26, 2015
Include workaround for golang/go#12573.
@rsc rsc added this to the Go1.6 milestone Oct 23, 2015
@rsc
Copy link
Contributor

rsc commented Nov 5, 2015

Duplicate of #12612 (which has a suggested fix).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants