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

Github Actions lint failures on 1.53.0 #761

Closed
4 tasks done
SebastienMelki opened this issue Jun 2, 2023 · 5 comments
Closed
4 tasks done

Github Actions lint failures on 1.53.0 #761

SebastienMelki opened this issue Jun 2, 2023 · 5 comments
Labels
duplicate This issue or pull request already exists upstream related the golangci-lint but not to the action

Comments

@SebastienMelki
Copy link

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 (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)

Description of the problem

Hello,
I noticed our github actions failing this morning even though we didn't change anything related to golangci-lint config.
I noticed that today it was pulling version 1.53.0 (because we configured it to get latest). Everything worked fine on 1.52.2 last night. But today it fails on 1.53.0 with this error. I forced the version to 1.52.2 to unblock myself now, but was wondering was the issue. Attaching two screenshots to show the difference between the run on 1.52.2 and 1.53.0

level=error msg="[linter] depguard: create analyzer: couldn't expand $gostd: could not read GOROOT directory: open src: no such file or directory\nmust have an Allow and/or Deny package list"

Error: golangci-lint exit with code 3

This works 1.52.2:

image

This doesn't work 1.53.0:

image

Version of golangci-lint

1.53.0

Configuration file

    with:
      version: 1.52.2
      args: --timeout 5m --verbose
      github-token: ${{ secrets.GIT_TOKEN  }}
      skip-pkg-cache: true
      skip-build-cache: true

Go environment

$ go version && go env
GO111MODULE=""
  GOARCH="amd64"
  GOBIN=""
  GOCACHE="/home/runner/.cache/go-build"
  GOENV="/home/runner/.config/go/env"
  GOEXE=""
  GOEXPERIMENT=""
  GOFLAGS=""
  GOHOSTARCH="amd64"
  GOHOSTOS="linux"
  GOINSECURE=""
  GOMODCACHE="/home/runner/go/pkg/mod"
  GONOPROXY=""
  GONOSUMDB=""
  GOOS="linux"
  GOPATH="/home/runner/go"
  GOPRIVATE=""
  GOPROXY="https://proxy.golang.org,direct"
  GOROOT="/opt/hostedtoolcache/go/1.20.4/x64"
  GOSUMDB="sum.golang.org"
  GOTMPDIR=""
  GOTOOLDIR="/opt/hostedtoolcache/go/1.20.4/x64/pkg/tool/linux_amd64"
  GOVCS=""
  GOVERSION="go1.20.4"
  GCCGO="gccgo"
  GOAMD64="v1"
  AR="ar"
  CC="gcc"
  CXX="g++"
  CGO_ENABLED="1"
  GOMOD="/dev/null"
  GOWORK=""
  CGO_CFLAGS="-O2 -g"
  CGO_CPPFLAGS=""
  CGO_CXXFLAGS="-O2 -g"
  CGO_FFLAGS="-O2 -g"
  CGO_LDFLAGS="-O2 -g"
  PKG_CONFIG="pkg-config"
  GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build35

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
run golangci-lint
  Running [/home/runner/golangci-lint-1.53.0-linux-amd64/golangci-lint run --out-format=github-actions --timeout 5m --verbose] in [] ...
  level=error msg="[linter] depguard: create analyzer: couldn't expand $gostd: could not read GOROOT directory: open src: no such file or directory\nmust have an Allow and/or Deny package list"
  
  Error: golangci-lint exit with code 3
  Ran golangci-lint in 92ms

Code example or link to a public repository

` golangci:
name: lint
runs-on: self-hosted
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
- uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.GH_PAT }}

  - name: golangci-lint
    uses: golangci/golangci-lint-action@v3
    with:
      version: 1.52.2
      args: --timeout 5m --verbose
      github-token: ${{ secrets.GIT_TOKEN  }}
      skip-pkg-cache: true
      skip-build-cache: true`
@SebastienMelki SebastienMelki added the bug Something isn't working label Jun 2, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 2, 2023

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

@SebastienMelki SebastienMelki changed the title Lint failures on 1.53.0 Github Actions lint failures on 1.53.0 Jun 2, 2023
@zzjin
Copy link

zzjin commented Jun 2, 2023

Same issue here.

@hailaz
Copy link

hailaz commented Jun 2, 2023

遇到一样的问题,还以为代码出问题了,结果是lint的最新版问题。

@ldez ldez transferred this issue from golangci/golangci-lint Jun 2, 2023
@ldez
Copy link
Member

ldez commented Jun 2, 2023

Duplicate of golangci/golangci-lint#3862

Fixed by golangci/golangci-lint#3866

@SebastienMelki
Copy link
Author

Thanks @ldez ! I missed that one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists upstream related the golangci-lint but not to the action
Projects
None yet
Development

No branches or pull requests

4 participants