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

Multiple issues with go build #41455

Closed
mcandre opened this issue Sep 17, 2020 · 3 comments
Closed

Multiple issues with go build #41455

mcandre opened this issue Sep 17, 2020 · 3 comments

Comments

@mcandre
Copy link

@mcandre mcandre commented Sep 17, 2020

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

$ go version
go version go1.13 darwin/amd64

Does this issue reproduce with the latest release?

Not sure.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/pen4587/Library/Caches/go-build"
GOENV="/Users/pen4587/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/pen4587/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/pen4587/.gvm/gos/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/pen4587/.gvm/gos/go1.13/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/pen4587/go/src/git.nmlv.nml.com/api-management/bubbler/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7p/fn0jqw_s0cq5sc9z3dc64n5h0000gp/T/go-build928063465=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Using go build... behind a corporate firewall:

$ go build -buildmode=plugin -o bubbler.so plugin/bubbler/main.go

I have checked in all my dependencies using go mod tidy, go mod verify.

The dependencies are on disk and checked into git history, at vendor/

However, when I load the same file tree into a library/golang:1.13 container and try to run that same exact build step, then for some reason Go insists on redownloading the dependencies, which fails due to the container not having the right proxy settings.

Some other go... commands offer an -insecure flag to work around this. But go build does not appear to have this option available.

What did you expect to see?

The build silently succeed with a zero exit code.

What did you see instead?

Go complains about downloading one of the vendor/ed dependencies.

@johnaoss
Copy link

@johnaoss johnaoss commented Sep 17, 2020

@mcandre Hi there!

From the Module Reference:

If the vendor directory is present in the main module's root directory, it will be used automatically if the go version in the main module's go.mod file is 1.14 or higher. To explicitly enable vendoring, invoke the go command with the flag -mod=vendor. To disable vendoring, use the flag -mod=mod.

Can you try changing the command to go build -mod=vendor -buildmode=plugin -o bubbler.so plugin/bubbler/main.go and see if that works?

Although the documentation states its for Go 1.15, I'm not sure this solution will work on Go 1.13, but may be worth a shot! Hope it helps.

@bcmills
Copy link
Member

@bcmills bcmills commented Sep 17, 2020

Per the release policy, go 1.13 has not been supported since the release of Go 1.15. Please check the behavior using a supported version and let us know if you can still reproduce the problem.

@mvdan
Copy link
Member

@mvdan mvdan commented Oct 11, 2020

Closing early as per #41739 (comment).

@mvdan mvdan closed this Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.