go build hangs with 1.15.7 on Windows 10

463 views
Skip to first unread message

pst...@gmail.com

unread,
Jan 25, 2021, 2:07:50 PM1/25/21
to golang-nuts
Hello,
I just upgraded to 1.15.7 from 1.13, and I'm not able to compile. Running go build seems to just hang. In task manager I see a compile.exe task that's taking no CPU, and an insignificant amount of memory.

To see if it was a problem with my code, I created a hello world program (just copying the sample from the playground) and the same issue happens with it.

I'm still using GOPATH, I haven't switched to modules yet. My GOPATH is on a local drive, and is accessible.

If I use go build -x, the only output I get is the following:
WORK=C:\Users\user\AppData\Local\Temp\go-build204013186

Setting GOOS to crosscompile to linux goes further, but still hangs.
WORK=C:\Users\user\AppData\Local\Temp\go-build052589534
mkdir -p $WORK\b023\
cat >$WORK\b023\importcfg << 'EOF' # internal
# import config
packagefile internal/reflectlite=C:\Users\user\AppData\Local\go-build\6f\6f62c71b28d490ee27f4a253dd63074ac65917dbafe91170adfab668f455c5dc-d
EOF
cd c:\go\src\sort
"c:\\go\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b023\\_pkg_.a" -trimpath "$WORK\\b023=>" -p sort -std -complete -buildid 5BeViscjUZLaErxCsI3Y/5BeViscjUZLaErxCsI3Y -goversion go1.15.7 -D "" -importcfg "$WORK\\b023\\importcfg" -
pack -c=4 "c:\\go\\src\\sort\\search.go" "c:\\go\\src\\sort\\slice.go" "c:\\go\\src\\sort\\slice_go113.go" "c:\\go\\src\\sort\\sort.go" "c:\\go\\src\\sort\\zfuncversion.go"
mkdir -p $WORK\b025\
cat >$WORK\b025\importcfg << 'EOF' # internal
# import config
packagefile errors=C:\Users\user\AppData\Local\go-build\49\49c4c46a70c1b077febd83bc981a6eeda870fd35abf43ea858acd251a7031273-d
packagefile internal/oserror=C:\Users\user\AppData\Local\go-build\a7\a7493678219dbfa5e59067658943523cf1b8f62735bda9a8be918ccdcadb9357-d
packagefile internal/poll=C:\Users\user\AppData\Local\go-build\da\da3b5155b67067f3fdd59012bec17a5f3554c7fd6f87d3729a1f650755c0b470-d
packagefile internal/syscall/execenv=C:\Users\user\AppData\Local\go-build\e5\e5ba3b488d5b537994efa9dc546579c51ff587899730c3a2271a04e5fc30d426-d
packagefile internal/syscall/unix=C:\Users\user\AppData\Local\go-build\cb\cbae4e7e3995b25ddd29fe0b077b64a5d3a5bea112c816bc42276a7f27a3d4a2-d
packagefile internal/testlog=C:\Users\user\AppData\Local\go-build\28\2816b620a45111165f2f4a7541fbc9f6da442733f201c8b70f74e257b49c108a-d
packagefile io=C:\Users\user\AppData\Local\go-build\2c\2c9189ba488c70f168f844968dd3521c545ebb1738e037d12d7602faade01bac-d
packagefile runtime=C:\Users\user\AppData\Local\go-build\2f\2fd345dbd651acc3083cac58594aa5b98a56171bf74fad26b92e85cdf0409a9f-d
packagefile sync=C:\Users\user\AppData\Local\go-build\7a\7afc3eb2a24ef1258f8fbe3c5dc0617a6bed02cea0dc9b5cc2c3f29b6351ce9d-d
packagefile sync/atomic=C:\Users\user\AppData\Local\go-build\06\06ea2f491e7a661cc38cdd4954061feaa20f7544683a929807850837ca424f39-d
packagefile syscall=C:\Users\user\AppData\Local\go-build\b8\b88dfc301ada3df5ff0cbcd2d58f4b46f270cb6d23dd7ad0a75120d3c5ad43b9-d
packagefile time=C:\Users\user\AppData\Local\go-build\ca\ca92c7e1fe41302782dae27c9639d293a74a11a0c52ebd92b16c1c1dd0df4b85-d
EOF
cd c:\go\src\os
"c:\\go\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b025\\_pkg_.a" -trimpath "$WORK\\b025=>" -p os -std -buildid -l8Zd1U0WISvC8NgBDnO/-l8Zd1U0WISvC8NgBDnO -goversion go1.15.7 -D "" -importcfg "$WORK\\b025\\importcfg" -pack -c=4 "c
:\\go\\src\\os\\dir.go" "c:\\go\\src\\os\\dir_unix.go" "c:\\go\\src\\os\\env.go" "c:\\go\\src\\os\\error.go" "c:\\go\\src\\os\\error_errno.go" "c:\\go\\src\\os\\error_posix.go" "c:\\go\\src\\os\\exec.go" "c:\\go\\src\\os\\exec_posix.go"
"c:\\go\\src\\os\\exec_unix.go" "c:\\go\\src\\os\\executable.go" "c:\\go\\src\\os\\executable_procfs.go" "c:\\go\\src\\os\\file.go" "c:\\go\\src\\os\\file_posix.go" "c:\\go\\src\\os\\file_unix.go" "c:\\go\\src\\os\\getwd.go" "c:\\go\\src
\\os\\path.go" "c:\\go\\src\\os\\path_unix.go" "c:\\go\\src\\os\\pipe_linux.go" "c:\\go\\src\\os\\proc.go" "c:\\go\\src\\os\\rawconn.go" "c:\\go\\src\\os\\readfrom_linux.go" "c:\\go\\src\\os\\removeall_at.go" "c:\\go\\src\\os\\stat.go" "
c:\\go\\src\\os\\stat_linux.go" "c:\\go\\src\\os\\stat_unix.go" "c:\\go\\src\\os\\sticky_notbsd.go" "c:\\go\\src\\os\\str.go" "c:\\go\\src\\os\\sys.go" "c:\\go\\src\\os\\sys_linux.go" "c:\\go\\src\\os\\sys_unix.go" "c:\\go\\src\\os\\type
s.go" "c:\\go\\src\\os\\types_unix.go" "c:\\go\\src\\os\\wait_waitid.go"
"c:\\go\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b023\\_pkg_.a" # internal
cp "$WORK\\b023\\_pkg_.a" "C:\\Users\\user\\AppData\\Local\\go-build\\a7\\a77e816c2c2312aa35a6650f2e8f45e7333e0437a6f42b3a7e6bbc9a714b104b-d" # internal
mkdir -p $WORK\b013\
cat >$WORK\b013\importcfg << 'EOF' # internal
# import config
packagefile reflect=C:\Users\user\AppData\Local\go-build\8f\8f329d6aa623fcd6c55d1bd5881205928b9317fe0514066a37c5111b21444785-d
packagefile sort=$WORK\b023\_pkg_.a
EOF
cd c:\go\src\internal\fmtsort
"c:\\go\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b013\\_pkg_.a" -trimpath "$WORK\\b013=>" -p internal/fmtsort -std -complete -buildid UalcuDun_RcgFnS2uw4F/UalcuDun_RcgFnS2uw4F -goversion go1.15.7 -D "" -importcfg "$WORK\\b013\\
importcfg" -pack -c=4 "c:\\go\\src\\internal\\fmtsort\\sort.go"
"c:\\go\\pkg\\tool\\windows_amd64\\buildid.exe" -w "$WORK\\b013\\_pkg_.a" # internal
cp "$WORK\\b013\\_pkg_.a" "C:\\Users\\user\\AppData\\Local\\go-build\\80\\809ad0e492f9249db191e2413b825d32f2d90efd59119d3c07ba34d12a98970c-d" # internal

I have access to a linux server running 1.15.5, and I have no problems compiling on there.

Any ideas, or anything else I should check?

bnix...@gmail.com

unread,
Jan 25, 2021, 9:34:24 PM1/25/21
to golang-nuts
Are you performing the build in native windows CMD/PowerShelll or in WSL?

Philip Stein

unread,
Jan 25, 2021, 10:21:16 PM1/25/21
to golang-nuts
I'm using the native windows CMD.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0a01f264-c82b-46ed-bdff-a7a53e689d3fn%40googlegroups.com.

Wojciech S. Czarnecki

unread,
Jan 26, 2021, 5:28:59 AM1/26/21
to golan...@googlegroups.com
Dnia 2021-01-25, o godz. 11:07:50
"pst...@gmail.com" <pst...@gmail.com> napisał(a):

> I just upgraded to 1.15.7 from 1.13, and I'm not able to compile. Running
> go build seems to just hang. In task manager I see a compile.exe task
> that's taking no CPU, and an insignificant amount of memory.
...
> I have access to a linux server running 1.15.5, and I have no problems
> compiling on there.
>
> Any ideas, or anything else I should check?

Check logs of your antivirus software.
Use GOTMPDIR and GOBIN pointing to locations free of overzealous AV interventions.
Add go compiler binaries to AV exemption lists.

Hope this helps,

--
Wojciech S. Czarnecki
<< ^oo^ >> OHIR-RIPE

Philip Stein

unread,
Jan 26, 2021, 4:44:14 PM1/26/21
to golang-nuts
It was a good suggestion, but unfortunately my AV doesn't show anything in it's logs, and I already had the executables allowed. 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Philip Stein

unread,
Feb 1, 2021, 4:51:42 PM2/1/21
to golang-nuts
It turns out that you were right. Despite my antivirus not logging anything, and the directories and executables being allowed, they were blocked. 

An antivirus update seems to have resolved it. 

On Tue., Jan. 26, 2021, 3:28 a.m. Wojciech S. Czarnecki, <oh...@fairbe.org> wrote:
Reply all
Reply to author
Forward
0 new messages