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 in module mode does not initialize git submodules #26716

Closed
BenLubar opened this issue Jul 31, 2018 · 6 comments
Closed

cmd/go: go get in module mode does not initialize git submodules #26716

BenLubar opened this issue Jul 31, 2018 · 6 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@BenLubar
Copy link

Please answer these questions before submitting your issue. Thanks!

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

# In a directory outside of $GOPATH:
go mod -init -module example.invalid/gapstone-test
go get github.com/benlubar/gapstone@go-get

What did you expect to see?

Successful completion of the command.

What did you see instead?

go: finding github.com/benlubar/gapstone go-get
go: downloading github.com/benlubar/gapstone v0.0.0-20180731154137-aefb8fb9d854
# github.com/benlubar/gapstone
..\..\..\go\src\mod\github.com\benlubar\gapstone@v0.0.0-20180731154137-aefb8fb9d854\arm64_constants.go:19:32: fatal error: capstone/capstone.h: No such file or directory
 // #include <capstone/capstone.h>
                                ^
compilation terminated.

Does this issue reproduce with the latest release (go1.10.3)?

No. Go 1.10.3 correctly initializes the git submodule, as does go1.11beta2 when not using go.mod.

System details

go version go1.11beta2 windows/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="C:\Users\Owner\AppData\Local\go-build"
GOEXE=".exe"
GOHOSTARCH="amd64"
GOHOSTOS="windows"
GOOS="windows"
GOPATH="C:\Users\Owner\go"
GOPROXY=""
GORACE=""
GOROOT="C:\tools\go"
GOTMPDIR=""
GOTOOLDIR="C:\tools\go\pkg\tool\windows_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="C:\Users\Owner\Source\Repos\gapstone-test\go.mod"
GOROOT/bin/go version: go version go1.11beta2 windows/amd64
GOROOT/bin/go tool compile -V: compile version go1.11beta2
gdb --version: GNU gdb (GDB) 7.10.1
@BenLubar
Copy link
Author

As a side note, this fails with a different error message if you capitalize my GitHub username in the import path:

go: finding github.com/BenLubar/gapstone go-get
go: downloading github.com/BenLubar/gapstone v0.0.0-20180731154137-aefb8fb9d854
can't load package: package github.com/BenLubar/gapstone: C:\Users\Owner\go\src\mod\github.com\!ben!lubar\gapstone@v0.0.0-20180731154137-aefb8fb9d854\engine.go: malformed #cgo argument: -IC:/Users/Owner/go/src/mod/github.com/!ben!lubar/gapstone@v0.0.0-20180731154137-aefb8fb9d854/include

I assume this is because cgo doesn't like ! in paths.

@myitcv
Copy link
Member

myitcv commented Jul 31, 2018

Git submodules are not going to be supported per #24094 (comment)

Leaving this issue open however for the cgo issue

cc @ianlancetaylor

@ianlancetaylor
Copy link
Contributor

The go tool is working as intended in rejecting cgo file names that contain !. For 1.11 this is documented at https://tip.golang.org/cmd/cgo. Closing as I don't think there is anything we are going to do here; please comment if you disagree.

@myitcv
Copy link
Member

myitcv commented Aug 1, 2018

@ianlancetaylor I think the ! is as a result of https://go-review.googlesource.com/c/go/+/124378

So cc-ed you just to ensure everything is working as intended post that?

@ianlancetaylor
Copy link
Contributor

@myitcv Thanks for pointing that out.

@ianlancetaylor ianlancetaylor reopened this Aug 1, 2018
@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. modules labels Aug 1, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Aug 1, 2018
@gopherbot
Copy link

Change https://golang.org/cl/127297 mentions this issue: go/build: accept ! in cgo arguments

@golang golang locked and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants