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

Compiler fetching offline modules during build causing slow compiles #29856

Closed
tvarwig opened this issue Jan 21, 2019 · 3 comments
Closed

Compiler fetching offline modules during build causing slow compiles #29856

tvarwig opened this issue Jan 21, 2019 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@tvarwig
Copy link

tvarwig commented Jan 21, 2019

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

$ go version
go version go1.11 darwin/amd64

Does this issue reproduce with the latest release?

Yes latest stable release

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tvarwig/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tvarwig/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/w4/xxfhfbg12j12lf5h78g0cg3r0000gn/T/go-build270144360=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

After enabling modules support go run and go build take minuets to compile. I have ran the go mod vendor to create the vendor folder. Without modules enabled compile time is less than a second. They do successfully compile.

After running verbose the compiler is trying to fetch offline modules with the following message https fetch failed: Get https://mygit.net/myapp/pb/users?go-get=1: dial tcp gitipaddress:443: i/o timeout

In the go.mod I have the replace option with those modules

module mygit.net/myapp/api/gui

require (
	mygit.net/myapp/pb/users v0.0.0
	github.com/dgrijalva/jwt-go v3.2.0+incompatible
	github.com/go-redis/redis v6.15.1+incompatible
	github.com/gogo/protobuf v1.2.0
	github.com/google/uuid v1.1.0
	github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7 // indirect
	github.com/jpillora/go-tld v0.0.0-20180808214523-4bfc8d9a90b5
	github.com/labstack/echo v3.3.5+incompatible
	github.com/labstack/gommon v0.2.8 // indirect
	github.com/mattn/go-colorable v0.0.9 // indirect
	github.com/mattn/go-isatty v0.0.4 // indirect
	github.com/spf13/viper v1.3.1
	github.com/valyala/bytebufferpool v1.0.0 // indirect
	github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 // indirect
	golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc
	google.golang.org/grpc v1.18.0
)

replace mygit.net/myapp/pb/users => ../../pb/users

What did you expect to see?

faster compiling times before modules. From what I have studies the replace should look locally and not fetch.

What did you see instead?

slow compile times.

@mvdan
Copy link
Member

mvdan commented Jan 21, 2019

This seems like a duplicate of #27859, which has been marked as fixed for 1.12. Could you try usnig 1.12beta2?

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 22, 2019
@bcmills
Copy link
Contributor

bcmills commented Jan 22, 2019

Closing as duplicate of #27859.

@bcmills bcmills closed this as completed Jan 22, 2019
@tvarwig
Copy link
Author

tvarwig commented Jan 24, 2019

1.12beta2 does fix the issue

@golang golang locked and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants