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

Update dependencies to support Go 1.22 #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atc0005
Copy link
Contributor

@atc0005 atc0005 commented Feb 5, 2024

Overview

Building current master branch (0696445) using Go 1.22rc2 (golang:1.22rc2-bookworm Docker image) appears to work, but running the linter fails:

root@33735e4cad59:/go/structslop# go install ./cmd/structslop
go: downloading golang.org/x/tools v0.8.0
go: downloading github.com/dave/dst v0.27.2
go: downloading golang.org/x/sys v0.7.0
go: downloading golang.org/x/mod v0.10.0

root@33735e4cad59:/go/check-restart# structslop ./...
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=0x59997e]

goroutine 67 [running]:
go/types.(*Checker).handleBailout(0xc0003b0800, 0xc000275bd0)
        /usr/local/go/src/go/types/check.go:367 +0x88
panic({0x765100?, 0xa0dc20?})
        /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x842388, 0xa146a0})
        /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({0x842388?, 0xa146a0?})
        /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x844390, 0xa06480}, 0xc0003b0800, 0xa146a0, 0xc0002734a0)
        /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0003b0800, 0xc00026c740, 0xa146a0)
        /usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0003b0800, 0xc00026c740, {0x842388, 0xa146a0})
        /usr/local/go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc0003b0800, 0xc00026c740, {0x842388, 0xa146a0}, {0xc00011e738, 0x13})
        /usr/local/go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).arguments(0xc0003b0800, 0xc00044c180, 0xc000490280, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0xc0004854b8, ...}, ...)
        /usr/local/go/src/go/types/call.go:654 +0x13dc
go/types.(*Checker).callExpr(0xc0003b0800, 0xc00026c680, 0xc00044c180)
        /usr/local/go/src/go/types/call.go:304 +0x6e9
go/types.(*Checker).exprInternal(0xc0003b0800, 0x0, 0xc00026c680, {0x843d48, 0xc00044c180}, {0x0, 0x0})
        /usr/local/go/src/go/types/expr.go:1374 +0xf8
go/types.(*Checker).rawExpr(0xc0003b0800, 0x0, 0xc00026c680, {0x843d48?, 0xc00044c180?}, {0x0?, 0x0?}, 0x0)
        /usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).multiExpr(0xc0003b0800, {0x843d48, 0xc00044c180}, 0x0)
        /usr/local/go/src/go/types/expr.go:1532 +0x79
go/types.(*Checker).assignVars(0xc0003b0800, {0xc0006985a0, 0x1, 0x1}, {0xc0006985c0, 0x1, 0x1})
        /usr/local/go/src/go/types/assignments.go:472 +0xd0
go/types.(*Checker).stmt(0xc0003b0800, 0x0, {0x8438f8, 0xc00044c1c0})
        /usr/local/go/src/go/types/stmt.go:476 +0x1628
go/types.(*Checker).stmtList(0xc0003b0800, 0x0, {0xc0000b8660?, 0xc000275988?, 0x45273e?})
        /usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0003b0800, 0x842748?, {0xc0004ae384?, 0xc00081e3a0?}, 0xc0001fcf00, 0xc00046a0f0, {0x0?, 0x0?})
        /usr/local/go/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
        /usr/local/go/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0003b0800, 0x0)
        /usr/local/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0003b0800, {0xc00090ad08, 0x3, 0x3})
        /usr/local/go/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
        /usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000192000, 0xc0004de090)
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:851 +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?)
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:774 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:773 +0xccf

After updating the dependencies (and building/installing a fresh binary) running structslop works as expected.

root@33735e4cad59:/go/structslop# go get -u ./...
go: downloading golang.org/x/sys v0.16.0
go: downloading golang.org/x/sync v0.6.0
go: upgraded github.com/dave/dst v0.27.2 => v0.27.3
go: upgraded golang.org/x/mod v0.10.0 => v0.14.0
go: upgraded golang.org/x/sys v0.7.0 => v0.16.0
go: upgraded golang.org/x/tools v0.8.0 => v0.17.0

root@33735e4cad59:/go/structslop# go install ./cmd/structslop
root@33735e4cad59:/go/structslop# cd ..
root@33735e4cad59:/go# cd check-restart
root@33735e4cad59:/go/check-restart# structslop --verbose ./...
/go/check-restart/internal/config/config.go:35:14: struct has size 2 (size class 8)
/go/check-restart/internal/config/config.go:50:13: struct has size 136 (size class 144)

Changes

  • dave/dst
    • v0.27.2 to v0.27.3
  • golang.org/x/tools
    • v0.8.0 to v0.17.0

References

- `dave/dst`
  - `v0.27.2` to `v0.27.3`
- `golang.org/x/tools`
  - `v0.8.0` to `v0.17.0`
@atc0005 atc0005 force-pushed the update-dependencies-to-support-go-1.22 branch from a152317 to 55db8be Compare February 8, 2024 11:39
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.

1 participant