Skip to content

cmd/go: test -coverprofile "path too long" error on Windows #60785

@chrisdutz

Description

@chrisdutz

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

$ go version

go version go1.20.5 windows/amd64

Does this issue reproduce with the latest release?

I am on the latest release

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\cdutz\AppData\Local\go-build
set GOENV=C:\Users\cdutz\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\cdutz\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\cdutz\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\cdutz.mvnGoLang\go1.20.5.windows-amd64
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\cdutz.mvnGoLang\go1.20.5.windows-amd64\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.5
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=NUL
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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\cdutz\AppData\Local\Temp\go-build1515085630=/tmp/go-build -gno-record-gcc-switches

What did you do?

We are using go in the Apache PLC4X project in the plc4go sub-project.
When running our build in our CI/CD servers, the Windows builds are failing when running the tests with coverage:

[WARNING] ---------Exec.Err--------- [WARNING] github.com/apache/plc4x/plc4go/protocols/cbus/readwrite/model: C:\Users\cdutz\.mvnGoLang\go1.20.5.windows-amd64\pkg\tool\windows_amd64\cover.exe: fork/exec C:\Users\cdutz\.mvnGoLang\go1.20.5.windows-amd64\pkg\tool\windows_amd64\cover.exe: Der Dateiname oder die Erweiterung ist zu lang.

Path length is too long (Got a German Windows)

So even when executing the command:

go test -v -coverprofile=target/coverage.out ./...

I'm getting the same error, so it's not related to the maven plugin, that we are using.
I even tried moving Go to "C:\Go" but this too didn't help.

For now we're just disabling go coverage on all windows machines, but we'd like to enable it again.

What did you expect to see?

I would expect the build to not fail on windows

What did you see instead?

[WARNING] ---------Exec.Err--------- [WARNING] github.com/apache/plc4x/plc4go/protocols/cbus/readwrite/model: C:\Users\cdutz\.mvnGoLang\go1.20.5.windows-amd64\pkg\tool\windows_amd64\cover.exe: fork/exec C:\Users\cdutz\.mvnGoLang\go1.20.5.windows-amd64\pkg\tool\windows_amd64\cover.exe: Der Dateiname oder die Erweiterung ist zu lang.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions