Uploaded image for project: 'MicroShift'
  1. MicroShift
  2. USHIFT-2211

Golangci-lint version bump

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 3
    • None
    • None
    • uShift Sprint 248
    • None
    • None
    • None

      Description of problem:

      Latest rebase main branch rebase is experiencing failures during the verify job because it is using a version of golangci-lint built from go v1.20 to lint go 1.21 code.  The result is a panic and the failure of the CI job.
      
      Bumping golangci-lint to a version built with go 1.21 fixes the issue in local testing with the CI build container image.
      
      Version-Release number of selected component (if applicable):
      golangci-lint 1.52.1
      go 1.21

      How reproducible:

      100% on lastest `main` branch

      Actual results:

      [root@747caa99c35f microshift]# make verify-golangci
      ./scripts/fetch_tools.sh golangci-lint && \
      ./_output/bin/golangci-lint run --verbose --timeout 20m0s
      INFO [config_reader] Config search paths: [./ /go/src/github.com/openshift/microshift /go/src/github.com/openshift /go/src/github.com /go/src /go / /root]
      INFO [config_reader] Used config file .golangci.yaml
      INFO [lintersdb] Active 35 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck decorder errcheck exhaustive exportloopref gocheckcompilerdirectives goconst gosec gosimple govet importas ineffassign ireturn loggercheck misspell nestif nilerr nilnil nosprintfhostport prealloc predeclared reassign staticcheck typecheck unconvert unparam unused usestdlibvars wastedassign whitespace]
      INFO [loader] Go packages loading at mode 575 (exports_file|files|types_sizes|compiled_files|imports|name|deps) took 2m12.582710061s
      INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 6.588743ms
      INFO [linters_context] importas settings found, but no aliases listed. List aliases under alias: key.
      panic: 660358735: duplicate method SeccompProfilegoroutine 26691 [running]:
      go/types.computeInterfaceTypeSet(0x0, 0xc000000006?, 0xc0625b4910)
              go/types/typeset.go:323 +0xb65
      go/types.(*Interface).typeSet(...)
              go/types/interface.go:29
      go/types.(*Interface).Complete(...)
              go/types/interface.go:143
      golang.org/x/tools/internal/gcimporter.readUnifiedPackage(0xc00299b380, 0x0, 0xc042c9d440, {0x1, 0x0, {0xc0018bb920, 0x54}, {0xc07c8f9a50, 0x3335a}, {0xc046e24000, ...}, ...})
              golang.org/x/tools@v0.7.0/internal/gcimporter/ureader_yes.go:122 +0x4db
      golang.org/x/tools/internal/gcimporter.UImportData(0x1356060?, 0xc058987f20?, {0xc07c87e001?, 0x30?, 0xc042c9d440?}, {0xc0018bb920, 0x54})
              golang.org/x/tools@v0.7.0/internal/gcimporter/ureader_yes.go:69 +0x10a
      golang.org/x/tools/go/gcexportdata.Read({0x1356060?, 0xc058987f20?}, 0x0?, 0xb?, {0xc0018bb920, 0x54})
              golang.org/x/tools@v0.7.0/go/gcexportdata/gcexportdata.go:140 +0x270
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).loadFromExportData(0xc0043b5da0?)
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:221 +0x331
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).loadImportedPackageWithFacts(0xc0043b5da0, 0x2)
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:272 +0x4b
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).loadWithFacts(0xc000078800?, 0x43b3b6?)
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:264 +0x137
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze(0xc0043b5da0, 0x2, 0xc00323a7e0)
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:61 +0xf4
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyzeRecursive.func1()
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:48 +0x1a8
      sync.(*Once).doSlow(0x0?, 0x0?)
              sync/once.go:74 +0xc2
      sync.(*Once).Do(...)
              sync/once.go:65
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyzeRecursive(0x0?, 0x0?, 0x0?)
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:37 +0x52
      github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyzeRecursive.func1.1(0x0?)
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:43 +0x2a
      created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyzeRecursive.func1
              github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:42 +0xae
      make: *** [Makefile:172: verify-golangci] Error 2
      

      Expected results:

      golangci-lint step does not panic

      Additional info:

      Example failure log: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_microshift/2789/pull-ci-openshift-microshift-main-verify/1749526055196037120#1:build-log.txt%3A32

       

              jcope@redhat.com Jon Cope
              jcope@redhat.com Jon Cope
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: