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.mod: update dependencies #281

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

thaJeztah
Copy link
Contributor

go.mod: github.com/google/go-cmp v0.6.0

Update the minimum required version; this removes the purego fallbacks.

full diff: google/go-cmp@v0.5.9...v0.6.0

Update the minimum required version; this removes the purego fallbacks.

full diff: google/go-cmp@v0.5.9...v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This is the last version before go1.18 support was removed in;
golang/tools@283fce2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the update_deps branch 4 times, most recently from 20704bf to 63f3a9f Compare August 22, 2024 11:49
The TestFromDirSymlink test is failing on Windows;

    === Failed
    === FAIL: fs TestFromDirSymlink (0.01s)
        ops_test.go:55: assertion failed: directory C:\Users\circleci\AppData\Local\Temp\test-from-dir-992742947 does not match expected:
            \a\b\3
              target: expected C:\some\inexistent\link got \some\inexistent\link

Unlike Linux, Windows is always testing against "latest" version of Golang;

    Chocolatey v2.2.2
    Upgrading the following packages:
    golang
    By upgrading, you accept licenses for the packages.

    You have golang v1.22.2 installed. Version 1.23.0 is available based on your source(s).
    Progress: Downloading golang 1.23.0... 100%

Try installing go1.20 to see if that's related

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This reverts commit 05b199a.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
go.mod Outdated
github.com/google/go-cmp v0.5.9
golang.org/x/tools v0.2.0
github.com/google/go-cmp v0.6.0
golang.org/x/tools v0.3.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like updating to v0.3.0 at leat prevents the panic we saw in #279 (comment)

I'll try reverting to see if that's re-introducing, but perhaps we need to update this one.

It doesn't fix the failing test around symlinks, so that looks to be a separate issue.

This reverts commit 5b8e7a9.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Contributor Author

Hm.. interesting; not getting the panic now. Wondering if it's the go-cmp update then that fixed it?

This reverts commit 90e007b.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the update_deps branch 2 times, most recently from 8ccc01a to 7b13ab2 Compare August 22, 2024 13:37
@thaJeztah
Copy link
Contributor Author

Alright; looks like it's Go versions; the panic happens on go1.22 and go1.23 only, and doesn't happen on go1.21 and older;

=== Failed
=== FAIL: assert/cmd/gty-migrate-from-testify TestRun (unknown)
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=0x15bb38f]

goroutine 139 [running]:
go/types.(*Checker).handleBailout(0xc000098e00, 0xc0001cdc30)
        C:/Program Files/Go/src/go/types/check.go:412 +0x88
panic({0x17050a0?, 0x1aa1060?})
        C:/Program Files/Go/src/runtime/panic.go:785 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x181ab78, 0x1aa5da0})
        C:/Program Files/Go/src/go/types/sizes.go:229 +0x30f
go/types.(*Config).sizeof(...)
        C:/Program Files/Go/src/go/types/sizes.go:334
go/types.representableConst.func1({0x181ab78?, 0x1aa5da0?})
        C:/Program Files/Go/src/go/types/const.go:77 +0x86
go/types.representableConst({0x181d4d8, 0x1a98400}, 0xc000098e00, 0x1aa5da0, 0xc0001ccee0)
        C:/Program Files/Go/src/go/types/const.go:93 +0x173
go/types.(*Checker).representation(0xc000098e00, 0xc0002bcd00, 0x1aa5da0)
        C:/Program Files/Go/src/go/types/const.go:257 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc000098e00, 0xc0002bcd00, {0x181ab78, 0x1aa5da0})
        C:/Program Files/Go/src/go/types/expr.go:377 +0x2d7
go/types.(*Checker).assignment(0xc000098e00, 0xc0002bcd00, {0x181ab78, 0x1aa5da0}, {0x177cdbb, 0x10})
        C:/Program Files/Go/src/go/types/assignments.go:70 +0x451
go/types.(*Checker).initVar(0xc000098e00, 0xc00009b3e0, 0xc0002bcd00, {0x177cdbb, 0x10})
        C:/Program Files/Go/src/go/types/assignments.go:181 +0x428
go/types.(*Checker).initVars(0xc000098e00, {0xc0000c6128, 0x1, 0x0?}, {0xc0004f2590, 0x1765f12?, 0x3?}, {0x181c950, 0xc0004fa920})
        C:/Program Files/Go/src/go/types/assignments.go:399 +0x638
go/types.(*Checker).stmt(0xc000098e00, 0x0, {0x181c950, 0xc0004fa920})
        C:/Program Files/Go/src/go/types/stmt.go:533 +0x1777
go/types.(*Checker).stmtList(0xc000098e00, 0x0, {0xc0004f25a0?, 0x1585060?, 0xc000098e00?})
        C:/Program Files/Go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc000098e00, 0x181c1d0?, {0xc0004f6794?, 0xa?}, 0xc0002bcc80, 0xc0005154d0, {0x0?, 0x0?})
        C:/Program Files/Go/src/go/types/stmt.go:41 +0x2f3
go/types.(*Checker).funcDecl.func1()
        C:/Program Files/Go/src/go/types/decl.go:888 +0x3a
go/types.(*Checker).processDelayed(0xc000098e00, 0x0)
        C:/Program Files/Go/src/go/types/check.go:524 +0x15c
go/types.(*Checker).checkFiles(0xc000098e00, {0xc0004f24d0, 0x2, 0x2})
        C:/Program Files/Go/src/go/types/check.go:470 +0x17e
go/types.(*Checker).Files(0xc0001a01c0?, {0xc0004f24d0?, 0xc000070d80?, 0x6?})
        C:/Program Files/Go/src/go/types/check.go:430 +0x75
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001a01c0, 0xc0004d8f60)
        C:/Users/circleci/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:1037 +0x8f2
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        C:/Users/circleci/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:847 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
        C:/Program Files/Go/src/sync/once.go:76 +0xb4
sync.(*Once).Do(...)
        C:/Program Files/Go/src/sync/once.go:67
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
        C:/Users/circleci/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:835 +0x3b
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        C:/Users/circleci/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:842 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 135
        C:/Users/circleci/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:841 +0x94

trying to find what dependency / versions are needed to prevent a panic

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Contributor Author

Same panic on Linux, which is good, as it runs faster 😄

=== FAIL: assert/cmd/gty-migrate-from-testify TestRun (unknown)
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=0x69b46f]

goroutine 26 [running]:
go/types.(*Checker).handleBailout(0xc0001ec400, 0xc00056bc10)
        /usr/local/go/src/go/types/check.go:367 +0x88
panic({0x7e1600?, 0xb549e0?})
        /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x8f2298, 0xb597a0})
        /usr/local/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0x8f2298?, 0xb597a0?})
        /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x8f46a8, 0xb4c080}, 0xc0001ec400, 0xb597a0, 0xc00056a828)
        /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0001ec400, 0xc0000cd340, 0xb597a0)
        /usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0001ec400, 0xc0000cd340, {0x8f2298, 0xb597a0})
        /usr/local/go/src/go/types/expr.go:375 +0x2d7
go/types.(*Checker).assignment(0xc0001ec400, 0xc0000cd340, {0x8f2298, 0xb597a0}, {0x8562d9, 0x10})
        /usr/local/go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initVar(0xc0001ec400, 0xc00080cea0, 0xc0000cd340, {0x8562d9, 0x10})
        /usr/local/go/src/go/types/assignments.go:163 +0x3b2
go/types.(*Checker).initVars(0xc0001ec400, {0xc00029c0e0, 0x1, 0xc000182778?}, {0xc0006400b0, 0xc00019cd98?, 0x5ca910480cf0dcad?}, {0x8f3b60, 0xc000648680})
        /usr/local/go/src/go/types/assignments.go:382 +0x638
go/types.(*Checker).stmt(0xc0001ec400, 0x0, {0x8f3b60, 0xc000648680})
        /usr/local/go/src/go/types/stmt.go:524 +0x1fc5
go/types.(*Checker).stmtList(0xc0001ec400, 0x0, {0xc0006400c0?, 0x0?, 0x0?})
        /usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0001ec400, 0x8f2298?, {0xc00060c1e4?, 0xb597a0?}, 0xc0000cd2c0, 0xc00064c600, {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(0xc0001ec400, 0x0)
        /usr/local/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0001ec400, {0xc000286140, 0x2, 0x2})
        /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(0xc0001fc700, 0xc0004de330)
        /go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:1037 +0x932
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:847 +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/tools@v0.3.0/go/packages/packages.go:835 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        /go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:842 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 24
        /go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:841 +0x94

DONE 280 tests, 1 skipped, 1 failure in 35.246s

@thaJeztah
Copy link
Contributor Author

Good news; I went through all versions, and it looks like golang.org/x/tools v0.13.0 is the first version not showing a panic; golang/tools@v0.12.0...v0.13.0

it produces this output, but perhaps that one is expected;

=== RUN   TestRun
/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:7:2: cannot find package "github.com/go-check/check" in any of:
	/opt/homebrew/Cellar/go/1.23.0/libexec/src/github.com/go-check/check (from $GOROOT)
	/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/github.com/go-check/check (from $GOPATH)
/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:8:2: cannot find package "github.com/stretchr/testify/assert" in any of:
	/opt/homebrew/Cellar/go/1.23.0/libexec/src/github.com/stretchr/testify/assert (from $GOROOT)
	/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/github.com/stretchr/testify/assert (from $GOPATH)
/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:9:2: cannot find package "github.com/stretchr/testify/require" in any of:
	/opt/homebrew/Cellar/go/1.23.0/libexec/src/github.com/stretchr/testify/require (from $GOROOT)
	/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/github.com/stretchr/testify/require (from $GOPATH)
/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:7:2: could not import github.com/go-check/check (invalid package name: "")
/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:8:2: could not import github.com/stretchr/testify/assert (invalid package name: "")
/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:9:2: could not import github.com/stretchr/testify/require (invalid package name: "")
-: /var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:138:1: wrong signature for TestWithChecker, must be: func TestWithChecker(t *testing.T)
assert.NotContains(t, []bool{}, true) at ../../../../../../../var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/test-run-1655652600/src/example.com/example/some_test.go:56: skipping unsupported assertion
--- PASS: TestRun (0.67s)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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