Skip to content

Update golang.org/x/tools to v0.18.0 #513

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

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

qmuntal
Copy link
Member

@qmuntal qmuntal commented Feb 28, 2024

This PR updates golang/x/tools by running go get golang.org/x/tools@latest.

This solve a panic when running go test -run TestImports ./pkg/sqlcmd-linter with the a Go 1.22 toolchain:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x43ad7e]

goroutine 68 [running]:
go/types.(*Checker).handleBailout(0xc00041a200, 0xc0001f1bd0)
        C:/Program Files/Go/src/go/types/check.go:367 +0x88
panic({0x4ebde0?, 0x740770?})
        C:/Program Files/Go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x5a8508, 0x743ae0})
        C:/Program Files/Go/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
        C:/Program Files/Go/src/go/types/sizes.go:333
go/types.representableConst.func1({0x5a8508?, 0x743ae0?})
        C:/Program Files/Go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x5a9878, 0x737c48}, 0xc00041a200, 0x743ae0, 0xc0001f13c0)
        C:/Program Files/Go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc00041a200, 0xc000074080, 0x743ae0)
        C:/Program Files/Go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc00041a200, 0xc000074080, {0x5a8508, 0x743ae0})
        C:/Program Files/Go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc00041a200, 0xc000074080, {0x5a8508, 0x743ae0}, {0x53b640, 0x14})
        C:/Program Files/Go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initVar(0xc00041a200, 0xc00010e240, 0xc000074080, {0x53b640, 0x14})
        C:/Program Files/Go/src/go/types/assignments.go:163 +0x41e
go/types.(*Checker).varDecl(0xc00041a200, 0xc00010e240, {0xc000112028, 0x1, 0x1}, {0x0, 0x0}, {0x5a8950, 0xc000238080})
        C:/Program Files/Go/src/go/types/decl.go:522 +0x19b
go/types.(*Checker).objDecl(0xc00041a200, {0x5ac038, 0xc00010e240}, 0x0)
        C:/Program Files/Go/src/go/types/decl.go:194 +0x9e5
go/types.(*Checker).packageObjects(0xc00041a200)
        C:/Program Files/Go/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc00041a200, {0xc000386008, 0x1, 0x1})
        C:/Program Files/Go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
        C:/Program Files/Go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000236000, 0xc0005ca150)
        C:/Users/qmuntaldiaz/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        C:/Users/qmuntaldiaz/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
        C:/Program Files/Go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        C:/Program Files/Go/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
        C:/Users/qmuntaldiaz/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        C:/Users/qmuntaldiaz/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:846 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 11
        C:/Users/qmuntaldiaz/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:845 +0x94
FAIL    github.com/microsoft/go-sqlcmd/pkg/sqlcmd-linter        1.832s
FAIL

Copy link
Collaborator

@shueybubbles shueybubbles left a comment

Choose a reason for hiding this comment

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

thx for the PR!

I think we'll update more dependencies with the next bump of the go-mssqldb driver too.

@shueybubbles
Copy link
Collaborator

@qmuntal if msft Go folks want to be a contributor to our projects, is there a Github team I can add? it'd save you from having to fork.

@qmuntal
Copy link
Member Author

qmuntal commented Feb 28, 2024

@qmuntal if msft Go folks want to be a contributor to our projects, is there a Github team I can add? it'd save you from having to fork.

Yep, this is the team: https://github.com/orgs/microsoft/teams/golang-compiler. We are not using go-sqlcmd directly, but we plan to use it to verify that the MSFT Go toolchain doesn't break compat with upstream.

@shueybubbles
Copy link
Collaborator

pls run build\build to update the NOTICE too

@shueybubbles shueybubbles merged commit 4ed5df1 into microsoft:main Feb 29, 2024
@qmuntal qmuntal deleted the updatextools branch February 29, 2024 16: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