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
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Siddharthaghosal
Copy link

Siddharthaghosal 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 OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 3, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Jul 3, 2018
@ianlancetaylor
Copy link
Contributor

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
Copy link
Author

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

@ianlancetaylor
Copy link
Contributor

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

@kjk
Copy link

kjk 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.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 4, 2018
@gopherbot
Copy link

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.)

@golang golang locked and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows 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