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

Go 1.22 compatibility #472

Closed
colinodell opened this issue Feb 20, 2024 · 2 comments
Closed

Go 1.22 compatibility #472

colinodell opened this issue Feb 20, 2024 · 2 comments

Comments

@colinodell
Copy link

Would it be possible to tag a new release of this package soon?

Version 0.4.0 segfaults on Go 1.22 because it depends on an older version of golang.org/x/types with known compatibility issues (as seen here, here, and many other places).

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=0x5d465e]
goroutine 69 [running]:
go/types.(*Checker).handleBailout(0xc000350000, 0xc002b27bd0)
	/usr/local/go/src/go/types/check.go:367 +0x88
panic({0x801da0?, 0xb5a4f0?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x8fe6b8, 0xb613a0})
	/usr/local/go/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
	/usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0x8fe6b8?, 0xb613a0?})
	/usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x9008b0, 0xb4ea28}, 0xc000350000, 0xb613a0, 0xc002b25b48)
	/usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc000350000, 0xc0002eea40, 0xb613a0)
	/usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc000350000, 0xc0002eea40, {0x8fe9d8, 0xc002b0a0e0})
	/usr/local/go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc000350000, 0xc0002eea40, {0x8fe9d8, 0xc002b0a0e0}, {0x8686e1, 0xe})
	/usr/local/go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).exprInternal(0xc000350000, 0x0, 0xc0002eea40, {0x8ffc68, 0xc002fa44c0}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1175 +0x26dc
go/types.(*Checker).rawExpr(0xc000350000, 0x0, 0xc0002eea40, {0x8ffc68?, 0xc002fa44c0?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc000350000, 0x0?, 0xc0002eea40, {0x8ffc68?, 0xc002fa44c0?})
	/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).varDecl(0xc000350000, 0xc002b2a120, {0xc00007a130, 0x1, 0x1}, {0x0, 0x0}, {0x8ffc68, 0xc002fa44c0})
	/usr/local/go/src/go/types/decl.go:521 +0x17b
go/types.(*Checker).objDecl(0xc000350000, {0x904678, 0xc002b2a120}, 0x0)
	/usr/local/go/src/go/types/decl.go:194 +0x9e5
go/types.(*Checker).ident(0xc000350000, 0xc0002eea00, 0xc0008fd660, 0x0, 0x0)
	/usr/local/go/src/go/types/typexpr.go:62 +0x250
go/types.(*Checker).exprInternal(0xc000350000, 0x0, 0xc0002eea00, {0x8ffa58, 0xc0008fd660}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1033 +0x138
go/types.(*Checker).rawExpr(0xc000350000, 0x0, 0xc0002eea00, {0x8ffa58?, 0xc0008fd660?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc000350000, 0x0?, 0xc0002eea00, {0x8ffa58?, 0xc0008fd660?})
	/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).varDecl(0xc000[350](https://gitlab.seatgeekadmin.com/platform/letsgo/-/jobs/8242347#L350)000, 0xc002b2a060, {0xc00007a128, 0x1, 0x1}, {0x0, 0x0}, {0x8ffa58, 0xc0008fd660})
	/usr/local/go/src/go/types/decl.go:521 +0x17b
go/types.(*Checker).objDecl(0xc000350000, {0x904678, 0xc002b2a060}, 0x0)
	/usr/local/go/src/go/types/decl.go:194 +0x9e5
go/types.(*Checker).packageObjects(0xc000350000)
	/usr/local/go/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc000350000, {0xc00025ab50, 0x2, 0x2})
	/usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001ba000, 0xc000f54120)
	/tmp/go-cache-1732/.cache/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1055 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/tmp/go-cache-1732/.cache/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:854 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
	/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
	/tmp/go-cache-1732/.cache/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:842 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
	/tmp/go-cache-1732/.cache/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:777 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
	/tmp/go-cache-1732/.cache/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:776 +0xccf

I do not experience this error when using the latest commit of this repository thanks to Dependabot updating this library to a newer version. I'd prefer to use a tagged release of this package like v0.4.1 instead of v0.4.1-0.20240201214227-9a00b2185841 if possible 🙂

@colinodell colinodell changed the title Tag a new release? Go 1.22 compatibility Feb 20, 2024
@cristaloleg
Copy link
Collaborator

@cristaloleg
Copy link
Collaborator

cristaloleg commented Feb 22, 2024

Better to use https://github.com/quasilyte/go-ruleguard/releases/tag/v0.4.2 😉

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

No branches or pull requests

2 participants