-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: modfetch.Unzip checks that all filenames are acceptable, causing problems for test fixture directories #26672
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
You should be able to put a |
I got the same problem in my case: go: extracting github.com/antlr/antlr4 v0.0.0-20180728001836-7d0787e29ca8
-> unzip go/src/mod/cache/download/github.com/antlr/antlr4/@v/v0.0.0-20180728001836-7d0787e29ca8.zip: malformed file path "runtime/Cpp/demo/Windows/antlr4-cpp-demo/antlr4-cpp-demo-vs2015.vcxproj..filters": double dot I think to should be acceptable the normal cases that like the double dot. |
A decent compromise would be for such packages to create their fixtures when the tests are run, if they don't already exist, rather than checking them into source control. The same already applies for fixtures with unusual mode bits, since ZIP archives don't necessarily preserve them. |
Thank you all. It turns out that @bcmills suggestion works wonderfully. I have created a PR to doublestar (bmatcuk/doublestar#16) and am closing this issue. Thank you all. |
Please note that creating mod files in those repos would be slow and painful process to follow for consumers as some packages might be not under active development. |
Workaround was suggested here: golang/go#26672
Adds go.mod files to the mock subdirs to avoid golang/go#26672
…mod case insensitive issues See golang/go#26672 (comment)
Move test_tree into test_files dir and create a module for it: See golang/go#26672 (comment)
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11beta2 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dgodd/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dgodd/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/golang1.11beta2"
GOTMPDIR=""
GOTOOLDIR="/usr/local/golang1.11beta2/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/53/t04mmfdn0qq68l978jgz64cc0000gn/T/go-build523317176=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
If you import a module which includes files which don't pass
module.CheckFilePath
then you can't use that module. A good example of this is https://github.com/bmatcuk/doublestar. Doublestar has a test directory with several very strangely named files to make sure that it works on such directories. However, that means I can not use go modules to import doublestarWhat did you expect to see?
I expect to be able to import doublestar. I'm not entirely sure what should change. Possibly modules should be able to specify files/directories which will not be imported. If such a system existed then doublestar could state that the
test
directory should not be extracted bymodfetch.Unzip
, this seems to me to be good since as a user of the module I don't need it anyway.I should mention that
go get github.com/bmatcuk/doublestar
does work.What did you see instead?
The text was updated successfully, but these errors were encountered: