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/relative failed due to symlink GOROOT path #72864

Open
linsite opened this issue Mar 14, 2025 · 3 comments
Open

testing: TestChdir/relative failed due to symlink GOROOT path #72864

linsite opened this issue Mar 14, 2025 · 3 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@linsite
Copy link
Contributor

linsite commented Mar 14, 2025

Go version

go version devel go1.25-b143c98169 Wed Mar 12 18:18:03 2025 -0700 linux/arm64

Output of go env in your module/workspace:

shell
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/ulin/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/ulin/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build448681645=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/ulin/gosrc/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/ulin/gosrc'
GOPRIVATE=''
GOPROXY='https://goproxy.cn'
GOROOT='/home/ulin/g/golang'
GOSUMDB='off'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/ulin/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/ulin/g/golang/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='devel go1.25-b143c98169 Wed Mar 12 18:18:03 2025 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'


more:

go repository absolute path is: /mnt/data/lean/g/golang, there is a symlink for /mnt/data/lean/g under /home/ulin/ which is /home/ulin/g

What did you do?

  1. cd /home/ulin/g/golang && bash build.bash
  2. invoke go tool dist test -v testing

What did you see happen?

$ go tool dist test -v testing
                                                                                                                                                                                            ##### Test execution environment.
# GOARCH: arm64
# CPU:
# GOOS: linux
# OS Version: Linux 5.8.18v1 #6 SMP PREEMPT Mon Dec 2 23:42:15 CST 2024 aarch64
                                                                                                                                                                                            ##### Testing packages.
# go tool dist test -run=^testing$
--- FAIL: TestChdir (0.00s)
    --- FAIL: TestChdir/relative (0.00s)
        testing.go:1361: chdir ../../../../../../tmp/TestChdir2779019320/001: no such file or directory
FAIL
FAIL    testing 1.035s
FAIL
# go tool dist test -run=^testing$
go tool dist: Failed: exit status 1

What did you expect to see?

should pass

more:
go test testing -run TestChdir failed, too.

$ go test testing -run TestChdir
--- FAIL: TestChdir (0.00s)
    --- FAIL: TestChdir/relative (0.00s)
        testing.go:1361: chdir ../../../../../../tmp/TestChdir667226533/001: no such file or directory
FAIL
FAIL    testing 0.012s
FAIL
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Mar 14, 2025
@linsite
Copy link
Contributor Author

linsite commented Mar 14, 2025

only if cd to ${GOROOT}/src, the test can pass, otherwize it will fail.

@dr2chase
Copy link
Contributor

@neild @adonovan

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants