Libp2p dependency Hell. #5882
Replies: 1 comment 2 replies
-
Hi Doug!
what would that be in practice? |
Beta Was this translation helpful? Give feedback.
-
Hi Doug!
what would that be in practice? |
Beta Was this translation helpful? Give feedback.
-
Right now, because each crate has it's own version, and those crate are all in a workspace, it can be difficult to use certain versions of rust-libp2p.
A story to illustrate:
Let's say I want to use Beetswap (a bitswap impl) over webrtc.
Beetswap uses
libp2p-core v0.42.0
Which means that any time you want to use Beetswap, you'll need
core v0.42.0
.Oh, you want to use WebRTC though? That's fine.
Well, you'll need
libp2p-webrtc-websys
version0.4.0
because anything before that breaks because__Nonexhaustive
was switched to
__Invalid
inwasm-bindgen
.What's that you say?
libp2p-webrtc-websys
version0.4.0
depends onlibp2p-core ^0.43.0
, which means beetswap won't work, so you'll need to fork that, create a branch that depends oncore 0.42.0
.THEN there's the fact that the commit for
libp2p-core v0.42.0
depends onlibp2p-webrtc-utils v0.2.1
,but you'll need
libp2p-webrtc-utils v0.3.0
in order forlibp2p-webrtc 0.8.0-alpha
to be compatible with it.But there is no git tag for
libp2p-webrtc-utils-v0.3.0
, so you cannot reference a commit for it. So you need ANOTHERbranch with
core 0.42
+utils 0.3
combined in order to use those.That's just to get all the versions to be compatible with each other. Otherwise, the dependency tree breaks.
EOF
What can we do?
I'd love to hear some ideas, because the real life story above works... but is crazy.
Can we start maybe using the equivalent of "Minimum Supported Rust Version" but with libp2p deps?
Is there any way around this in the Cargo workspace model where workspace members can use a minimum version of other workspace members?
Beta Was this translation helpful? Give feedback.
All reactions