Problem building go-libp2p@v0.14.4

Hi there,
I’ve tried updating our libp2p dependencies to v0.14.4 (I usually just go get -u github.com/libp2p/go-libp2p and expect go mod to do the heavy lifting for me). However it won’t build due to some problem in the identity protocol:

# github.com/libp2p/go-libp2p/p2p/protocol/identify
../../../../pkg/mod/github.com/libp2p/go-libp2p@v0.14.4/p2p/protocol/identify/id.go:536:23: ownKey.Bytes undefined (type "github.com/libp2p/go-libp2p-core/crypto".PubKey has no field or method Bytes)
make: *** [Makefile:24: binary] Error 2

Libp2p dependencies:

github.com/libp2p/go-libp2p v0.14.4
github.com/libp2p/go-libp2p-autonat v0.5.0
github.com/libp2p/go-libp2p-core v0.9.0
github.com/libp2p/go-libp2p-discovery v0.5.1 // indirect
github.com/libp2p/go-libp2p-noise v0.2.2 // indirect
github.com/libp2p/go-libp2p-peerstore v0.2.8
github.com/libp2p/go-libp2p-quic-transport v0.11.2
github.com/libp2p/go-libp2p-swarm v0.5.3
github.com/libp2p/go-libp2p-tls v0.2.0 // indirect
github.com/libp2p/go-libp2p-transport-upgrader v0.4.6
github.com/libp2p/go-tcp-transport v0.2.7
github.com/libp2p/go-ws-transport v0.5.0

Please use go get github.com/go-libp2p@latest, not go get -u. go get -u will transitively update all dependencies. Many of our packages are pre-1.0, so minor version bumps can include breaking changes.

If you really need to update transitive dependencies, go get -u=patch github.com/libp2p/go-libp2p should work as that will only update patch versions, not minor versions. But updating go-libp2p only, and letting it decide which dependencies need to be updated is the safest bet.

1 Like