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

bump go v1.20 #799

Merged
merged 1 commit into from
Mar 10, 2023
Merged

bump go v1.20 #799

merged 1 commit into from
Mar 10, 2023

Conversation

altergui
Copy link
Contributor

@altergui altergui commented Feb 7, 2023

needs bumping go-libp2p and kubo as well

this is blocked by libp2p/go-libp2p#2040 which was merged a few days ago but not yet included in a release, and then likely waiting for kubo to do a release as well

@altergui
Copy link
Contributor Author

altergui commented Feb 13, 2023

go-libp2p v0.25.1 was released, supporting go 1.20

challenge unlocked 🥳

but on a first look at these errors, it seems we need to wait for kubo release as well?

# github.com/ipfs/kubo/config
Error: ../../../go/pkg/mod/github.com/ipfs/kubo@v0.18.1/config/swarm.go:145:17: undefined: rcmgr.LimitConfig
# github.com/libp2p/go-libp2p-kad-dht
Error: ../../../go/pkg/mod/github.com/libp2p/go-libp2p-kad-dht@v0.20.0/subscriber_notifee.go:149:52: cannot use dht.protocolsStrs (variable of type []string) as []protocol.ID value in argument to dht.peerstore.FirstSupportedProtocol
# github.com/ipfs/go-bitswap/network
Error: ../../../go/pkg/mod/github.com/ipfs/go-bitswap@v0.11.0/network/ipfs_impl.go:168:21: cannot use generic type multistream.ErrNotSupported without instantiation
# github.com/libp2p/go-libp2p-pubsub
Error: ../../../go/pkg/mod/github.com/libp2p/go-libp2p-pubsub@v0.8.3/pubsub.go:326:32: cannot use ps.protoMatchFunc(string(id)) (value of type func(string) bool) as func(protocol.ID) bool value in argument to h.SetStreamHandlerMatch
# github.com/ipfs/kubo/p2p
Error: ../../../go/pkg/mod/github.com/ipfs/kubo@v0.18.1/p2p/listener.go:44:36: cannot use func(p string) bool {…} (value of type func(p string) bool) as func(protocol.ID) bool value in argument to host.SetStreamHandlerMatch
Error: ../../../go/pkg/mod/github.com/ipfs/kubo@v0.18.1/p2p/p2p.go:47:11: invalid operation: p != proto (mismatched types protocol.ID and string)

https://github.com/vocdoni/vocdoni-node/actions/runs/4168785041/jobs/7215986676

@altergui altergui requested a review from mvdan February 13, 2023 23:25
@mvdan
Copy link
Contributor

mvdan commented Feb 14, 2023

Yeah, it appears that libp2p itself had breaking changes, so upstreams like ipfs need to be updated. See ipfs/kubo#9647. Looks like we need to wait for another release.

@Jorropo
Copy link

Jorropo commented Feb 14, 2023

I would wait until we release Kubo 0.19.0, first RC should be going out within the next week: ipfs/kubo#9502

@mvdan
Copy link
Contributor

mvdan commented Feb 14, 2023

Thanks :) I empathize with Marten and having to update quic-go for every Go release. Hopefully that will go away now that golang/go#44886 is gaining traction. It's just unfortunate that we're stuck not being able to use Go 1.20 two weeks after its release, but we can live with 1.19.x for another week for sure.

@altergui altergui mentioned this pull request Mar 6, 2023
@altergui
Copy link
Contributor Author

altergui commented Mar 6, 2023

merging this will fix #843

@altergui altergui force-pushed the f/bump-go-v1.20 branch 5 times, most recently from f2328b3 to e374ab6 Compare March 9, 2023 16:21
@altergui
Copy link
Contributor Author

altergui commented Mar 9, 2023

this is neverending but i see the light at the end of the tunnel

@altergui altergui force-pushed the f/bump-go-v1.20 branch 2 times, most recently from 9ad87e2 to 420759e Compare March 9, 2023 16:48
@altergui
Copy link
Contributor Author

altergui commented Mar 9, 2023

all checks, tests, staticchecks and whatever checks pass now,
rebased and squashed into a single commit with comprehensible changelog in commit message

@altergui altergui requested a review from p4u March 9, 2023 17:20
@altergui altergui self-assigned this Mar 9, 2023
@p4u
Copy link
Member

p4u commented Mar 10, 2023

@altergui we need to fix conflicts

Needed bumps:
* ci: bump staticcheck 2023.1.2 (supports go v1.20)
* go get github.com/libp2p/go-libp2p@v0.25.1
* go get github.com/ipfs/kubo@v0.19.0-rc1
* go mod tidy

Import path changes:
* github.com/libp2p/go-libp2p-core -> github.com/libp2p/go-libp2p/core
* github.com/libp2p/go-libp2p-connmgr -> github.com/libp2p/go-libp2p/p2p/net/connmgr
* github.com/ipfs/go-ipfs-files -> github.com/ipfs/go-libipfs/files

Code changes:
* ipfs: config.NewOptionalInteger() and config.NewOptionalDuration()
* ipfsconnect/subpub: connmanager.WithGracePeriod(time.Second*10))
* ipfsconnect/subpub: c.Apply(libp2p.Defaults)
* ipfsconnect/subpub: disable TestSubPub until fixed
* util/net_test: fix go vet warning
* api/autoswag: fix gofmt issue
* all: rand.Seed() no longer needed in go v1.20
    according to https://tip.golang.org/doc/go1.20#math/rand
    The math/rand package now automatically seeds the global random number generator
    with a random value, and the top-level Seed function has been deprecated
* benchmark/vochain: fix 'this value of processID is never used'
* rpcclient/util: use crypto/rand.Int instead of deprecated math/rand.Intn
@altergui altergui merged commit dcf2e8e into master Mar 10, 2023
@altergui altergui deleted the f/bump-go-v1.20 branch March 10, 2023 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.

4 participants