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

Cannot install golangci-lint because of revive v1.1.3 dependency GOSUM DB error #2575

Closed
4 tasks done
jasdel opened this issue Feb 15, 2022 · 4 comments · Fixed by #2576
Closed
4 tasks done

Cannot install golangci-lint because of revive v1.1.3 dependency GOSUM DB error #2575

jasdel opened this issue Feb 15, 2022 · 4 comments · Fixed by #2576
Assignees
Labels
bug Something isn't working

Comments

@jasdel
Copy link

jasdel commented Feb 15, 2022

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

Looks like the github.com/mgechev/revive dependency rewrote some of their history, and republished release v1.1.3 causing and error trying to install golangci-lint.

verifying github.com/mgechev/revive@v1.1.3/go.mod: checksum mismatch
        downloaded: h1:ZZq2bmyssGh8MSPz3VVziqRNIMYTJXzP8MUKG90vZ9A=
        go.sum:     h1:jMzDa13teAuv/KLeqgJw79NDe+1IT0ZO3Mht0vN1Yls=

The issue was reported to them as mgechev/revive#634

Version of golangci-lint

Release v1.44.0

Unable to run go install command because revive dependency gosum DB issue.

Configuration file

n/a

Go environment

$ go version && go env
go version go1.17.6 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jasdel/Library/Caches/go-build"
GOENV="/Users/jasdel/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jasdel/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jasdel/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7f/ynvg_sjn7dqc9dxz23x5c8pr0000gs/T/go-build2097961417=/tmp/go-build -gno-record-gcc-switches -fno-common"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
N/A cannot install

Code example or link to a public repository

n/a
@jasdel jasdel added the bug Something isn't working label Feb 15, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 15, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@jasdel
Copy link
Author

jasdel commented Feb 15, 2022

Attempting to use GOSUMDB=off will bypass the history rewrite, but get a compile bug when doing so,

GOSUMDB=off go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
...
# github.com/golangci/golangci-lint/pkg/golinters
../../../go/pkg/mod/github.com/golangci/golangci-lint@v1.44.0/pkg/golinters/revive.go:68:22: not enough arguments in call to "github.com/mgechev/revive/lint".New
        have (func(string) ([]byte, error))
        want ("github.com/mgechev/revive/lint".ReadFile, int)

Changing the revive dependency to be the Git commit hash of the "old" v1.1.3 I'm able to build golangci-lint after removing the v1.1.3 entries from go.mod and go.sum

go get -d github.com/mgechev/revive@8aab7c6

@ldez ldez self-assigned this Feb 15, 2022
@ldez
Copy link
Member

ldez commented Feb 15, 2022

Hello,

they created a new version to fix the problem mgechev/revive#634 (comment)

@zhixinwen
Copy link

Can you cut a new release with this fix? I think go get still have the error by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants