Skip to content

Github Actions lint failures on 1.53.0 #761

@SebastienMelki

Description

@SebastienMelki

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsupstreamrelated the golangci-lint but not to the action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions