ivmarkov / rust-esp32-std-demo

Rust on ESP32 STD demo app. A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mac m1 can not build in docker, cause by embedded-io-0.3.0

xiaoheng14 opened this issue · comments

root@c3c726dd90c0:/app/rust-esp32-std-demo# cargo update
Updating git repository https://github.com/esp-rs-compat/getrandom.git
Updating git repository https://github.com/esp-rs-compat/polling
Updating git repository https://github.com/esp-rs-compat/smol
Updating git repository https://github.com/esp-rs-compat/socket2
Updating crates.io index
Updating git repository https://github.com/yuri91/ili9341-rs
root@c3c726dd90c0:/app/rust-esp32-std-demo# cargo build --release
Compiling compiler_builtins v0.1.82
Compiling core v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling libc v0.2.131
Compiling cc v1.0.73
Compiling memchr v2.5.0
Compiling std v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std)
Compiling proc-macro2 v1.0.47
Compiling quote v1.0.21
Compiling unwind v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind)
Compiling unicode-ident v1.0.5
Compiling syn v1.0.103
Compiling libc v0.2.135
Compiling autocfg v1.1.0
Compiling serde v1.0.147
Compiling serde_derive v1.0.147
Compiling log v0.4.17
Compiling cfg-if v1.0.0
Compiling rustversion v1.0.9
Compiling serde_json v1.0.87
Compiling fnv v1.0.7
Compiling backtrace v0.3.66
Compiling thiserror v1.0.37
Compiling anyhow v1.0.66
Compiling once_cell v1.15.0
Compiling semver v1.0.14
Compiling aho-corasick v0.7.19
Compiling regex-syntax v0.6.27
Compiling futures-core v0.3.25
Compiling gimli v0.26.2
Compiling thiserror-impl v1.0.37
Compiling adler v1.0.2
Compiling bitflags v1.3.2
Compiling miniz_oxide v0.5.4
Compiling addr2line v0.17.0
Compiling regex v1.6.0
Compiling object v0.29.0
Compiling rustc-std-workspace-core v1.99.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling alloc v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
Compiling cfg-if v0.1.10
Compiling adler v0.2.3
Compiling rustc-demangle v0.1.21
Compiling rustc-std-workspace-alloc v1.99.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
Compiling gimli v0.25.0
Compiling hashbrown v0.12.3
Compiling std_detect v0.1.5 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
Compiling miniz_oxide v0.4.0
Compiling object v0.26.2
Compiling panic_abort v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_abort)
Compiling panic_unwind v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_unwind)
Compiling addr2line v0.16.0
Compiling ryu v1.0.11
Compiling glob v0.3.0
Compiling heck v0.4.0
Compiling itoa v1.0.4
Compiling clang-sys v1.4.0
Compiling strum_macros v0.24.3
Compiling dirs-sys v0.3.7
Compiling indexmap v1.9.1
Compiling crossbeam-utils v0.8.12
Compiling shlex v1.1.0
Compiling dirs v4.0.0
Compiling bstr v0.2.17
Compiling filetime v0.2.18
Compiling atty v0.2.14
Compiling os_str_bytes v6.3.0
Compiling same-file v1.0.6
Compiling proc_macro v0.0.0 (/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro)
Compiling lazy_static v1.4.0
Compiling strum v0.24.1
Compiling minimal-lexical v0.2.1
Compiling termcolor v1.1.3
Compiling nom v7.1.1
Compiling pin-project-lite v0.2.9
Compiling clap_lex v0.2.4
Compiling walkdir v2.3.2
Compiling globset v0.4.9
Compiling thread_local v1.1.4
Compiling libloading v0.7.3
Compiling num-traits v0.2.15
Compiling humantime v2.1.0
Compiling textwrap v0.15.1
Compiling strsim v0.10.0
Compiling bindgen v0.60.1
Compiling either v1.8.0
Compiling clap v3.2.22
Compiling which v4.3.0
Compiling env_logger v0.9.1
Compiling ignore v0.4.18
Compiling cexpr v0.6.0
Compiling byteorder v1.4.3
Compiling futures-io v0.3.25
Compiling nb v1.0.0
Compiling toml v0.5.9
Compiling lazycell v1.3.0
Compiling camino v1.1.1
Compiling rustc-hash v1.1.0
Compiling peeking_take_while v0.1.2
Compiling remove_dir_all v0.5.3
Compiling fastrand v1.8.0
Compiling globwalk v0.8.1
Compiling tempfile v3.3.0
Compiling cmake v0.1.48
Compiling remove_dir_all v0.7.0
Compiling cargo-platform v0.1.2
Compiling cargo_metadata v0.15.0
Compiling nb v0.1.3
Compiling cache-padded v1.2.0
Compiling void v1.0.2
Compiling envy v0.4.2
Compiling zero v0.1.2
Compiling az v1.2.1
Compiling ident_case v1.0.1
Compiling darling_core v0.14.1
Compiling xmas-elf v0.8.0
Compiling embuild v0.30.4
Compiling embedded-hal v0.2.7
Compiling concurrent-queue v1.2.4
Compiling parking v2.0.0
Compiling waker-fn v1.1.0
Compiling rustc_version v0.4.0
Compiling num-integer v0.1.45
Compiling futures-task v0.3.25
Compiling heapless v0.7.16
Compiling futures-lite v1.12.0
Compiling darling_macro v0.14.1
Compiling esp-idf-sys v0.31.10
Compiling embuild v0.29.3
Compiling futures-sink v0.3.25
Compiling event-listener v2.5.3
Compiling slab v0.4.7
Compiling futures-channel v0.3.25
Compiling unicode-segmentation v1.10.0
Compiling futures-util v0.3.25
Compiling heck v0.3.3
Compiling embedded-graphics-core v0.3.3
Compiling darling v0.14.1
Compiling proc-macro-crate v1.2.1
Compiling hash32 v0.2.1
Compiling stable_deref_trait v1.2.0
Compiling display-interface v0.4.1
Compiling async-task v4.3.0
Compiling pin-utils v0.1.0
Compiling time v0.1.44
Compiling iana-time-zone v0.1.51
Compiling unicode-xid v0.2.4
Compiling const_format_proc_macros v0.2.29
Compiling chrono v0.4.22
Compiling num_enum_derive v0.5.7
Compiling enumset_derive v0.6.1
Compiling strum_macros v0.23.1
Compiling async-channel v1.7.1
Compiling tinyvec_macros v0.1.0
Compiling atomic-waker v1.0.0
Compiling async-io v1.9.0
Compiling version_check v0.9.4
Compiling uncased v0.9.7
Compiling strum v0.23.0
Compiling blocking v1.2.0
Compiling tinyvec v1.6.0
Compiling futures v0.3.25
Compiling enumset v1.0.12
Compiling num_enum v0.5.7
Compiling build-time v0.1.2
Compiling const_format v0.2.30
Compiling esp-idf-hal v0.38.1
Compiling polling v2.2.0 (https://github.com/esp-rs-compat/polling#0a016089)
Compiling no-std-net v0.5.0
Compiling embedded-hal v1.0.0-alpha.8
Compiling socket2 v0.4.5 (https://github.com/esp-rs-compat/socket2#afeb7231)
Compiling embedded-io v0.3.0
error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:26:9
|
26 | / async move {
27 | | while !buf.is_empty() {
28 | | match self.read(buf).await {
29 | | Ok(0) => break,
... |
38 | | }
39 | | }
| |_________^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:10:3
|
10 | = impl Future<Output = Result<(), ReadExactError<T::Error>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type &'static mut T does not outlive the data it points at
|
help: consider adding an explicit lifetime bound...
|
9 | T: Read + ?Sized + 'a + 'static,
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:86:9
|
86 | / async move {
87 | | let mut buf = buf;
88 | | while !buf.is_empty() {
89 | | match self.write(buf).await {
... |
95 | | Ok(())
96 | | }
| |_________^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:62:3
|
62 | = impl Future<Output = Result<(), T::Error>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type &'static mut T does not outlive the data it points at
|
help: consider adding an explicit lifetime bound...
|
61 | T: Write + ?Sized + 'a + 'static,
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:107:9
|
107 | T::read(self, buf)
| ^^^^^^^^^^^^^^^^^^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:101:27
|
101 | type ReadFuture<'a> = impl Future<Output = Result<usize, Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type T will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
100 | impl<T: ?Sized + Read + 'static> Read for &mut T {
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:132:9
|
132 | T::write(self, buf)
| ^^^^^^^^^^^^^^^^^^^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:126:28
|
126 | type WriteFuture<'a> = impl Future<Output = Result<usize, Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type T will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
125 | impl<T: ?Sized + Write + 'static> Write for &mut T {
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:141:9
|
141 | T::flush(self)
| ^^^^^^^^^^^^^^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:135:28
|
135 | type FlushFuture<'a> = impl Future<Output = Result<(), Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type T will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
125 | impl<T: ?Sized + Write + 'static> Write for &mut T {
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:156:9
|
156 | / async move {
157 | | let amt = core::cmp::min(buf.len(), self.len());
158 | | let (a, b) = self.split_at(amt);
159 | |
... |
170 | | Ok(amt)
171 | | }
| |_________^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0491]: in type &'static mut &[u8], reference has a longer lifetime than the data it references
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:150:27
|
150 | type ReadFuture<'a> = impl Future<Output = Result<usize, Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the pointer is valid for the static lifetime
note: but the referenced data is only valid for the anonymous lifetime as defined here
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:149:15
|
149 | impl Read for &[u8] {
| ^

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:207:9
|
207 | / async move {
208 | | let amt = core::cmp::min(buf.len(), self.len());
209 | | let (a, b) = core::mem::replace(self, &mut []).split_at_mut(amt);
210 | | a.copy_from_slice(&buf[..amt]);
211 | | *self = b;
212 | | Ok(amt)
213 | | }
| |_________^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0491]: in type &'static mut &mut [u8], reference has a longer lifetime than the data it references
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:201:28
|
201 | type WriteFuture<'a> = impl Future<Output = Result<usize, Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the pointer is valid for the static lifetime
note: but the referenced data is only valid for the anonymous lifetime as defined here
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:200:16
|
200 | impl Write for &mut [u8] {
| ^

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:235:9
|
235 | T::read(self, buf)
| ^^^^^^^^^^^^^^^^^^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:229:27
|
229 | type ReadFuture<'a> = impl Future<Output = Result<usize, Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type T will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
228 | impl<T: ?Sized + Read + 'static> Read for alloc::boxed::Box {
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:264:9
|
264 | T::write(self, buf)
| ^^^^^^^^^^^^^^^^^^^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:258:28
|
258 | type WriteFuture<'a> = impl Future<Output = Result<usize, Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type T will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
257 | impl<T: ?Sized + Write + 'static> Write for alloc::boxed::Box {
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:273:9
|
273 | T::flush(self)
| ^^^^^^^^^^^^^^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

error[E0310]: the parameter type T may not live long enough
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:267:28
|
267 | type FlushFuture<'a> = impl Future<Output = Result<(), Self::Error>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type T will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
257 | impl<T: ?Sized + Write + 'static> Write for alloc::boxed::Box {
| +++++++++

error: non-defining opaque type use in defining scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.0/src/asynch.rs:286:9
|
286 | / async move {
287 | | self.extend_from_slice(buf);
288 | | Ok(buf.len())
289 | | }
| |_________^ lifetime 'a is part of concrete type but not used in parameter list of the impl Trait type alias

Some errors have detailed explanations: E0310, E0491.
For more information about an error, try rustc --explain E0310.
error: could not compile embedded-io due to 21 previous errors
warning: build failed, waiting for other jobs to finish...
root@c3c726dd90c0:/app/rust-esp32-std-demo#

esp32c3,and target is riscv32imc-esp-espidf

commented

having the same issue, target is riscv32imc-esp-espidf

having the same issue, target is riscv32imc-esp-espidf

me too ... not only in my mac, windows use wsl also has this problem, A few days ago we both can build the project, but today occur this problem and can't find the way to resolve it; have you solved?

commented

I have not yet, no. When I have time I will try to investigate further

Switching to older Rust Nightly should fix the issue.

I have not yet, no. When I have time I will try to investigate further

Switching to older Rust Nightly should fix the issue.

ok ,i will try it later, thanks!

I have not yet, no. When I have time I will try to investigate further

thanks for discussing!

commented

I have not yet, no. When I have time I will try to investigate further

thanks for discussing!

没问题 🙂 -- I just tried an older version of nightly (2022-10-01) and it builds. Thank you @ivmarkov for the suggestion

so you have it handy, here's the command I used to switch to that specific version of nightly

rustup override set nightly-2022-10-01

I have not yet, no. When I have time I will try to investigate further

thanks for discussing!

没问题 🙂 -- I just tried an older version of nightly (2022-10-01) and it builds. Thank you @ivmarkov for the suggestion

so you have it handy, here's the command I used to switch to that specific version of nightly

rustup override set nightly-2022-10-01

666, it works!!!

I have not yet, no. When I have time I will try to investigate further

Switching to older Rust Nightly should fix the issue.

ok ,i will try it later, thanks!

thanks for your help, it works!!!