Sycrosity / teeny

A teeny tiny esp32c3 powered spotify controller.
Apache License 2.0
3 stars 0 forks source link

build error for esp32 #18

Closed lijiachang closed 1 month ago

lijiachang commented 1 month ago

rust version:

username@ubuntu-2204:~/esp/teeny$ rustc -V
rustc 1.82.0-nightly (fd8d6fbe5 2024-08-02)

build error:

username@ubuntu-2204:~/esp/teeny$ just run esp32
cargo +esp run --target xtensa-esp32-none-elf --features esp32 --release
  Downloaded semihosting v0.1.11
  Downloaded esp32 v0.31.0
  Downloaded 2 crates (565.5 KB) in 1.89s
   Compiling compiler_builtins v0.1.109
   Compiling core v0.0.0 (/home/username/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core)
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.12
   Compiling version_check v0.9.4
   Compiling typenum v1.17.0
   Compiling generic-array v0.14.7
   Compiling serde v1.0.203
   Compiling quote v1.0.36
   Compiling syn v2.0.68
   Compiling portable-atomic v1.6.0
   Compiling rustversion v1.0.17
   Compiling autocfg v1.3.0
   Compiling embedded-io-async v0.6.1
   Compiling heapless v0.8.0
   Compiling strsim v0.11.1
   Compiling fnv v1.0.7
   Compiling ident_case v1.0.1
   Compiling termcolor v1.4.1
   Compiling num-traits v0.2.19
   Compiling syn v1.0.109
   Compiling heck v0.5.0
   Compiling anyhow v1.0.86
   Compiling embedded-hal-async v1.0.0
   Compiling heck v0.4.1
   Compiling equivalent v1.0.1
   Compiling hashbrown v0.14.5
   Compiling indexmap v2.2.6
   Compiling xtensa-lx v0.9.0
   Compiling darling_core v0.20.9
   Compiling litrs v0.4.1
   Compiling memchr v2.7.4
   Compiling paste v1.0.15
   Compiling serde_derive v1.0.203
   Compiling esp-build v0.1.0
   Compiling darling_macro v0.20.9
   Compiling strum_macros v0.26.4
   Compiling darling v0.20.9
   Compiling futures-macro v0.3.30
   Compiling lazy_static v1.5.0
   Compiling embassy-time-driver v0.1.0
   Compiling aho-corasick v1.1.3
   Compiling rustc-std-workspace-core v1.99.0 (/home/username/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/username/.rustup/toolchains/esp/lib/rustlib/src/rust/library/alloc)
   Compiling strum v0.26.3
   Compiling document-features v0.2.8
   Compiling embassy-time-queue-driver v0.1.0
   Compiling regex-syntax v0.8.4
   Compiling cfg-if v1.0.0
   Compiling lock_api v0.4.12
   Compiling enum-as-inner v0.4.0
   Compiling strum_macros v0.24.3
   Compiling zeroize v1.8.1
   Compiling byteorder v1.5.0
   Compiling stable_deref_trait v1.2.0
   Compiling critical-section v1.1.2
   Compiling subtle v2.6.1
   Compiling hash32 v0.3.1
   Compiling embedded-io v0.6.1
   Compiling crypto-common v0.1.6
   Compiling nb v1.1.0
   Compiling futures-core v0.3.30
   Compiling rand_core v0.6.4
   Compiling embedded-hal v1.0.0
   Compiling log v0.4.22
   Compiling futures-sink v0.3.30
   Compiling toml_datetime v0.6.6
   Compiling pin-project-lite v0.2.14
   Compiling pin-utils v0.1.0
   Compiling futures-task v0.3.30
   Compiling futures-util v0.3.30
   Compiling basic-toml v0.1.9
   Compiling block-buffer v0.10.4
   Compiling digest v0.10.7
   Compiling regex-automata v0.4.7
   Compiling esp-metadata v0.1.1
   Compiling void v1.0.2
   Compiling scopeguard v1.2.0
   Compiling const-oid v0.9.6
   Compiling proc-macro-error-attr v1.0.4
   Compiling strum v0.24.1
   Compiling embassy-sync v0.5.0
   Compiling der v0.7.9
   Compiling esp-hal v0.18.0
   Compiling hmac v0.12.1
   Compiling ff v0.13.0
   Compiling inout v0.1.3
   Compiling generic-array v0.12.4
   Compiling generic-array v0.13.3
   Compiling minijinja v1.0.21
   Compiling serde_spanned v0.6.6
   Compiling bare-metal v1.0.0
   Compiling base16ct v0.2.0
   Compiling regex v1.10.5
   Compiling core-isa-parser v0.2.0
   Compiling proc-macro-error v1.0.4
   Compiling embassy-sync v0.6.0
   Compiling atomic-polyfill v1.0.3
   Compiling winnow v0.6.13
   Compiling winnow v0.5.40
   Compiling toml_edit v0.21.1
   Compiling toml_edit v0.22.14
   Compiling sec1 v0.7.3
   Compiling as-slice v0.1.5
   Compiling cipher v0.4.4
   Compiling group v0.13.0
   Compiling hkdf v0.12.4
   Compiling spin v0.9.8
   Compiling num-integer v0.1.46
   Compiling num-complex v0.4.6
   Compiling approx v0.5.1
   Compiling crypto-bigint v0.5.5
   Compiling universal-hash v0.5.1
   Compiling xtensa-lx-rt v0.16.0
   Compiling no-std-net v0.6.0
   Compiling mutex-trait v0.2.0
   Compiling opaque-debug v0.3.1
   Compiling enumset_derive v0.8.1
   Compiling esp32 v0.31.0
   Compiling az v1.2.1
   Compiling elliptic-curve v0.13.8
   Compiling polyval v0.6.2
   Compiling simba v0.7.3
   Compiling num-rational v0.4.2
   Compiling enumset v1.1.3
   Compiling toml v0.8.14
   Compiling proc-macro-crate v3.1.0
   Compiling nb v0.1.3
   Compiling embassy-futures v0.1.1
   Compiling embassy-usb-driver v0.1.0
   Compiling r0 v1.0.0
   Compiling gcd v2.3.0
   Compiling vcell v0.1.3
   Compiling xtensa-lx-rt-proc-macros v0.2.1
   Compiling embassy-executor v0.5.0
   Compiling smoltcp v0.11.0
   Compiling heapless v0.6.1
   Compiling embedded-nal-async v0.7.1
   Compiling fugit v0.3.7
   Compiling esp-hal-procmacros v0.11.0
   Compiling embassy-usb-synopsys-otg v0.1.0
   Compiling embedded-hal v0.2.7
   Compiling toml-cfg v0.2.0
   Compiling primeorder v0.13.6
   Compiling ghash v0.5.1
   Compiling embedded-nal v0.8.0
   Compiling aes v0.8.4
   Compiling ctr v0.9.2
   Compiling esp-hal-embassy v0.1.0
   Compiling embedded-hal-nb v1.0.0
   Compiling embedded-can v0.4.1
   Compiling aead v0.5.2
   Compiling embedded-dma v0.2.0
   Compiling hash32 v0.1.1
   Compiling bitflags v2.6.0
   Compiling display-interface v0.5.0
   Compiling managed v0.8.0
   Compiling bitflags v1.3.2
   Compiling bitfield v0.15.0
   Compiling embassy-executor-macros v0.4.1
   Compiling delegate v0.12.0
   Compiling esp-wifi-sys v0.3.0
   Compiling libm v0.2.8
   Compiling httparse v1.9.4
   Compiling esp-println v0.9.1
   Compiling aes-gcm v0.10.3
   Compiling esp-wifi v0.6.0
   Compiling nalgebra v0.30.1
   Compiling p256 v0.13.2
   Compiling embassy-time v0.3.1
   Compiling sha2 v0.10.8
   Compiling futures-channel v0.3.30
   Compiling as-slice v0.2.1
   Compiling ppv-lite86 v0.2.17
   Compiling embedded-storage v0.3.1
   Compiling embassy-net-driver v0.2.0
   Compiling byte-slice-cast v1.2.2
   Compiling futures-io v0.3.30
   Compiling linked_list_allocator v0.10.5
   Compiling esp-backtrace v0.12.1
   Compiling portable_atomic_enum_macros v0.2.1
   Compiling embedded-hal-bus v0.2.0
   Compiling dotenv v0.15.0
   Compiling portable_atomic_enum v0.3.1
   Compiling futures v0.3.30
   Compiling display-interface-spi v0.5.0
   Compiling embedded-storage-async v0.4.1
   Compiling rand_chacha v0.3.1
   Compiling teeny v0.1.0 (/home/username/esp/teeny)
   Compiling atomic-pool v1.0.1
   Compiling embedded-tls v0.17.0
   Compiling display-interface-i2c v0.5.0
   Compiling float-cmp v0.9.0
   Compiling buffered-io v0.5.4
   Compiling atomic-waker v1.1.2
   Compiling hex v0.4.3
   Compiling micromath v2.1.0
   Compiling nourl v0.1.1
   Compiling base64 v0.21.7
   Compiling num-derive v0.4.2
   Compiling reqwless v0.12.0
error[E0277]: `Option<&Arguments<'_>>` doesn't implement `Display`
  --> /home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-backtrace-0.12.1/src/lib.rs:95:24
   |
95 |         println!("{}", message);
   |                        ^^^^^^^ `Option<&Arguments<'_>>` cannot be formatted with the default formatter
   |
   = help: the trait `Display` is not implemented for `Option<&Arguments<'_>>`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `esp-backtrace` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: Recipe `run` failed on line 19 with exit code 101

@Sycrosity 🙏 I am a beginner in Rust development. If there is anything wrong with my question, please point it out. Thank you for your reply.

Sycrosity commented 1 month ago

Hi @lijiachang! I have been quite busy recently and so havn't had much time to work on this project, so only getting round to this now.

While your rustc version is 1.82.0, what is the rustc version of your esp toolchain? You may need to run espup update, and then reload your shell - I am not getting the same error when running it on my device.

It may also be worth doing a cargo update, if you havn't already.

Sycrosity commented 1 month ago

I tracked the issue to an older esp-backtrace line 95 (as stated in your error message), which seems to have a tag for nightly versions before or after a certain date - I would assume its related to this in some way?

Sycrosity commented 1 month ago

I believe the issue was down to me not updating esp-backtrace yet, which has now been done - this should no longer be an issue. (fixed by #19 )

lijiachang commented 1 month ago

coool, use your latest code , there is no errors for me, Thanks @Sycrosity 🤠

Sycrosity commented 1 month ago

Thanks for the issue!