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

github: update CI to run most tests with Go 1.21 with build/compat test with 1.20 #12822

Merged
merged 16 commits into from
Feb 8, 2024

Conversation

simondeziel
Copy link
Member

@simondeziel simondeziel commented Feb 5, 2024

@tomponline I had to re-introduce the pining of github.com/mdlayher/socket@v0.4.1 in order to have go mod tidy -go=1.20 work when using Go 1.20 (see the Check compatibility with min Go version (${{ matrix.go }}) test step).

In #12794 (comment) you confirmed you ran into this issue with Go 1.21 (like I do) and that's further confirmed by upstream claiming this module to require 1.21+: https://github.com/mdlayher/socket/blob/main/CHANGELOG.md#v050

That said, since we have now bumped the requirement for Go to be 1.21+, maybe we should actually drop compat with 1.20? Happy to do so here or in a subsequent PR.

@simondeziel simondeziel marked this pull request as ready for review February 6, 2024 21:20
@tomponline
Copy link
Member

That said, since we have now bumped the requirement for Go to be 1.21+, maybe we should actually drop compat with 1.20? Happy to do so here or in a subsequent PR.

Yep that makes sense. Can you include in this PR please.

@tomponline
Copy link
Member

@simondeziel is go 1.22 available in GH yet? As its just been released and we should use that as we plan to use it for the next LTS release https://go.dev/doc/go1.22

@simondeziel
Copy link
Member Author

simondeziel commented Feb 7, 2024

@tomponline yes Go 1.22 is available but it didn't fare well, Go segfaults during make update-api it seems: https://github.com/canonical/lxd/actions/runs/7815899572/job/21320253075?pr=12822

Update: the same crash happened on a retry.

@simondeziel
Copy link
Member Author

@tomponline I propose we go with 1.21 for now and revisit 1.22 in a few days or maybe when they publish a point release.

@simondeziel
Copy link
Member Author

Testing locally with go latest/edge snap shows the same problem:

$ sudo snap refresh go --channel latest/edge
go (edge) 1.22-1ae729e from Canonical✓ refreshed

$ make update-api -s
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=0x1 addr=0x0 pc=0xe1f9fe]

goroutine 836 [running]:
go/types.(*Checker).handleBailout(0xc0013c8a00, 0xc001149bd0)
	/snap/go/current/src/go/types/check.go:367 +0x88
panic({0x112b120?, 0x19acfa0?})
	/snap/go/current/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x1403f20, 0x19b7e40})
	/snap/go/current/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
	/snap/go/current/src/go/types/sizes.go:333
go/types.representableConst.func1({0x1403f20?, 0x19b7e40?})
	/snap/go/current/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x1408d58, 0x19ea7c0}, 0xc0013c8a00, 0x19b7e40, 0xc0011487e8)
	/snap/go/current/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0013c8a00, 0xc0011517c0, 0x19b7e40)
	/snap/go/current/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0013c8a00, 0xc0011517c0, {0x1403f20, 0x19b7e40})
	/snap/go/current/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc0013c8a00, 0xc0011517c0, {0x1403f20, 0x19b7e40}, {0x1230ffe, 0x10})
	/snap/go/current/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initVar(0xc0013c8a00, 0xc000a132c0, 0xc0011517c0, {0x1230ffe, 0x10})
	/snap/go/current/src/go/types/assignments.go:163 +0x41e
go/types.(*Checker).initVars(0xc0013c8a00, {0xc000c32fd0, 0x1, 0xc000162b28?}, {0xc0001110b0, 0xc0010b8d58?, 0x251def4de7196620?}, {0x14077e8, 0xc00028aa60})
	/snap/go/current/src/go/types/assignments.go:383 +0x638
go/types.(*Checker).stmt(0xc0013c8a00, 0x0, {0x14077e8, 0xc00028aa60})
	/snap/go/current/src/go/types/stmt.go:524 +0x1fb7
go/types.(*Checker).stmtList(0xc0013c8a00, 0x0, {0xc0001110c0?, 0x0?, 0x0?})
	/snap/go/current/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0013c8a00, 0x1403f20?, {0xc000c80254?, 0x19b7e40?}, 0xc001151240, 0xc000cc06f0, {0x0?, 0x0?})
	/snap/go/current/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
	/snap/go/current/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0013c8a00, 0x0)
	/snap/go/current/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0013c8a00, {0xc000110f90, 0x2, 0x2})
	/snap/go/current/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
	/snap/go/current/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001468c0, 0xc000ad0240)
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:1055 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:854 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
	/snap/go/current/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	/snap/go/current/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:842 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:849 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 47
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:848 +0x94
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=0x1 addr=0x0 pc=0xe1f9fe]

goroutine 480 [running]:
go/types.(*Checker).handleBailout(0xc00137b400, 0xc0019a7bd0)
	/snap/go/current/src/go/types/check.go:367 +0x88
panic({0x112b120?, 0x19acfa0?})
	/snap/go/current/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x1403f20, 0x19b7ee0})
	/snap/go/current/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
	/snap/go/current/src/go/types/sizes.go:333
go/types.representableConst.func1({0x1403f20?, 0x19b7ee0?})
	/snap/go/current/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x1408d58, 0x19ea7c0}, 0xc00137b400, 0x19b7ee0, 0xc000a0f1a8)
	/snap/go/current/src/go/types/const.go:106 +0x2c7
go/types.(*Checker).conversion.func1({0x1403f20?, 0x19b7ee0?}, 0xc000a0f1a8)
	/snap/go/current/src/go/types/conversions.go:24 +0x73
go/types.(*Checker).conversion(0xc00137b400, 0xc000a0f180, {0x1403f20, 0x19b7ee0})
	/snap/go/current/src/go/types/conversions.go:44 +0x214
go/types.(*Checker).callExpr(0xc00137b400, 0xc000a0f180, 0xc0010cc940)
	/snap/go/current/src/go/types/call.go:224 +0xc97
go/types.(*Checker).exprInternal(0xc00137b400, 0x0, 0xc000a0f180, {0x1407ae8, 0xc0010cc940}, {0x0, 0x0})
	/snap/go/current/src/go/types/expr.go:1374 +0xf8
go/types.(*Checker).rawExpr(0xc00137b400, 0x0, 0xc000a0f180, {0x1407ae8?, 0xc0010cc940?}, {0x0?, 0x0?}, 0x0)
	/snap/go/current/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00137b400, 0x0?, 0xc000a0f180, {0x1407ae8?, 0xc0010cc940?})
	/snap/go/current/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).unary(0xc00137b400, 0xc000a0f180, 0xc0010e0120)
	/snap/go/current/src/go/types/expr.go:127 +0x4a
go/types.(*Checker).exprInternal(0xc00137b400, 0x0, 0xc000a0f180, {0x1407578, 0xc0010e0120}, {0x0, 0x0})
	/snap/go/current/src/go/types/expr.go:1406 +0x1905
go/types.(*Checker).rawExpr(0xc00137b400, 0x0, 0xc000a0f180, {0x1407578?, 0xc0010e0120?}, {0x0?, 0x0?}, 0x0)
	/snap/go/current/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00137b400, 0xc000cd3608?, 0xc000a0f180, {0x1407578?, 0xc0010e0120?})
	/snap/go/current/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).binary(0xc00137b400, 0xc000a0f180, {0x1407548, 0xc0010c9620}, {0x1407578, 0xc0010e0120}, {0x1406828, 0xc0010e0140}, 0x15, 0x45a83)
	/snap/go/current/src/go/types/expr.go:783 +0xa5
go/types.(*Checker).exprInternal(0xc00137b400, 0x0, 0xc000a0f180, {0x1407548, 0xc0010c9620}, {0x0, 0x0})
	/snap/go/current/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc00137b400, 0x0, 0xc000a0f180, {0x1407548?, 0xc0010c9620?}, {0x0?, 0x0?}, 0x0)
	/snap/go/current/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).exprInternal(0xc00137b400, 0x0, 0xc000a0f180, {0x14073c8, 0xc0010e0160}, {0x0, 0x0})
	/snap/go/current/src/go/types/expr.go:1320 +0x178
go/types.(*Checker).rawExpr(0xc00137b400, 0x0, 0xc000a0f180, {0x14073c8?, 0xc0010e0160?}, {0x0?, 0x0?}, 0x0)
	/snap/go/current/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00137b400, 0xc00109d500?, 0xc000a0f180, {0x14073c8?, 0xc0010e0160?})
	/snap/go/current/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).binary(0xc00137b400, 0xc000a0f140, {0x1407548, 0xc0010c9650}, {0x1406828, 0xc0010e00c0}, {0x14073c8, 0xc0010e0160}, 0x14, 0x45a76)
	/snap/go/current/src/go/types/expr.go:784 +0xcc
go/types.(*Checker).exprInternal(0xc00137b400, 0x0, 0xc000a0f140, {0x1407548, 0xc0010c9650}, {0x0, 0x0})
	/snap/go/current/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc00137b400, 0x0, 0xc000a0f140, {0x1407548?, 0xc0010c9650?}, {0x0?, 0x0?}, 0x0)
	/snap/go/current/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00137b400, 0x761c3b?, 0xc000a0f140, {0x1407548?, 0xc0010c9650?})
	/snap/go/current/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).constDecl(0xc00137b400, 0xc000814960, {0x0, 0x0}, {0x1407548, 0xc0010c9650}, 0x0)
	/snap/go/current/src/go/types/decl.go:488 +0x328
go/types.(*Checker).objDecl(0xc00137b400, {0x140f9c0, 0xc000814960}, 0x0)
	/snap/go/current/src/go/types/decl.go:191 +0xa49
go/types.(*Checker).packageObjects(0xc00137b400)
	/snap/go/current/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc00137b400, {0xc001080918, 0x3, 0x3})
	/snap/go/current/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/snap/go/current/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001468c0, 0xc000ad0660)
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:1055 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:854 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
	/snap/go/current/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	/snap/go/current/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:842 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:849 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 179
	/home/sdeziel/go/pkg/mod/golang.org/x/tools@v0.9.3/go/packages/packages.go:848 +0x94
make: *** [Makefile:119: update-api] Error 2

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the workflow is broken though

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
This was risky because if another snap (like mdl) moved to a core20 base, we'd
be removing core20 just to download it again.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
This is to reclaim some space.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
…et@v0.4.1"

This reverts commit 218af92.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
@simondeziel
Copy link
Member Author

CI is all green now.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
@tomponline
Copy link
Member

@simondeziel please can you backport appropriate changes to 5.0-edge too so we can keep these GH workflows in sync as best as possible (taking into account the min go versions are different). Thanks!

@tomponline tomponline merged commit a7031be into canonical:main Feb 8, 2024
26 checks passed
@simondeziel simondeziel deleted the ci-1.21 branch February 8, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants