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

Comments

Projects
None yet
4 participants
@BenLubar
Copy link

commented Jul 31, 2018

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

This comment has been minimized.

Copy link
Author

commented Jul 31, 2018

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2018

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2018

@myitcv Thanks for pointing that out.

@gopherbot

This comment has been minimized.

Copy link

commented Aug 1, 2018

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

@gopherbot gopherbot closed this in 3acd257 Aug 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.