-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(examples): enable mplex feature for libp2p dep #3809
Conversation
mplex is deprecated and thus not active purposely. If you are following examples, make sure you are looking at the correct source code, i.e. if you depend on |
Thanks @thomaseizinger . I checked-out the tag git checkout libp2p-v0.51.3
cd examples/distributed-key-value-store
cargo build
error[E0432]: unresolved import `libp2p::development_transport`
--> examples/distributed-key-value-store/src/main.rs:51:5
|
51 | development_transport, identity, mdns,
| ^^^^^^^^^^^^^^^^^^^^^ no `development_transport` in the root
For more information about this error, try `rustc --explain E0432`.
error: could not compile `distributed-key-value-store` due to previous error
|
Thanks for the report! That is strange. Let me investigate. |
It seems that by running a full build on the workspace with Let me see if I can fix this with a new CI job. |
Submitted a PR here: #3811 |
Thank you! |
Due to cargo's feature unification, a full build of our workspace doesn't actually check whether the examples compile as standalone projects. We add a new CI check that iterates through all crates in the `examples/` directory and runs a plain `cargo check` on them. Any failure is bubbled up via `set -e`, thus failing CI in case one of the `cargo check` commands fails. To fix the current failures, we construct a simple TCP transport everywhere where we were previously using `development_transport`. That is because `development_transport` requires `mplex` which is now deprecated. Related #3657. Related #3809. Pull-Request: #3811.
Description
Some rust-libp2p examples uses
development_transport(...)
that requires themplex
feature enabled. But, theCargo.toml
s of those examples don't enable themplex
.This isn't an issue in this repo because those examples refer to the
libp2p
usingpath = "../../libp2p"
, but if you try to rewrite those examples from scratch by referring tolibp2p = { version = "...", ...}
, the following error will occur:Notes & open questions
I just enable the
mplex
feature for those examples.Change checklist