Skip to content
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

x/exp/cmd/gorelease: output all errors for bad filenames in module #39091

Closed
myitcv opened this issue May 15, 2020 · 3 comments
Closed

x/exp/cmd/gorelease: output all errors for bad filenames in module #39091

myitcv opened this issue May 15, 2020 · 3 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@myitcv
Copy link
Member

myitcv commented May 15, 2020

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

$ go version
go version devel +881d540540 Thu May 14 21:41:46 2020 +0000 linux/amd64
$ git rev-parse HEAD
00229845015e38294862ecd9909318241789d41c

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/myitcv/gostuff/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
GOAMD64="alignedjumps"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/gostuff/src/golang.org/x/exp/go.mod"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build883487326=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Ran the following test:

mod=example.com/patherrors
dir=x
base=none
success=false
-- want --
-- .mod --
module example.com/patherrors
-- .git/HEAD --
-- x/go.mod --
module example.com/x

go 1.12
-- x/testdata/don't_call_file_this_1.txt --
-- x/testdata/don't_call_file_this_2.txt --

What did you expect to see?

Two errors relating to bad file names.

What did you see instead?

One error:

$ go test ./...
--- FAIL: TestRelease (0.00s)
    --- FAIL: TestRelease/patherrors/bad_filenames (0.00s)
        gorelease_test.go:292: unexpected error: create zip /tmp/673926975/x: malformed file path "testdata/don't_call_file_this_1.txt": invalid char '\''
FAIL
FAIL    golang.org/x/exp/cmd/gorelease  1.709s
FAIL

cc @jayconrod

@myitcv myitcv added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels May 15, 2020
@gopherbot gopherbot added this to the Unreleased milestone May 15, 2020
@jayconrod jayconrod added the Tools This label describes issues relating to any tools in the x/tools repository. label May 18, 2020
@jayconrod
Copy link
Contributor

Blocked by #36058

@gopherbot
Copy link

Change https://golang.org/cl/235597 mentions this issue: zip: add CheckFiles, CheckDir, and CheckZip

gopherbot pushed a commit to golang/mod that referenced this issue Aug 26, 2020
These functions may be used to check whether the files in an abstract
list, a directory, or a module zip file satisfy the module name and
size constraints listed in the package documentation. Each function
returns a CheckedFiles record that lists valid, omitted, and invalid
files, as well as any size-related error for the whole set of
files. The omitted and invalid lists have an error for each file,
saying why it was omitted or invalid.

Create, CreateFromDir, and Unzip are now implemented using these
functions (or common code). They now return errors based on
CheckedFiles errors. Most error messages won't change, but if multiple
files are invalid, they will be all be listed instead of just the
first one.

Fixes golang/go#36058
Updates golang/go#39091

Change-Id: I9d4d508288bbd821f93423e712232d8a68356529
Reviewed-on: https://go-review.googlesource.com/c/mod/+/235597
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/252878 mentions this issue: x/exp/cmd/gorelease: report all go.mod zip errors

@golang golang locked and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants