-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 since update to v1.43.0 (load embedded ruleguard rules: rules/rules.go:13: can't load fmt) #2374
Panic since update to v1.43.0 (load embedded ruleguard rules: rules/rules.go:13: can't load fmt) #2374
Comments
TL;DR
I decided to compare the output of $ diff /tmp/idea.env /tmp/zsh.env
1,2c1,2
< GO111MODULE=""
< GOARCH="amd64"
---
> GO111MODULE="on"
> GOARCH="arm64"
9c9
< GOHOSTARCH="amd64"
---
> GOHOSTARCH="arm64"
22c22
< GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
---
> GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
24c24
< GOVERSION="go1.17.2"
---
> GOVERSION="go1.17.1"
37c37
< GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6t/v80c8sfs5zqf38b2yhzq592h0000gn/T/go-build2865944367=/tmp/go-build -gno-record-gcc-switches -fno-common"
\ No newline at end of file
---
> GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6t/v80c8sfs5zqf38b2yhzq592h0000gn/T/go-build3978166248=/tmp/go-build -gno-record-gcc-switches -fno-common" Two questions:
I didn't remember installing multiple versions of Go. This IDEA project was new & he picked up the environment automatically. And it was:
That's where the dog is buried.
Solution:
@ldez, FYI |
This comment has been minimized.
This comment has been minimized.
go1.18beta1 is currently not supported by golangci-lint. I flag this as off-topic for now. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The comments marked as "off topic" resolved my issue for me when I encountered this. My build environment was updated to 1.18 automatically, so this upgrade broke golangci-lint for me. Thus, I had to build from source in order to resolve the issue. |
@willbeason please keep in mind that this new release is an unknown ground for most of us. So let's try to be patient. This is a big release for Go. |
This is an attempt to fix (make lint), which complains: > pkg/tlsclientconfig/tlsclientconfig_test.go:37:20: SA1019: tlsc.RootCAs.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck) > for _, s := range tlsc.RootCAs.Subjects() { > ^ > pkg/tlsclientconfig/tlsclientconfig_test.go:43:20: SA1019: systemCertPool.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck) > for _, s := range systemCertPool.Subjects() { > ^ > pkg/tlsclientconfig/tlsclientconfig_test.go:53:20: SA1019: tlsc.RootCAs.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck) > for _, s := range tlsc.RootCAs.Subjects() { ... but the same staticcheck linter, for some reason, does NOT complain about these deprecated fields; the correct //lint:ignore comments are ineffective and actually cause extra warnings. So, silence all of staticcheck via //nolint , hopefully temporarily. (Also, note that golangci-lint itself, with this update, crashes with golangci/golangci-lint#2374 ; a local rebuild does not crash, but still fails per the above.) Signed-off-by: Miloslav Trmač <[email protected]>
I'm not sure how to update x/tool because our project has a lot of packages which have multiple transitive dependencies on old x/tools Here the debug output:
|
Installing Binary
Install from source
|
If you are using go1.18, please follow the issue #2649 |
fixes golangci/golangci-lint#2374 on my machine
can you try to set explicitly the GOROOT? |
you can test it with this docker file first# golangci-lint does not work with latest version
FROM golang:latest
# use a match version
# FROM golang:1.18.3
ARG GO_LINT_ADDRESS=https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-linux-amd64.tar.gz
ARG LINT_TAR_NAME=golangci-lint-1.46.2-linux-amd64
RUN apt update && \
wget -c ${GO_LINT_ADDRESS} -O ${LINT_TAR_NAME}.tar.gz && \
tar xzf ${LINT_TAR_NAME}.tar.gz --strip-components=1 -C /usr/bin/ ${LINT_TAR_NAME}/golangci-lint && \
chmod +x /usr/bin/golangci-lint
# install golangci-ci by go did not work
# it runs but on runtime throws errors
# go install github.com/golangci/golangci-lint/cmd/[email protected]
CMD golangci-lint seconddocker build --no-cache -t lint:v1 . third - result for me
|
can you add this (I already tried) |
closed in favor of #3107 |
Fixing error related to golangci/golangci-lint#2374
* go 1.17 has deprecated installing executables with `go get` Use go install instead Set GOFLAGS to empty string to overcome the `cannot query module due to -mod=vendor` error we get in presubmit job * Updated kustomize version to a version that support go install See kubernetes-sigs/kustomize#3618 * Install golangci-lint from source See golangci/golangci-lint#2374 * Fix lint issue See golangci/golangci-lint#2601 * Refactor - don't pass around origRes and origErr
This should resolve some of the `golangci-lint` issues that arose due to go1.19, see * golangci/golangci-lint#2374 * golangci/golangci-lint#3037
v1.44.2 contains a bug: ``` panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt ``` golangci/golangci-lint#2374
In order to workaround golangci/golangci-lint#2374
Welcome
Description of the problem
Please read
go-critic/go-critic#1157
Version of golangci-lint
Configuration file
No file.
Go environment
Verbose output of running
The text was updated successfully, but these errors were encountered: