-
Notifications
You must be signed in to change notification settings - Fork 18k
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: go tool dist test fail inside repo #26980
Comments
Closing as duplicate of #26886. Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process. Please see https://golang.org/wiki/Questions for good places to ask questions. |
Thanks for the confirmation. This is not explicit in the documentation of The issue is then that run.bat fails and go tool dist test fails when run inside the repo. I updated the title accordingly. I still suspect that an invalid GOTOOLDIR is used or as underlined above the GOPATH is incorrectly set. |
@davecheney I understand your point but |
It looks like the root failure is
This is not an expected error, and is not seen on our build dashboard or other users in the wild. Could some program you have installed on your computer, possibly an AV program, be interfering with the Go build process? |
I build regularly and the issue started early last week. I re-installed Go with rc1. I clean where there are traces of the build. I have no alarm from AV and no error during build. |
@iwdgo building Go from source does not rely on GOPATH or being inside a repo. Can you please post the complete output from your build invocation. Please do not update the issue description, that makes it hard for people to follow the flow of the issue as it evolves. Thank you. |
Sorry for jumping the gun on the title. My focus is indeed this command inside the repo.
|
Thanks for your update. All I can suggest is something on your computer is blocking C:\Users\{}\Documents\Google\golang\go\go.exe" from being written. Not being a windows user myself I understand how frustrating it must be to be told "please turn off your AV", but this is often the cause of issues like this. |
I believe that it is not trying to update to trying to execute because of the "exec:" word but I could not locate the related source code. There is never been a
and
And from inside go\bin, everything occurs as expected:
|
Can you please try to eliminate any local issues by unsettling any environment variable starting with GO
… On 14 Aug 2018, at 20:38, Constantin Konstantinidis ***@***.***> wrote:
I believe that it is not trying to update to trying to execute because of the "exec:" word but I could not locate the related source code. There is never been a go.exe in the \go directory but only in the go\bin. And the installation has already occurred from what I can read. I confirm that make.bat finishes w/o error.
The structure of go directory is as expected:
14-08-18 09:11 <DIR> .
14-08-18 09:11 <DIR> ..
24-03-18 20:32 347 .gitattributes
30-03-18 21:01 270 .gitcookies
22-07-18 14:59 <DIR> .github
24-03-18 20:32 928 .gitignore
24-07-18 12:59 <DIR> api
13-08-18 16:10 55.284 AUTHORS
14-08-18 09:10 <DIR> bin
24-03-18 20:32 1.339 CONTRIBUTING.md
13-08-18 16:10 71.070 CONTRIBUTORS
13-08-18 16:10 <DIR> doc
24-03-18 20:32 5.686 favicon.ico
24-03-18 20:32 <DIR> lib
24-03-18 20:32 1.479 LICENSE
22-07-18 14:54 <DIR> misc
24-03-18 20:32 1.303 PATENTS
14-08-18 09:11 <DIR> pkg
22-07-18 14:59 1.607 README.md
24-03-18 20:32 26 robots.txt
14-08-18 09:20 <DIR> src
04-08-18 11:04 <DIR> test
14-08-18 09:11 48 VERSION.cache
and go\bin:
Directory of C:\Users\{}\Documents\Google\golang\go\bin
14-08-18 09:10 <DIR> .
14-08-18 09:10 <DIR> ..
14-08-18 09:13 12.742.656 go.exe
14-08-18 09:13 3.483.648 gofmt.exe
And from inside go\bin, everything occurs as expected:
C:\Users\Costa\Documents\Google\golang\go\bin>go version
go version devel +4fc7b93ad7 Mon Aug 13 19:04:16 2018 +0000 windows/amd64
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
A couple of details to confirm that the build works as go tool dist test -h and go tool dist -list both work as expected.
The last message confirms that there are no environment variables set which have a name starting with GO and I did the same for CGO. I add go env to confirm that values after failure. Thanks for keeping the issue open.
|
I’m going to butt out now, my input Inst useful as I can’t debug this without access to a windows machine.
… On 14 Aug 2018, at 20:49, Constantin Konstantinidis ***@***.***> wrote:
A couple of details to confirm that the build works as go tool dist test -h and go tool dist -list both work as expected.
Here is the outcome of your suggestion:
C:\Users\Costa\Documents\Google\golang\go\src>set GOPATH=
C:\Users\Costa\Documents\Google\golang\go\src>set GOROOT=
C:\Users\Costa\Documents\Google\golang\go\src>
C:\Users\Costa\Documents\Google\golang\go\src>
C:\Users\Costa\Documents\Google\golang\go\src>go tool dist test
go tool dist: FAILED: go install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: exec: "C:\\Users\\Costa\\Documents\\Google\\golang\\go\\go.exe": file does not exist
C:\Users\Costa\Documents\Google\golang\go\src>set GO
Environment variable GO not defined
The last message confirms that there are no environment variables set which have a name starting with GO and I did the same for CGO. I add go env to confirm that values after failure. Thanks for keeping the issue open.
C:\Users\Costa\Documents\Google\golang\go\src>go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Costa\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Costa\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Users\Costa\Documents\Google\golang\go
set GOTMPDIR=
set GOTOOLDIR=C:\Users\Costa\Documents\Google\golang\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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\Costa\AppData\Local\Temp\go-build408101810=/tmp/go-build -gno-record-gcc-switches
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'll keep searching anyway. Thanks for your replies. If anybody can point me to the relevant part of the code, it would be helpful as I already searched cmd/go in and out. |
Here is a working solution. I post a complete explanation to detail the options. A key contradiction is that all.ba* (bash/bat) checks for the presence of make.bat. The understanding is that it must run from inside the repo used for build. After build using make.bat , the build is usable from outside the repo which sits under the original GOPATH as documentation requires.
To illustrate the issue, here is what happen in various cases including what works. %USERPROFILE% is used everywhere and has been replaced manually:
The version displayed in the GOROOT version. Result here is as expected:
Here, you can run go build:
It is feasible to fix the build, all.bat, run.bat or the documentation but I'm not certain on how it is supposed to work now or in the near future. |
Working on tip, issue is solved. Verbose flag must still be passed through GOFLAGS. Issue can be closed.
|
When building Go, the run.bat part cannot be run correctly. It seems related to GOTOOLDIR which is incorrectly read or updated. On GOPATH, no issue occurs. Inside the repo, problems occur.
run.ba* checks that it is inside the repo (go\src).
After investigating, I suppose that this is why
go tool dist
cannot run inside the repo.What version of Go are you using (
go version
)?C:\Users{username is removed below}\Documents\Google>go version
go version go1.11rc1 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?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.
What did you expect to see?
What did you see instead?
If you apply the same recipe to GOTMPDIR for instance, everything occurs as expected.
make.bat succeeds and displays the installation message. all.bat fails on the run.bat part with:
Starting run.bat with and w/o rebuild fails similarly:
After failure, GOPATH is set to a directory that does not exist.
I updated the base installation using rc1. The rest is run on tip.
I gave it a try but could not locate the GOTOOLDIR environment variable handling.
The text was updated successfully, but these errors were encountered: