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: TestExecutableGOROOT fails on windows #20336

Closed
alexbrainman opened this issue May 12, 2017 · 2 comments
Closed

cmd/go: TestExecutableGOROOT fails on windows #20336

alexbrainman opened this issue May 12, 2017 · 2 comments
Milestone

Comments

@alexbrainman
Copy link
Member

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

go version devel +482da518037 Fri May 12 01:10:11 2017 +0000 windows/amd64

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

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\brainman\go
set GORACE=
set GOROOT=c:\go
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -fmessage-length=0
set CXX=g++
set CGO_ENABLED=0
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

What did you do?

c:\>set GOROOT=c:\go

c:\>set GOROOT_BOOTSTRAP=c:\go1.4

c:\>set CGO_ENABLED=0

c:\>set PATH=%PATH%;%GOROOT%\bin

c:\>cd %GOROOT%\src

c:\go\src>make
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using c:\go1.4.
...
...
...
---
Installed Go for windows/amd64 in c:\go
Installed commands in c:\go\bin

c:\go\src>go test -v -run=TestExecutableGOROOT cmd/go

What did you expect to see?

I expect test to PASS.

What did you see instead?

=== RUN   TestExecutableGOROOT
--- FAIL: TestExecutableGOROOT (0.20s)
        go_test.go:3986: C:\Users\brainman\AppData\Local\Temp\1\gotest650109735\newgoroot\bin\go.exe env GOROOT = "c:\\go", want "C:\\go"
FAIL
exit status 1
FAIL    cmd/go  5.226s

I suspect this fails because my GOROOT drive letter is small ("c"), but the test expect it to be big ("C"). I think we should adjust the test to allow for either.

Alex

@ianlancetaylor
Copy link
Contributor

As far as I can see, the "c:\go" is coming from GetModuleFileNameW, and the "C:\go" is coming from set GOROOT=%CD% in src/make.bat.

@gopherbot
Copy link

CL https://golang.org/cl/43390 mentions this issue.

@golang golang locked and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants