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

testing: TestChdir can fail on Windows when GOROOT and TMPDIR are on different drives #69159

Closed
qiulaidongfeng opened this issue Aug 30, 2024 · 4 comments
Labels
help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@qiulaidongfeng
Copy link
Member

qiulaidongfeng commented Aug 30, 2024

Go version

go version devel go1.24-9e8ea567c8 Wed Aug 28 21:03:29 2024 +0000 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=auto
set GOARCH=amd64
set GOBIN=
set GOCACHE=D:\file\go-build
set GOENV=C:\Users\26454\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\file\gofile\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\file\gofile
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=D:\file\gofile\gogit\go1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=local
set GOTOOLDIR=D:\file\gofile\gogit\go1\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.24-9e8ea567c8 Wed Aug 28 21:03:29 2024 +0000
set GODEBUG=
set GOTELEMETRY=on
set GOTELEMETRYDIR=C:\Users\26454\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v3
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\file\gofile\gogit\go1\src\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\26454\AppData\Local\Temp\go-build3099250739=/tmp/go-build -gno-record-gcc-switches

What did you do?

git clone https://github.com/golang/go.git
set GOROOT is git clone dir
cd src
all

What did you see happen?

test pass.

What did you expect to see?

--- FAIL: TestChdir (0.00s)
testing_test.go:303: Rel: can't make C:\Users\26454\AppData\Local\Temp\TestChdir3453836523\001 relative to D:\file\gofile\gogit\go1\src\testing
FAIL
FAIL testing 7.715s
FAIL

qiulaidongfeng added a commit to qiulaidongfeng/go that referenced this issue Aug 30, 2024
Fixes golang#69159

Change-Id: I38f1135c63ef150993aee9677591ac2b16186866
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/609304 mentions this issue: testing: skip TestChdir when GOROOT is git clone dir

@seankhliao
Copy link
Member

I don't see why this relates to GOROOT?
The check is for getting a relative location of a tempdir to the current working directory. It would fail on windows if they're on different volumes (since windows doesn't have a single root).

@qiulaidongfeng
Copy link
Member Author

qiulaidongfeng commented Aug 30, 2024

cc @kolyshkin @dmitshur because they have CL submitted related to this test.

@ianlancetaylor ianlancetaylor changed the title testing: TestChdir fail when goroot is git clone dir testing: TestChdir can fail on Windows when GOROOT and TMPDIR are on different drives Aug 30, 2024
@dmitshur dmitshur added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels Sep 3, 2024
@dmitshur dmitshur added this to the Go1.24 milestone Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
6 participants