golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
15.44k stars 1.38k forks source link

Can't run linter goanalysis_metalinter: buildir: failed to load package gl #5037

Closed bon-ami closed 5 days ago

bon-ami commented 5 days ago

Welcome

Description of the problem

can't run it after download. error detail could not load export data: no export data for \"github.com/go-gl/gl/v2.1/gl\""

Version of golangci-lint

```console $ golangci-lint --version golangci-lint has version v1.61.0 built with go1.23.0 from (unknown, modified: ?, mod sum: "h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=") on (unknown) ```

Configuration

default config. no details

```console # paste configuration file or CLI flags here ```

Go environment

```console $ go version && go env go version go1.23.0 windows/amd64 set GO111MODULE= set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\...\AppData\Local\go-build set GOENV=C:\Users\...\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=D:\360\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=D:\360\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=D:\apps\go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLCHAIN=auto set GOTOOLDIR=D:\apps\go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.23.0 set GODEBUG= set GOTELEMETRY=local set GOTELEMETRYDIR=C:\Users\...\AppData\Roaming\go\telemetry set GCCGO=gccgo set GOAMD64=v1 set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=0 set GOMOD=D:\ezcomm\go.mod set GOWORK= set CGO_CFLAGS=-O2 -g set CGO_CPPFLAGS= set CGO_CXXFLAGS=-O2 -g set CGO_FFLAGS=-O2 -g set CGO_LDFLAGS=-O2 -g set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\...\AppData\Local\Temp\go-build916600433=/tmp/go-build -gno-record-gcc-switches ```

Verbose output of running

```console $ golangci-lint cache clean $ golangci-lint run -v level=info msg="golangci-lint has version v1.61.0 built with go1.23.0 from (unknown, modified: ?, mod sum: \"h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=\") on (unknown)" level=info msg="[config_reader] Config search paths: [./ D:\\ezcomm D:\\ C:\\Users\\..." level=info msg="[lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused]" level=info msg="[loader] Go packages loading at mode 575 (deps|imports|name|types_sizes|compiled_files|files|exports_file) took 11.8241126s" level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 705.2373ms" level=info msg="Memory: 510 samples, avg is 430.4MB, max is 1087.9MB" level=info msg="Execution took 1m0.0034741s" level=info msg="[linters_context/goanalysis] analyzers took 3m20.6073238s with top 10 stages: buildir: 1m20.2023761s, typedness: 16.910296s, fact_purity: 16.8097877s, nilness: 16.4457244s, SA5012: 16.0238825s, ctrlflow: 15.6822154s, fact_deprecated: 15.542341s, printf: 14.6697524s, inspect: 5.915794s, tokenfileanalyzer: 1.3930743s" level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package gl: could not load export data: no export data for \"github.com/go-gl/gl/v2.1/gl\"" level=info msg="[runner] processing took 993.4µs with stages: path_shortener: 993.4µs, max_from_linter: 0s, nolint: 0s, path_prefixer: 0s, sort_results: 0s, severity-rules: 0s, path_prettifier: 0s, identifier_marker: 0s, exclude: 0s, fixer: 0s, diff: 0s, skip_files: 0s, invalid_issue: 0s, exclude-rules: 0s, cgo: 0s, skip_dirs: 0s, max_per_file_from_linter: 0s, max_same_issues: 0s, filename_unadjuster: 0s, autogenerated_exclude: 0s, uniq_by_line: 0s, source_code: 0s" level=info msg="[runner] linters took 49.5719064s with stages: goanalysis_metalinter: 49.5649036s" level=error msg="Running error: can't run linter goanalysis_metalinter\nbuildir: failed to load package gl: could not load export data: no export data for \"github.com/go-gl/gl/v2.1/gl\"" level=error msg="Timeout exceeded: try increasing it by passing --timeout option" ```

A minimal reproducible example or link to a public repository

I don't think it's related to my code. no details

```go // add your code here ```

Validation

Supporter

boring-cyborg[bot] commented 5 days ago

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

ldez commented 5 days ago

Hello,

It's related to your project: you should run go mod tidy before running golangci-lint.

As you are trying to use github.com/go-gl/gl/v2.1/gl you should follow the requirements of this library:

https://github.com/go-gl/gl?tab=readme-ov-file#gl--

Requirements:

  • A cgo compiler (typically GCC).
  • On Ubuntu/Debian-based systems, the libgl1-mesa-dev package.

And remember that to use CGO you should set CGO_ENABLED to 1.