Skip to content

Syscall: TestScript/mod_cache_rw failed on window-amd64 #35813

Closed
@erifan

Description

@erifan

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

$ go version
go version devel +9940c77 Mon Nov 25 03:41:16 2019 +0000 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\hostname\AppData\Local\go-build
set GOENV=C:\Users\hostname\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\hostname\OneDrive - ARM\Desktop\goPath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\hostname\OneDrive - ARM\Desktop\golang
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\hostname\OneDrive - ARM\Desktop\golang\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\hostname\OneDrive - ARM\Desktop\go-test-master\src\go.mod
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 -fmessage-length=0 -fdebug-prefix-map=C:\Users\hostname\AppData\Local\Temp\go-build077161794=/tmp/go-build -gno-record-gcc-switches

What did you do?

$ cd go\src
$ ./all.bat

What did you expect to see?

All tests pass

What did you see instead?

--- FAIL: TestScript (0.00s)
--- FAIL: TestScript/mod_cache_rw (1.81s)
script_test.go:193:
# Regression test for golang.org/issue/31481. (0.000s)
# golang.org/issue/31481: an explicit flag should make directories in the module
# cache writable in order to work around the historical inability of 'rm -rf' to
# forcibly remove files in unwritable directories. (1.051s)
# After adding an extraneous file, 'go mod verify' should fail. (0.207s)
# However, files within those directories should still be read-only to avoid
# accidental mutations. (0.001s)
# If all 'go' commands ran with the flag, the system's 'rm' binary
# should be able to remove the module cache if the '-rf' flags are set. (0.115s)
> [!windows] [exec:rm] exec rm -rf $GOPATH/pkg/mod
> [!windows] [!exec:rm] go clean -modcache
> [windows] [exec:rmdir] exec rmdir /s /q $GOPATH\pkg\mod
[stderr]
rmdir: failed to remove '/s': No such file or directory
rmdir: failed to remove '/q': No such file or directory
rmdir: failed to remove '$WORK\gopath\pkg\mod': Directory not empty
[exit status 1]
FAIL: testdata\script\mod_cache_rw.txt:22: unexpected command failure

FAIL
FAIL cmd/go 299.986s

This failure has been pointed out in #35033, but the issue ticket has been closed, so I reopened this one. I don't know if I need to add some extra settings to build and test Go on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-WindowsTestingAn issue that has been verified to require only test changes, not just a test failure.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions