Skip to content

DOS shell can't handle deep directory structures with go test #6300

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

Closed
gopherbot opened this issue Sep 1, 2013 · 4 comments
Closed

DOS shell can't handle deep directory structures with go test #6300

gopherbot opened this issue Sep 1, 2013 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by dean.w.schulze:

1.  Create a package and a test for the package in a deep directory structure (for me
this happens with 127 character path)
2.  Run "go test" in that directory from the DOS prompt

What is the expected output?
Success or failure from the go test

What do you see instead?
An error from DOS indicating that the temporary directory structure is too deep.

Which compiler are you using (5g, 6g, 8g, gccgo)?


Which operating system are you using?
Windows 7 Pro 64-bit

Which version are you using?  (run 'go version')
go version go1.1.2 windows/amd64

Please provide any additional information below.

Here is my command line and the output:

c:\dean\courses\algorithms-stanford\design.and.analysis.of.algorithms.1\programm
ing-questions\common\code\golang\src\algoutils>go test
# _/c_/dean/courses/algorithms-stanford/design.and.analysis.of.algorithms.1/prog
ramming-questions/common/code/golang/src/algoutils
mkdir C:\Users\dean\AppData\Local\Temp\go-build651070751\_\c_\dean\courses\algor
ithms-stanford\design.and.analysis.of.algorithms.1\programming-questions\common\
code\golang\src\algoutils\_test\_\c_\dean\courses\algorithms-stanford\design.and
.analysis.of.algorithms.1: The filename or extension is too long.


The Windows API has a problem with path names longer than 255 characters, unless the
path starts with "\\?\"

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
@robpike
Copy link
Contributor

robpike commented Sep 1, 2013

Comment 1:

Status changed to Duplicate.

Merged into issue #3358.

@alexbrainman
Copy link
Member

Comment 2:

https://golang.org/issue/5027 would be an easier fix for this issue.
Or set GOPATH.
Alex

@gopherbot
Copy link
Contributor Author

Comment 3 by dean.w.schulze:

Thanks for pointing this out, Alex.
I forgot to mention that this happens when GOPATH is not set and go test is using the
working directory.  (The part about using the working directory isn't in the docs or
help for go test and someone on go-nuts told me to try it.)
Should go test even be using the working directory?  I didn't know anything in the go
tool chain used the working directory.  Does the go tool chain normally include the
working directory or is this a one-off?

@alexbrainman
Copy link
Member

Comment 4:

go command will always try current directory if you don't provide import path. Most of
the time that current directory will be located under %GOPATH%. If it is not, "go build"
and "go test" commands will still work. I am not sure how "official" these facilities
are, but we use them in a go build script
(https://code.google.com/p/go/source/browse/src/run.bat#66 and others).
Alex

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants