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

Metal-cli compilation failed with [email protected] Version #406

Closed
codinja1188 opened this issue Dec 12, 2023 · 1 comment · Fixed by #461
Closed

Metal-cli compilation failed with [email protected] Version #406

codinja1188 opened this issue Dec 12, 2023 · 1 comment · Fixed by #461
Labels
bug Something isn't working

Comments

@codinja1188
Copy link
Contributor

What happened?

currently, metal-cli compilation is fine with [email protected] and [email protected] [email protected], but when we try with the latest Go version observe a below failure.

make failed with [email protected] [email protected]

	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:566 +0x158
honnef.co/go/tools/go/ir.(*builder).stmt(0x14002beaa00?, 0x14002beaa00, {0x1037d0118?, 0x140006e04a0?})
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2291 +0x15ac
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:855
honnef.co/go/tools/go/ir.(*builder).switchStmt(0x14001e142c0?, 0x14002beaa00, 0x14001655200, 0x0)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:1366 +0x14cc
honnef.co/go/tools/go/ir.(*builder).stmt(0x14002c55528?, 0x14002beaa00, {0x1037d08c8?, 0x14001655200?})
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2365 +0xf4c
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:855
honnef.co/go/tools/go/ir.(*builder).stmt(0x14002beaa00?, 0x14002beaa00, {0x1037d0688?, 0x14001655230?})
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2338 +0x1270
honnef.co/go/tools/go/ir.(*builder).buildFunction(0x14002c55a28, 0x14002beaa00)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2450 +0x344
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x10366e300?, 0x14001d7f440, 0x14001655260)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2488 +0x1a4
honnef.co/go/tools/go/ir.(*Package).build(0x14001d7f440)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2594 +0x9ec
sync.(*Once).doSlow(0x14000545b20?, 0x1400043bb60?)
	/opt/homebrew/Cellar/go/1.21.5/libexec/src/sync/once.go:74 +0x100
sync.(*Once).Do(...)
	/opt/homebrew/Cellar/go/1.21.5/libexec/src/sync/once.go:65
honnef.co/go/tools/go/ir.(*Package).Build(...)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:2512
honnef.co/go/tools/internal/passes/buildir.run(0x14001c9b110)
	/Users/vasubabu/go/pkg/mod/honnef.co/go/[email protected]/internal/passes/buildir/buildir.go:86 +0x144
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0x140017a65e0)
	/Users/vasubabu/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:187 +0x8c8
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	/Users/vasubabu/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:105 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x14000443e50, {0x1032e2cf9, 0x7}, 0x1400142c730)
	/Users/vasubabu/go/pkg/mod/github.com/golangci/[email protected]/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0x102d6a490?)
	/Users/vasubabu/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:104 +0x78
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0x140017a65e0)
	/Users/vasubabu/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb0
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 1218
	/Users/vasubabu/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x170
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte
INFO [runner] processing took 1.79µs with stages: max_same_issues: 459ns, skip_dirs: 209ns, nolint: 208ns, autogenerated_exclude: 167ns, identifier_marker: 166ns, skip_files: 83ns, uniq_by_line: 42ns, cgo: 42ns, max_from_linter: 42ns, max_per_file_from_linter: 42ns, path_prettifier: 42ns, diff: 42ns, filename_unadjuster: 41ns, source_code: 41ns, exclude: 41ns, exclude-rules: 41ns, sort_results: 41ns, path_prefixer: 41ns, path_shortener: 0s, severity-rules: 0s
INFO [runner] linters took 591.359917ms with stages: goanalysis_metalinter: 591.2235ms
ERRO Running error: 1 error occurred:
	* can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte

INFO Memory: 76 samples, avg is 38.4MB, max is 260.0MB
INFO Execution took 7.4556925s
make: *** [Makefile:46: lint] Error 3
Vasubabus-MacBook-Pro:metal-cli vasubabu$ go version
go version go1.21.5 darwin/arm64

How can we reproduce it?

updated your GO version to latest [email protected] and update the Line-29 [email protected] [email protected] in Makefile run make in home directory of metal-cli.

CLI version (metal --version):

@codinja1188 codinja1188 added the bug Something isn't working label Dec 12, 2023
@displague displague changed the title Metal-cli compilation failed with lated [email protected] Version Metal-cli compilation failed with [email protected] Version Dec 18, 2023
@ctreatma
Copy link
Contributor

It sounds like this is more of a linting issue than a go version issue. Can we upgrade to 1.21 without upgrading the linter?

ctreatma added a commit that referenced this issue May 16, 2024
As part of this upgrade, I also upgrade golangci-lint to close #406. In
order to successfully install a newer golangci-lint locally, I had to
rip out the `hack/tools` workflow and run the linter in a container
instead. Per the golangci-lint docs, installing binaries or using a
container is preferred for local installation, and `go install` (which
is what the `hack/tools` workflow used) is not guaranteed to work:
https://golangci-lint.run/welcome/install/#install-from-source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants