esp-rs / embedded-svc

Rust APIs and abstractions for various embedded services (WiFi, Network, Httpd, Logging, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue compiling with 0.20.2

AngelOnFira opened this issue · comments

I'm not sure if this is the right place, but I'm working on the ESP channel, and compiling 0.20.2 doesn't work, while 0.19.1 seems to be fine.

Let me know if there is anything else I can do to diagnose anything!

    Checking crossbeam-utils v0.8.8
   Compiling gbplay-rs v0.1.0 (/workspaces/gbplay/esp/gbplay-rs)
error[E0432]: unresolved imports `core::sync::atomic::AtomicI64`, `core::sync::atomic::AtomicU64`
  --> /opt/cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.8/src/lib.rs:79:49
   |
79 |             pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64};
   |                                                 ^^^^^^^^^  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
   |                                                 |
   |                                                 no `AtomicI64` in `sync::atomic`
   |
help: a similar name exists in the module
   |
79 |             pub(crate) use core::sync::atomic::{AtomicI8, AtomicU64};
   |                                                 ~~~~~~~~
help: a similar name exists in the module
   |
79 |             pub(crate) use core::sync::atomic::{AtomicI64, AtomicU8};
   |                                                            ~~~~~~~~

error[E0412]: cannot find type `AtomicU64` in module `core::sync::atomic`
    --> /opt/cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.8/src/atomic/consume.rs:78:14
     |
78   |   impl_atomic!(AtomicU64, u64);
     |                ^^^^^^^^^ help: a struct with a similar name exists: `AtomicU16`
     |
    ::: /opt/rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2148:1
     |
2148 | / atomic_int! {
2149 | |     cfg(target_has_atomic = "16"),
2150 | |     cfg(target_has_atomic_equal_alignment = "16"),
2151 | |     stable(feature = "integer_atomics_stable", since = "1.34.0"),
...    |
2164 | |     u16 AtomicU16 ATOMIC_U16_INIT
2165 | | }
     | |_- similarly named struct `AtomicU16` defined here

error[E0412]: cannot find type `AtomicI64` in module `core::sync::atomic`
    --> /opt/cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.8/src/atomic/consume.rs:80:14
     |
80   |   impl_atomic!(AtomicI64, i64);
     |                ^^^^^^^^^ help: a struct with a similar name exists: `AtomicI16`
     |
    ::: /opt/rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2129:1
     |
2129 | / atomic_int! {
2130 | |     cfg(target_has_atomic = "16"),
2131 | |     cfg(target_has_atomic_equal_alignment = "16"),
2132 | |     stable(feature = "integer_atomics_stable", since = "1.34.0"),
...    |
2145 | |     i16 AtomicI16 ATOMIC_I16_INIT
2146 | | }
     | |_- similarly named struct `AtomicI16` defined here

Some errors have detailed explanations: E0412, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `crossbeam-utils` due to 3 previous errors
[Finished running. Exit status: 101]

This is the right place. Here's some extra info that can help:

  • What is the version of your compiler? Recent esp-rs compilers do support AtomicU64, earlier ones don't.
  • What is the chip you are compiling for? RiscV or ESP32*?
  • Are you having the isr-async-executor feature enabled? In theory, the crossbeam dependency should be part of the build only if this feature is enabled. By the way, this feature (and the 0.20.2 release) is brand hot new (from today); note that if you enable this feature, it will enable a bunch of other experimental features as well.

I'm using Esppressif's Docker image espressif/idf-rust-examples, and it comes with the esp target/toolchain preinstalled. How can I gather more information about the environment?

root@a90d7c5a54b1:/workspaces/gbplay/esp/gbplay-rs# rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.58.0-dev`

I'm compiling for ESP32* (specifically ESP-WROOM-32 Chip CP2102 for ESP32 according to the Amazon page.

As far as I know, I don't have isr-async-executor feature enabled. I'm just using cargo check on this Cargo.toml:

[package]
name = "gbplay-rs"
version = "0.1.0"
authors = ["Forest Anderson <forestkzanderson@gmail.com>"]
edition = "2018"
resolver = "2"

[patch.crates-io]
smol = { git = "https://github.com/esp-rs-compat/smol" }
polling = { git = "https://github.com/esp-rs-compat/polling" }
socket2 = { git = "https://github.com/esp-rs-compat/socket2" }
getrandom = { version = "0.2", git = "https://github.com/esp-rs-compat/getrandom.git" }

[profile.release]
opt-level = "s"

[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
pio = ["esp-idf-sys/pio"]

[dependencies]
esp-idf-sys = { version = "0.31.0", features = ["binstart"] }
esp-idf-svc = "0.39.2"
esp-idf-hal = "0.35.2"
embedded-svc = "0.19.1"
# tiny_http = "0.11"
anyhow = {version = "1", features = ["backtrace"]}
log = "0.4"
url = "2"
embedded-hal = "0.2"
embedded-graphics = "0.7"
display-interface = "0.4"
display-interface-spi = "0.4"
st7789 = "0.6"
ili9341 = { version = "0.5", git = "https://github.com/yuri91/ili9341-rs" }
ssd1306 = "0.7"
epd-waveshare = "0.5.0"
smol = "1.2"

[build-dependencies]
embuild = "0.28"
anyhow = "1"

Argh, I've accidentally left alloc enabling crossbeam: f794828

I'll release 0.20.3 shortly and yank the 0.20.2 one. Today is not my day for releasing. This would be the third yanked 0.20 release in 5 hours. :)

😄 no worries! Thanks for your quick responses, and looking into the issue already. As I'm diving deeper into embedded Rust, I'm finding more and more with your name on it, so I greatly appreciate your work in the ecosystem :) Thanks!

Released. If you could try the build again. You might have to remove manually the 0.20.2 release somehow from your machine, so that it picks up the 0.20.3. Please don't change anything else and just let me know whether it now compiles cleanly.

Awesome! 👍 as far as I can tell, that not only let me push embedded-svc's version, but also esp-idf-svc and esp-idf-hal. Looks like we're good :)