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: on Windows "The system cannot find the file specified" #26195

Closed
Siddharthaghosal opened this issue Jul 3, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@Siddharthaghosal
Copy link

commented Jul 3, 2018

Please answer these questions before submitting your issue. Thanks!

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

go1.10.3

Does this issue reproduce with the latest release?

Yes

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

Listed below:
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Controller\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\01-Sid\1-Program\15-Go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\CONTRO~1\AppData\Local\Temp\go-build496030074=/tmp/go-build -gno-record-gcc-switches

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.

Running "go get github.com/golang/example/hello" gives file not found error:

What did you expect to see?

Error free execution

What did you see instead?

_# internal/race
compile: seeking in output [0, 1]: seek $WORK\b006\_pkg_.a: The system cannot find the file specified.
# runtime/internal/sys
compile: seeking in output [0, 1]: seek $WORK\b010\_pkg_.a: The system cannot find the file specified.
# errors
compile: seeking in output [0, 1]: seek $WORK\b003\_pkg_.a: The system cannot find the file specified.
# runtime/internal/atomic
compile: seeking in output [0, 1]: seek $WORK\b009\_pkg_.a: The system cannot find the file specified.
# sync/atomic
compile: seeking in output [0, 1]: seek $WORK\b011\_pkg_.a: The system cannot find the file specified.
# internal/cpu
compile: seeking in output [0, 1]: seek $WORK\b013\_pkg_.a: The system cannot find the file specified.
# internal/syscall/windows/sysdll
compile: seeking in output [0, 1]: seek $WORK\b017\_pkg_.a: The system cannot find the file specified.
# unicode/utf16
compile: seeking in output [0, 1]: seek $WORK\b019\_pkg_.a: The system cannot find the file specified.
# unicode/utf8
compile: seeking in output [0, 1]: seek $WORK\b022\_pkg_.a: The system cannot find the file specified.
# github.com/golang/example/stringutil
compile: seeking in output [0, 1]: seek $WORK\b027\_pkg_.a: The system cannot find the file specified.
# unicode_
compile: seeking in output [0, 1]: seek $WORK\b026\_pkg_.a: The system cannot find the file specified.

@ianlancetaylor ianlancetaylor changed the title Installation Issue on Windows 10 ? cmd/go: on Windows "The system cannot find the file specified" Jul 3, 2018

@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Jul 3, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2018

Does anything work at all? Can you create a small hello.go file and run go run hello.go?

Since this is Windows one always has to wonder about whether a virus checker is interfering. It looks like something is preventing access to the .a files that the Go compiler creates.

@Siddharthaghosal

This comment has been minimized.

Copy link
Author

commented Jul 4, 2018

I tried running a very simple go file as you suggested. Still I receive the same error.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2018

What is the output of go run -x hello.go?

@kjk

This comment has been minimized.

Copy link

commented Jul 4, 2018

It works for me on go 1.10.3 x64 on Windows 10.

PS C:\Users\kjk> go get github.com/golang/example/hello
PS C:\Users\kjk> go version
go version go1.10.3 windows/amd64

I think the anti-virus hint is most likely. @Siddharthaghosal try disabling all third party anti-virus software.

To debug this issue you can use a tool like Process Monitor (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) to see all file activity to narrow down the process that is touching _pkg_.a.

The error message suggests that some process deletes a file which anti-virus software tends to do.
Using Process Monitor you can find out which process did that.

@gopherbot

This comment has been minimized.

Copy link

commented Aug 4, 2018

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Aug 4, 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.