You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed while looking at the CI logs of the following PR that golangci-lint run was returning with an exit code of 0, although the code doesn't compile: triggermesh/triggermesh#263
I can see the following warning in the logs:
WARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package cortex: could not load export data: no export data for "go.opentelemetry.io/contrib/exporters/metric/cortex"
The dependency that fails to build is indeed the one I expected, but the outcome and the message are surprising to me.
My reasoning is that:
If such failure occurs, it's unlikely that the code can be considered acceptable.
If I see this message in isolation from the change, I'm unlikely to be able to determine where the linter failed, and why.
Version of golangci-lint
$ golangci-lint --versiongolangci-lint has version v1.43.0 built from (unknown, mod sum: "h1:SLwZFEmDgopqZpfP495zCtV9REUf551JJlJ51Ql7NZA=") on (unknown)
$ go version && go envgo version go1.17.2 linux/amd64GO111MODULE=""GOARCH="amd64"GOBIN=""GOCACHE="/home/acotten/.cache/go-build"GOENV="/home/acotten/.config/go/env"GOEXE=""GOEXPERIMENT=""GOFLAGS=""GOHOSTARCH="amd64"GOHOSTOS="linux"GOINSECURE=""GOMODCACHE="/home/acotten/go/pkg/mod"GONOPROXY="github.com/triggermesh/*"GONOSUMDB="github.com/triggermesh/*"GOOS="linux"GOPATH="/home/acotten/go"GOPRIVATE="github.com/triggermesh/*"GOPROXY="https://proxy.golang.org,direct"GOROOT="/usr/local/go"GOSUMDB="sum.golang.org"GOTMPDIR=""GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"GOVCS=""GOVERSION="go1.17.2"GCCGO="gccgo"AR="ar"CC="gcc"CXX="g++"CGO_ENABLED="1"GOMOD="/home/acotten/go/src/github.com/triggermesh/triggermesh/go.mod"CGO_CFLAGS="-g -O2"CGO_CPPFLAGS=""CGO_CXXFLAGS="-g -O2"CGO_FFLAGS="-g -O2"CGO_LDFLAGS="-g -O2"PKG_CONFIG="pkg-config"GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2177709345=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -vINFO [config_reader] Config search paths: [./ /home/acotten/go/src/github.com/triggermesh/triggermesh /home/acotten/go/src/github.com/triggermesh /home/acotten/go/src/github.com /home/acotten/go/src /home/acotten/go /home/acotten /home /]INFO [config_reader] Used config file .golangci.yamlINFO [lintersdb] Active 12 linters: [deadcode errcheck gofmt gosimple govet ineffassign staticcheck structcheck stylecheck typecheck unused varcheck]INFO [loader] Go packages loading at mode 575 (deps|exports_file|compiled_files|files|imports|name|types_sizes) took 2.9607695sINFO [runner/filename_unadjuster] Pre-built 0 adjustments in 94.7101msINFO [linters context/goanalysis] analyzers took 9m18.8387247s with top 10 stages: buildir: 6m32.1698428s, nilness: 48.5924902s, typedness: 6.8536132s, inspect: 4.6726596s, fact_deprecated: 4.2246186s, gofmt: 3.88425s, fact_purity: 3.8326054s, ctrlflow: 3.3801925s, printf: 3.1457179s, unused: 2.4407979sWARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package cortex: could not load export data: no export data for "go.opentelemetry.io/contrib/exporters/metric/cortex"INFO [runner] processing took 4.9µs with stages: max_same_issues: 1.1µs, nolint: 500ns, skip_dirs: 500ns, autogenerated_exclude: 300ns, filename_unadjuster: 300ns, identifier_marker: 300ns, cgo: 300ns, max_from_linter: 200ns, exclude: 200ns, skip_files: 200ns, path_prettifier: 200ns, diff: 100ns, source_code: 100ns, path_prefixer: 100ns, uniq_by_line: 100ns, exclude-rules: 100ns, max_per_file_from_linter: 100ns, sort_results: 100ns, path_shortener: 100ns, severity-rules: 0sINFO [runner] linters took 1m9.6487956s with stages: goanalysis_metalinter: 1m9.6485264sINFO File cache stats: 0 entries of total size 0BINFO Memory: 524 samples, avg is 2190.5MB, max is 2950.1MBINFO Execution took 1m12.7177277s
WARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package cortex: could not load export data: no export data for "go.opentelemetry.io/contrib/exporters/metric/cortex"
buildir is one of the passes of the staticcheck linters (staticcheck, stylecheck, gosimple, unused)
The typecheck/compile step seems to be skipped in this case, for now, I don't know why but I will try to investigate.
Welcome
Description of the problem
I noticed while looking at the CI logs of the following PR that
golangci-lint run
was returning with an exit code of0
, although the code doesn't compile: triggermesh/triggermesh#263I can see the following warning in the logs:
The dependency that fails to build is indeed the one I expected, but the outcome and the message are surprising to me.
My reasoning is that:
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
See aforementioned PR.
The error is in this specific package:
https://github.com/triggermesh/triggermesh/tree/dependabot/go_modules/go.opentelemetry.io/otel/sdk/metric-0.25.0/pkg/targets/adapter/opentelemetrytarget
The text was updated successfully, but these errors were encountered: