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

Build fails with Go 1.22 (rc1 & rc2) #80514

Closed
Tracked by #157782
stefanb opened this issue Jan 14, 2024 · 5 comments · Fixed by #82114
Closed
Tracked by #157782

Build fails with Go 1.22 (rc1 & rc2) #80514

stefanb opened this issue Jan 14, 2024 · 5 comments · Fixed by #82114
Labels
needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating

Comments

@stefanb
Copy link

stefanb commented Jan 14, 2024

What happened?

Tried to build with Go 1.22 rc1 and rc2 both in

but the build failed in both cases at make gen-go target.

What did you expect to happen?

Expected the build to succeed the same as with Go 1.21

Did this work before?

Yes, works fine with current Go 1.21

How do we reproduce it?

  1. Install Go 1.22
  2. Remove any existing wire-v0.5.0 binary
  3. make sure go 1.22 is used by default using go command or adjust the Makefile AND .bingo/Variables.mk to use it.
  4. run make gen-go
  5. See error:
$ make gen-go                              
(re)installing /Users/xxx/go/bin/wire-v0.5.0
generate go files
/Users/xxx/go/bin/wire-v0.5.0 gen -tags "oss" ./pkg/server
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
      panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102e8e3c0]

goroutine 216 [running]:
go/types.(*Checker).handleBailout(0x140012b2400, 0x1400663dc78)
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:367 +0x9c
panic({0x102fdd8c0?, 0x10317a580?})
      /Users/xxx/sdk/go1.22rc1/src/runtime/panic.go:770 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x10301ce18, 0x10317e880})
      /Users/xxx/sdk/go1.22rc1/src/go/types/sizes.go:228 +0x320
go/types.(*Config).sizeof(...)
      /Users/xxx/sdk/go1.22rc1/src/go/types/sizes.go:333
go/types.representableConst.func1({0x10301ce18?, 0x10317e880?})
      /Users/xxx/sdk/go1.22rc1/src/go/types/const.go:76 +0x9c
go/types.representableConst({0x10301e808, 0x103172f40}, 0x140012b2400, 0x10317e880, 0x1400663c078)
      /Users/xxx/sdk/go1.22rc1/src/go/types/const.go:92 +0x138
go/types.(*Checker).representation(0x140012b2400, 0x14000cb7cc0, 0x10317e880)
      /Users/xxx/sdk/go1.22rc1/src/go/types/const.go:256 +0x68
go/types.(*Checker).implicitTypeAndValue(0x140012b2400, 0x14000cb7cc0, {0x10301ce18, 0x10317e880})
      /Users/xxx/sdk/go1.22rc1/src/go/types/expr.go:375 +0x340
go/types.(*Checker).convertUntyped(0x140012b2400, 0x14000cb7cc0, {0x10301ce18, 0x10317e880})
      /Users/xxx/sdk/go1.22rc1/src/go/types/const.go:289 +0x30
go/types.(*Checker).matchTypes(0x140012b2400, 0x14000cb7c80, 0x14000cb7cc0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/expr.go:926 +0x7c
go/types.(*Checker).binary(0x140012b2400, 0x14000cb7c80, {0x10301daa0, 0x140066139e0}, {0x10301db30, 0x14004963c00}, {0x10301e070, 0x14004963c20}, 0x28, 0x76e5)
      /Users/xxx/sdk/go1.22rc1/src/go/types/expr.go:800 +0x114
go/types.(*Checker).exprInternal(0x140012b2400, 0x0, 0x14000cb7c80, {0x10301daa0, 0x140066139e0}, {0x0, 0x0})
      /Users/xxx/sdk/go1.22rc1/src/go/types/expr.go:1416 +0x1d4
go/types.(*Checker).rawExpr(0x140012b2400, 0x0, 0x14000cb7c80, {0x10301daa0?, 0x140066139e0?}, {0x0?, 0x0?}, 0x0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/expr.go:979 +0x12c
go/types.(*Checker).expr(0x140012b2400, 0x10301d1b0?, 0x14000cb7c80, {0x10301daa0?, 0x140066139e0?})
      /Users/xxx/sdk/go1.22rc1/src/go/types/expr.go:1513 +0x38
go/types.(*Checker).stmt(0x140012b2400, 0x0, {0x10301de90, 0x14000cb7440})
      /Users/xxx/sdk/go1.22rc1/src/go/types/stmt.go:570 +0xdb0
go/types.(*Checker).stmtList(0x140012b2400, 0x0, {0x14004963d80?, 0x0?, 0x0?})
      /Users/xxx/sdk/go1.22rc1/src/go/types/stmt.go:121 +0x88
go/types.(*Checker).funcBody(0x140012b2400, 0x10301ce18?, {0x14006600748?, 0x10317ea60?}, 0x14000cb7ac0, 0x14006613a70, {0x0?, 0x0?})
      /Users/xxx/sdk/go1.22rc1/src/go/types/stmt.go:41 +0x21c
go/types.(*Checker).funcDecl.func1()
      /Users/xxx/sdk/go1.22rc1/src/go/types/decl.go:852 +0x44
go/types.(*Checker).processDelayed(0x140012b2400, 0x0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:467 +0x12c
go/types.(*Checker).checkFiles(0x140012b2400, {0x140066161b0, 0x1, 0x1})
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:411 +0x188
go/types.(*Checker).Files(...)
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0x140001501e0, 0x140007ffba0)
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:819 +0x4f4
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:677 +0x178
sync.(*Once).doSlow(0x0?, 0x0?)
      /Users/xxx/sdk/go1.22rc1/src/sync/once.go:74 +0x100
sync.(*Once).Do(...)
      /Users/xxx/sdk/go1.22rc1/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:664 +0x50
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:671 +0x30
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 211
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:670 +0x84
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
      panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102e8e3c0]

goroutine 245 [running]:
go/types.(*Checker).handleBailout(0x1400129d200, 0x14006457c78)
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:367 +0x9c
panic({0x102fdd8c0?, 0x10317a580?})
      /Users/xxx/sdk/go1.22rc1/src/runtime/panic.go:770 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x10301ce18, 0x10317e880})
      /Users/xxx/sdk/go1.22rc1/src/go/types/sizes.go:228 +0x320
go/types.(*Config).sizeof(...)
      /Users/xxx/sdk/go1.22rc1/src/go/types/sizes.go:333
go/types.representableConst.func1({0x10301ce18?, 0x10317e880?})
      /Users/xxx/sdk/go1.22rc1/src/go/types/const.go:76 +0x9c
go/types.representableConst({0x10301e808, 0x103172fc0}, 0x1400129d200, 0x10317e880, 0x0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/const.go:92 +0x138
go/types.(*Checker).arrayLength(0x1400129d200, {0x10301e070, 0x140045a8f40?})
      /Users/xxx/sdk/go1.22rc1/src/go/types/typexpr.go:510 +0x238
go/types.(*Checker).typInternal(0x1400129d200, {0x10301e1c0, 0x140063b04e0}, 0x0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/typexpr.go:299 +0x3bc
go/types.(*Checker).definedType(0x1400129d200, {0x10301e1c0, 0x140063b04e0}, 0x14006457238?)
      /Users/xxx/sdk/go1.22rc1/src/go/types/typexpr.go:180 +0x2c
go/types.(*Checker).varType(0x1400129d200, {0x10301e1c0, 0x140063b04e0})
      /Users/xxx/sdk/go1.22rc1/src/go/types/typexpr.go:145 +0x2c
go/types.(*Checker).structType(0x1400129d200, 0x140063b0840, 0x140063b0840?)
      /Users/xxx/sdk/go1.22rc1/src/go/types/struct.go:113 +0x128
go/types.(*Checker).typInternal(0x1400129d200, {0x10301e1f0, 0x14000116dc8}, 0x140000113b0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/typexpr.go:316 +0xed0
go/types.(*Checker).definedType(0x1400129d200, {0x10301e1f0, 0x14000116dc8}, 0x102d2c1e4?)
      /Users/xxx/sdk/go1.22rc1/src/go/types/typexpr.go:180 +0x2c
go/types.(*Checker).typeDecl(0x1400129d200, 0x140000113b0, 0x14000c02b00, 0x0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/decl.go:615 +0x39c
go/types.(*Checker).objDecl(0x1400129d200, {0x103020a18, 0x140000113b0}, 0x0)
      /Users/xxx/sdk/go1.22rc1/src/go/types/decl.go:197 +0x880
go/types.(*Checker).packageObjects(0x1400129d200)
      /Users/xxx/sdk/go1.22rc1/src/go/types/resolver.go:681 +0x3c0
go/types.(*Checker).checkFiles(0x1400129d200, {0x140001141b8, 0x1, 0x1})
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:408 +0x164
go/types.(*Checker).Files(...)
      /Users/xxx/sdk/go1.22rc1/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0x140001501e0, 0x140007ffa00)
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:819 +0x4f4
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:677 +0x178
sync.(*Once).doSlow(0x0?, 0x0?)
      /Users/xxx/sdk/go1.22rc1/src/sync/once.go:74 +0x100
sync.(*Once).Do(...)
      /Users/xxx/sdk/go1.22rc1/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:664 +0x50
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:671 +0x30
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 243
      /Users/xxx/go/pkg/mod/golang.org/x/tools@v0.0.0-20190422233926-fe54fb35175b/go/packages/packages.go:670 +0x84
make: *** [gen-go] Error 2

Error can also be seen in the build log of Homebrew/homebrew-core#157782

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 02300c3 AND v10.2.3
OS: MacOS
Browser: N/A

Grafana platform?

None

Datasource(s)?

No response

@stefanb stefanb changed the title make gen-go fails with Go 1.22 (rc1) Build fails with Go 1.22 (rc1) Jan 14, 2024
@stefanb
Copy link
Author

stefanb commented Jan 30, 2024

Possibly caused by upstream incompatibility of Wire with Go 1.22:

@stefanb stefanb changed the title Build fails with Go 1.22 (rc1) Build fails with Go 1.22 (rc1 & rc2) Jan 31, 2024
@tolzhabayev tolzhabayev added the needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating label Feb 2, 2024
@tolzhabayev
Copy link
Contributor

fyi @grafana/backend-platform to keep in mind wire and next go upgrade.

@toddtreece
Copy link
Member

i ran into this as well, and opened a PR: google/wire#401

@toddtreece
Copy link
Member

this should be fixed by #82114

@stefanb
Copy link
Author

stefanb commented Feb 8, 2024

Please make a release that includes the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants