Skip to content

Compilator takes unpredictable build times and I have no idea what it's doing and why it's doing #70691

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

Closed
erikpa1 opened this issue Dec 5, 2024 · 4 comments

Comments

@erikpa1
Copy link

erikpa1 commented Dec 5, 2024

Go version

go1.21.1 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\erikp\AppData\Local\go-build
set GOENV=C:\Users\erikp\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\erikp\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\erikp\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=Z:\golang
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.1
set GODEBUG=
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\erikp\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=NUL
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=Z:\golang\go-build1240576678=/tmp/go-build -gno-record-gcc-switches

What did you do?

Hi after running go run command I have unpredictable start times, sometimes, I change something in file like adding log and it compiles in while and sometimes I add log and do
go run -x main.go

I got log WORK=Z:\golang\go-build3974498775

and I'm waiting, and I have no idea what is happening or what is progress of it, and just before build I got full log and app is running.

There can be maybe something in templates ? I use them a lot.

And also I put build directory and go under firewall exclusion and created windows dev drive to minimalize times but nothing helped.

What did you see happen?

Nothing and I hate those predefined github templates

What did you expect to see?

Could be nice to log more of golang progress and maybe decision ? Like "You added + sign so I'm going to rebuild whole application" or something similar. My final build is 22 MB so no big application I guess.

@seankhliao
Copy link
Member

if -v -x don't show anything, then something is blocking go, most likely antivirus or other security software. go can't know why it's being blocked.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2024
@erikpa1
Copy link
Author

erikpa1 commented Dec 5, 2024

@seankhliao But first log is there. The rest takes too long.

image

Do you have some suggestions for windows ? I disabled firewall for tmp folder, for folder where project is,... (wsl ubuntu looks like it has no problem)

Also in Rust or C++ there is no problem with it ,... and they work on similar principles

@erikpa1
Copy link
Author

erikpa1 commented Mar 14, 2025

@seankhliao I probably achieved victory,... I installed avast which disabled windows defender, in avast I put exception to User/AppData for "go" and "go-build" folders, performance looks amazing and startup times are sometimes logner, but I'm talking about seconds, not minutes....

(BTW, in windwos I had also exclude folder, didn't help)

This is small step for man, but big for humanity.

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

No branches or pull requests

3 participants