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

Compilation problems when using embassy-net version 0.5.0 in esp32 #3671

Closed
gustavowd opened this issue Dec 20, 2024 · 3 comments
Closed

Compilation problems when using embassy-net version 0.5.0 in esp32 #3671

gustavowd opened this issue Dec 20, 2024 · 3 comments

Comments

@gustavowd
Copy link

Hi everyone. At first, thanks for such a great framework.
However, I'm facing compilation problems when enabling embassy-net version 0.5.0. It seems that embassy-net relies in smoltcp version 0.12.0, but esp-wifi current version (0.11.0) uses smoltcp version 0.11.0 and this is causing compatibility issues.
Any thoughts about this?

Thanks in advance.

@gustavowd
Copy link
Author

This is the errors found:

Compiling esp32c3-embassy v0.1.0 (/home/gustavo/embedded_rust/esp32c3-embassy)
error: You must enable at least one of the following features: proto-ipv4, proto-ipv6, proto-sixlowpan
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/lib.rs:99:1
|
99 | compile_error!("You must enable at least one of the following features: proto-ipv4, proto-ipv6, proto-sixlowpan");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0392]: lifetime parameter 'a is never used
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/packet.rs:8:32
|
8 | pub(crate) enum EthernetPacket<'a> {
| ^^ unused lifetime parameter
|
= help: consider removing 'a, referring to it in a field, or using a marker such as PhantomData

error[E0392]: lifetime parameter 'p is never used
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/packet.rs:16:24
|
16 | pub(crate) enum Packet<'p> {
| ^^ unused lifetime parameter
|
= help: consider removing 'p, referring to it in a field, or using a marker such as PhantomData

error[E0282]: type annotations needed
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/interface/mod.rs:1510:13
|
1510 | Ok(())
| ^^ cannot infer type of the type parameter E declared on the enum Result
|
help: consider specifying the generic arguments
|
1510 | Ok::<(), E>(())
| +++++++++

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/interface/mod.rs:801:15
|
801 | match dst_addr {
| ^^^^^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
801 ~ match dst_addr {
802 + _ => todo!(),
803 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/interface/mod.rs:1082:15
|
1082 | match address {
| ^^^^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
1082 ~ match address {
1083 + _ => todo!(),
1084 + }
|

error[E0004]: non-exhaustive patterns: type &packet::Packet<'_> is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/packet.rs:56:15
|
56 | match self {
| ^^^^
|
note: packet::Packet<'_> defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/packet.rs:16:17
|
16 | pub(crate) enum Packet<'p> {
| ^^^^^^
= note: the matched value is of type &packet::Packet<'_>
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
56 ~ match self {
57 + _ => todo!(),
58 + }
|

error[E0004]: non-exhaustive patterns: type &packet::Packet<'_> is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/packet.rs:65:15
|
65 | match self {
| ^^^^
|
note: packet::Packet<'_> defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/iface/packet.rs:16:17
|
16 | pub(crate) enum Packet<'p> {
| ^^^^^^
= note: the matched value is of type &packet::Packet<'_>
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
65 ~ match self {
66 + _ => todo!(),
67 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:113:15
|
113 | match self {
| ^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
113 ~ match self {
114 + _ => todo!(),
115 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:123:15
|
123 | match self {
| ^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
123 ~ match self {
124 + _ => todo!(),
125 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:133:15
|
133 | match self {
| ^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
133 ~ match self {
134 + _ => todo!(),
135 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:143:15
|
143 | match self {
| ^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
143 ~ match self {
144 + _ => todo!(),
145 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:153:15
|
153 | match self {
| ^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
153 ~ match self {
154 + _ => todo!(),
155 + }
|

error[E0004]: non-exhaustive patterns: type &ip::Address is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:163:15
|
163 | match self {
| ^^^^
|
note: ip::Address defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:88:10
|
88 | pub enum Address {
| ^^^^^^^
= note: the matched value is of type &ip::Address
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
163 ~ match self {
164 + _ => todo!(),
165 + }
|

error[E0004]: non-exhaustive patterns: type &mut ip::Repr is non-empty
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:654:15
|
654 | match self {
| ^^^^
|
note: ip::Repr defined here
--> /home/gustavo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smoltcp-0.11.0/src/wire/ip.rs:546:10
|
546 | pub enum Repr {
| ^^^^
= note: the matched value is of type &mut ip::Repr
= note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
654 ~ match self {
655 + _ => todo!(),
656 + }
|

Some errors have detailed explanations: E0004, E0282, E0392.
For more information about an error, try rustc --explain E0004.
error: could not compile smoltcp (lib) due to 15 previous errors

@davoclavo
Copy link

davoclavo commented Dec 20, 2024

I think the issue would be more appropriate to report it in the https://github.com/esp-rs/esp-hal repo as it is their responsibility to update smoltcp to 0.12.0. (Update: there seem to be an open PR exactly for this: esp-rs/esp-hal#2849)

That said, and hopefully it applies to your case: try removing the utils and/or smoltcp features from your esp-wifi import, as it is marking smoltcp dependency as optional, but being added by those feature flags in order to avoid getting it imported in your project. That way you could just rely on the smoltcp version used by embassy-net which is 0.12.0

Good luck!

@gustavowd
Copy link
Author

Thank you very much.
Its working like a charm. I just need to disable the util feature of esp-wifi.

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

No branches or pull requests

2 participants