-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/vet, cmd/go: vet crashes for long paths in Windows, affecting go test #46299
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
Comments
cc @alexbrainman @rasky @zx2c4 @mattn @gopherbot add OS-Windows |
I'm unable to reproduce the issue. @ajgajg1134 which version of Windows are you using? Some Windows versions have a MAX_PATH limit of 260 (see https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation). Which filesystem are you using? e.g. FAT32 has a 255 character limit. |
@egonelbre if you are checking on current tip, you might be affected by https://go-review.googlesource.com/c/go/+/291291 Alex |
@alexbrainman I was using Go |
I'm on Windows 10 Home, Version 10.0.19042 Build 19042. As for the path length limit, couldn't the tools work around that if they provided a To help with reproduction of this issue I created a test repository where I can consistently force failure by running One interesting bit here that might help is the it seems this issue is confined to |
From runErr := b.run(a, p.Dir, p.ImportPath, env, cfg.BuildToolexec, tool, vetFlags, a.Objdir+"vet.cfg") I wonder if |
Update: I've managed to make a repo that can consistently fail(for real this time): https://github.com/ajgajg1134/test-golang-fail2 Using the vendor folder makes it possible / much more likely that a user will hit this path length limit. |
CC @matloob, @timothy-king via owners. Also CC @bufflig. |
If vet calls A fix for that and a related bug is described in #36375 (comment) It's a simple fix. I don't know why it hasn't been tried. |
My current examination of the issue suggests that would fix the issue:
I am testing this hypothesis now. However, |
What stdlib call is |
It looks to me that it is ultimately passed to |
is this still an issue? |
Is this still an issue? |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, confirmed with go1.16.4 as well.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Have a test file with a long path import something with a very long path.
For example: Have a file at:
C:\Users\Andrew\go\src\somegitplace.test\mycompany-org\manufacturing-software\availability\material-location-availability-listener
and in that file import something like:
somegitplace.test/mycompany-org/manufacturing-software/availability/material-location-availability-service/domain/types/endoflifestatus
Run
go test ./...
What did you expect to see?
Tests passing (or failing)
What did you see instead?
"C:\Users\Andrew\go\go1.16.4\pkg\tool\windows_amd64\vet.exe: fork/exec C:\Users\Andrew\go\go1.16.4\pkg\tool\windows_amd64\vet.exe: The directory name is invalid."
The text was updated successfully, but these errors were encountered: