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

Panic after upgrade golangci-lint to v1.43.0 #1157

Closed
Antonboom opened this issue Nov 10, 2021 · 15 comments
Closed

Panic after upgrade golangci-lint to v1.43.0 #1157

Antonboom opened this issue Nov 10, 2021 · 15 comments

Comments

@Antonboom
Copy link

Antonboom commented Nov 10, 2021

Hello!

panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt

goroutine 1 [running]:
github.com/go-critic/go-critic/checkers.init.9()
        github.com/go-critic/go-critic@v0.6.1/checkers/checkers.go:58 +0x4b4

For any golangci-lint command :(

I can't provide source code, but can provide information about env:

$ uname -a
Darwin MacBook-Pro.local 20.6.0
Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021;
root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64

$ golangci-lint --version
golangci-lint has version 1.43.0 built from 861262b on 2021-11-02T20:54:42Z

$ go version
go1.17.1 darwin/arm64
go env
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN="/Users/anthony/golang_workspace/bin"
GOCACHE="/Users/anthony/Library/Caches/go-build"
GOENV="/Users/anthony/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/anthony/golang_workspace/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/anthony/golang_workspace"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.1"
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 arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6t/v80c8sfs5zqf38b2yhzq592h0000gn/T/go-build838314483=/tmp/go-build -gno-record-gcc-switches -fno-common
@Antonboom
Copy link
Author

#1126

@Antonboom
Copy link
Author

gocritic version prints nothing :(

gocritic check ./... runs without errors ;(

@cristaloleg
Copy link
Member

Hi, sorry for a late response, can you share go env output? There might be a problem with GOROOT but would like to check first :) thanks.

@Antonboom
Copy link
Author

Antonboom commented Nov 10, 2021

@cristaloleg, please, look at the first message, go env at the bottom.

@Antonboom
Copy link
Author

Oh...

It was really about the env and arch. I have written in more detail in the related issue.
Thanks!

@pierrre
Copy link
Contributor

pierrre commented Dec 15, 2021

I've got exactly the same error message after upgrading to Go 1.18beta1.
See golangci/golangci-lint#2414
It was fine with Go 1.17.5

@butuzov
Copy link

butuzov commented Dec 20, 2021

Can this be platform specific error (build tags maybe)? no issues on mac, but can't compile on github action runner (ubuntu-latest).

@atc0005
Copy link

atc0005 commented Dec 21, 2021

@butuzov

FWIW, this is how I reproduced the issue using the upstream Go 1.18beta1 image using the latest Docker version on Ubuntu 18.04 (amd64):

golangci/golangci-lint#2374 (comment)

@quasilyte
Copy link
Member

I'll try to reproduce it.

@quasilyte
Copy link
Member

golangci/golangci-lint#2374 (comment)

I may need some help since this issue can only be reproduced in some specific scenarios.

@juan-carvajal
Copy link

Hello!

panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt

goroutine 1 [running]:
github.com/go-critic/go-critic/checkers.init.9()
        github.com/go-critic/go-critic@v0.6.1/checkers/checkers.go:58 +0x4b4

For any golangci-lint command :(

I can't provide source code, but can provide information about env:

$ uname -a
Darwin MacBook-Pro.local 20.6.0
Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021;
root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64

$ golangci-lint --version
golangci-lint has version 1.43.0 built from 861262b on 2021-11-02T20:54:42Z

$ go version
go1.17.1 darwin/arm64

go env

This seems to be specific to that exact go version. I am running the cli on a docker container with that exact go version and I am getting the exact same error. Downgrading to 1.42.1 did the trick but I admit is not the optimal solution.

@quasilyte
Copy link
Member

Could you try with newer golangci-lint release?

@gliptak
Copy link

gliptak commented Aug 3, 2022

@cristaloleg
Copy link
Member

Afaik it was fixed long time ago. Is this still an issue?

@cristaloleg
Copy link
Member

I think it's safe to close now. Ping me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants