-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: test -coverprofile "path too long" error on Windows #60785
Comments
To add on the last section "What did you see instead":
|
So let me explain what my colleague wanted to provide you with ;-) So right now whenever Maven detects that it's running on a windows system, we now simply replace the flag: "-coverprofile=target/coverage.out" with a second "-v" (the tool doesn't like empty flags therefore we're just using a double "-v"). |
Thanks for the report, I'll take a look. |
A request: if you could please run one of the failing commands with "-x -work" flags in addition and post the output, that would be helpful for me so as to determine which path it is that is over the limit. E.g. output of
Thanks. |
Hope this helps (a bit large) |
Thanks, yes, that is helpful. It looks as though the issue is with total command line length, not with the length of any specific file being passed to the cover tool. I'll see about crafting a fix. |
I have seen something similar with other tools ... there the length of the command being executed was too long ... they resolved the issue with dynamically creating some sort of batch script, that then is simply called (Not pretty, but it worked) |
We have machinery already to handle this for the compiler and the assembler, I just need to update the cover tool to use the same facilities. Will send a CL later today. |
Oh wow ... great :-) Thank you so much :-) |
Change https://go.dev/cl/503735 mentions this issue: |
Change the cover command to accept arguments via response files, using the same mechanism employed for the compiler and the assembler. This is needed now that the cover tool accepts a list of all source files in a package, as opposed to just a single source file, and as a result can run into system-dependent command line length limits. Fixes golang#60785. Change-Id: I67dbc96ad9fc5c6f43d5c1e4e903e4b8589b154f Reviewed-on: https://go-review.googlesource.com/c/go/+/503735 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Than McIntosh <thanm@google.com>
What version of Go are you using (
go version
)?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
OutputWhat 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.
The text was updated successfully, but these errors were encountered: