embedded-test icon indicating copy to clipboard operation
embedded-test copied to clipboard

Missing executor with feature embassy

Open KorribanMaster opened this issue 1 year ago • 9 comments

Description

embedded_test fails to compile with the following error message

    /home/hechte/git/eeprom24x-rs
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
   Compiling embedded-test v0.4.0 (https://github.com/probe-rs/embedded-test.git?rev=784f62c34f87b52de221b6ab6c8390a5655fdaa4#784f62c3)
   Compiling embedded-test-macros v0.5.0 (https://github.com/probe-rs/embedded-test.git?rev=784f62c34f87b52de221b6ab6c8390a5655fdaa4#784f62c3)
error[E0432]: unresolved import `embassy_executor::Executor`
  --> /home/hechte/.cargo/git/checkouts/embedded-test-f175ea47b6323482/784f62c/src/export.rs:21:9
   |
21 | pub use embassy_executor::Executor; // Please activate the `executor-thread` or `executor-interrupt` feature on the embassy-executor crate (v0.5.x/v0.6.x)!
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Executor` in the root
   |
help: consider importing this struct instead
   |
21 | pub use embassy_executor::raw::Executor; // Please activate the `executor-thread` or `executor-interrupt` feature on the embassy-executor crate (v0.5.x/v0.6.x)!
   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0432`.
error: could not compile `embedded-test` (lib) due to 1 previous error

Although I have enabled an executor in my Cargo.toml Here is the relevant snippets from the Cargo.toml. Please note that i already patched embedded test to allow using executor v0.6

[package]
edition = "2021"
name = "pn"
version = "0.1.0"
license = "MIT OR Apache-2.0"

[[bin]]
name = "pn"
test = false
bench = false

[lib]
harness = false

[dependencies]
embassy-stm32 = { version = "0.1.0", features = [ "defmt", "time-driver-any", "stm32g474rc", "memory-x", "unstable-pac", "exti"]  }
embassy-sync = { version = "0.6.0", features = ["defmt"] }
embassy-executor = { version = "0.6.0", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
embassy-usb = { version = "0.3.0", features = ["defmt"] }
embassy-futures = { version = "0.1.0"}
usbd-hid = "0.8.1"

defmt = "0.3"
defmt-rtt = "0.4"

cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7.0"
embedded-hal = "1.0.0"
embedded-can = { version = "0.4" }
panic-probe = { version = "0.3", features = ["print-defmt"] }
heapless = { version = "0.8", default-features = false }
static_cell = "2.0.0"
embedded-test = { version = "0.4.0", features = ["embassy", "defmt"] }

[dev-dependencies]
defmt-test = "0.3"
embedded-test = { version = "0.4.0", features = ["embassy", "defmt"] }

# cargo build/run
[profile.dev]
codegen-units = 1
debug = 2
debug-assertions = true # <-
incremental = false
opt-level = 'z'         # <-
overflow-checks = true  # <-

# cargo test
[profile.test]
codegen-units = 1
debug = 2
debug-assertions = true # <-
incremental = false
opt-level = 3           # <-
overflow-checks = true  # <-

# cargo build/run --release
[profile.release]
codegen-units = 1
debug = 2
debug-assertions = false # <-
incremental = false
lto = 'fat'
opt-level = 3            # <-
overflow-checks = false  # <-

# cargo test --release
[profile.bench]
codegen-units = 1
debug = 2
debug-assertions = false # <-
incremental = false
lto = 'fat'
opt-level = 3            # <-
overflow-checks = false  # <-

[patch.crates-io]
embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev="7648d42b7f23a2caad29ed6e16123b088ccdc8b5" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev="7648d42b7f23a2caad29ed6e16123b088ccdc8b5" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev="7648d42b7f23a2caad29ed6e16123b088ccdc8b5" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev="7648d42b7f23a2caad29ed6e16123b088ccdc8b5" }
embassy-usb = { git = "https://github.com/embassy-rs/embassy", rev="7648d42b7f23a2caad29ed6e16123b088ccdc8b5" }
embedded-test = { git = "https://github.com/probe-rs/embedded-test.git", rev="784f62c34f87b52de221b6ab6c8390a5655fdaa4" }

Can anyone explain why embedded_test does not pickup the executor_thread feature?

KorribanMaster avatar Oct 01 '24 12:10 KorribanMaster

Please try with the master branch of embedded-test.

(I havent made a release since merging https://github.com/probe-rs/embedded-test/pull/38 )

t-moe avatar Oct 01 '24 12:10 t-moe

Hey thanks for your super fast response i patched embedded-test but had no luck with it either. i updated my issue above accordingly

KorribanMaster avatar Oct 01 '24 12:10 KorribanMaster

this is strange. can you quickly also share the output of cargo tree to validate we're using the same embassy-executor crate in the entire tree?

t-moe avatar Oct 01 '24 12:10 t-moe

Hey it seems i have found the issue as i have imported the crate twice and set the rust linker flags in the config.toml instead of a build.rs file which apparently does not work

static_cell = "2.0.0"
embedded-test = { version = "0.4.0", features = ["embassy", "defmt"] }

[dev-dependencies]
defmt-test = "0.3"
embedded-test = { version = "0.4.0", features = ["embassy", "defmt"] }

However It seems I have run into issue #35 but will move to master of probe-rs

KorribanMaster avatar Oct 01 '24 14:10 KorribanMaster

Will close this issue

KorribanMaster avatar Oct 01 '24 14:10 KorribanMaster

Hey unfortunately after a reorganization of the code the issue came back so it seems I have not yet found the underlying cause. Thus I have made a small demo repository which can be used to replicate the issue https://github.com/KorribanMaster/embedded-test-issue-40 I have used cargo tree in this repository as you have suggested and i can see that embedded-test tries to bring along it's own version of embassy-executor (v0.5 instead of v0.6)

❯ cargo tree
self-tests v0.1.0 (/home/hechte/git/embedded-test-issue#40)
├── cortex-m v0.7.7
│   ├── bare-metal v0.2.5
│   │   [build-dependencies]
│   │   └── rustc_version v0.2.3
│   │       └── semver v0.9.0
│   │           └── semver-parser v0.7.0
│   ├── bitfield v0.13.2
│   ├── critical-section v1.1.3
│   ├── embedded-hal v0.2.7
│   │   ├── nb v0.1.3
│   │   │   └── nb v1.1.0
│   │   └── void v1.0.2
│   └── volatile-register v0.2.2
│       └── vcell v0.1.3
├── cortex-m-rt v0.7.3
│   └── cortex-m-rt-macros v0.7.0 (proc-macro)
│       ├── proc-macro2 v1.0.86
│       │   └── unicode-ident v1.0.13
│       ├── quote v1.0.37
│       │   └── proc-macro2 v1.0.86 (*)
│       └── syn v1.0.109
│           ├── proc-macro2 v1.0.86 (*)
│           ├── quote v1.0.37 (*)
│           └── unicode-ident v1.0.13
├── defmt v0.3.8
│   ├── bitflags v1.3.2
│   └── defmt-macros v0.3.9 (proc-macro)
│       ├── defmt-parser v0.3.4
│       │   └── thiserror v1.0.64
│       │       └── thiserror-impl v1.0.64 (proc-macro)
│       │           ├── proc-macro2 v1.0.86 (*)
│       │           ├── quote v1.0.37 (*)
│       │           └── syn v2.0.79
│       │               ├── proc-macro2 v1.0.86 (*)
│       │               ├── quote v1.0.37 (*)
│       │               └── unicode-ident v1.0.13
│       ├── proc-macro-error v1.0.4
│       │   ├── proc-macro-error-attr v1.0.4 (proc-macro)
│       │   │   ├── proc-macro2 v1.0.86 (*)
│       │   │   └── quote v1.0.37 (*)
│       │   │   [build-dependencies]
│       │   │   └── version_check v0.9.5
│       │   ├── proc-macro2 v1.0.86 (*)
│       │   ├── quote v1.0.37 (*)
│       │   └── syn v1.0.109 (*)
│       │   [build-dependencies]
│       │   └── version_check v0.9.5
│       ├── proc-macro2 v1.0.86 (*)
│       ├── quote v1.0.37 (*)
│       └── syn v2.0.79 (*)
├── defmt-rtt v0.4.1
│   ├── critical-section v1.1.3
│   └── defmt v0.3.8 (*)
├── defmt-test v0.3.2
│   ├── cortex-m-rt v0.7.3 (*)
│   ├── cortex-m-semihosting v0.5.0
│   │   └── cortex-m v0.7.7 (*)
│   ├── defmt v0.3.8 (*)
│   └── defmt-test-macros v0.3.1 (proc-macro)
│       ├── proc-macro2 v1.0.86 (*)
│       ├── quote v1.0.37 (*)
│       └── syn v2.0.79 (*)
├── embassy-executor v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   ├── cortex-m v0.7.7 (*)
│   ├── critical-section v1.1.3
│   ├── defmt v0.3.8 (*)
│   ├── document-features v0.2.10 (proc-macro)
│   │   └── litrs v0.4.1
│   ├── embassy-executor-macros v0.5.0 (proc-macro) (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── darling v0.20.10
│   │   │   ├── darling_core v0.20.10
│   │   │   │   ├── fnv v1.0.7
│   │   │   │   ├── ident_case v1.0.1
│   │   │   │   ├── proc-macro2 v1.0.86 (*)
│   │   │   │   ├── quote v1.0.37 (*)
│   │   │   │   ├── strsim v0.11.1
│   │   │   │   └── syn v2.0.79 (*)
│   │   │   └── darling_macro v0.20.10 (proc-macro)
│   │   │       ├── darling_core v0.20.10 (*)
│   │   │       ├── quote v1.0.37 (*)
│   │   │       └── syn v2.0.79 (*)
│   │   ├── proc-macro2 v1.0.86 (*)
│   │   ├── quote v1.0.37 (*)
│   │   └── syn v2.0.79 (*)
│   ├── embassy-time-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   └── document-features v0.2.10 (proc-macro) (*)
│   └── embassy-time-queue-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
├── embassy-futures v0.1.1
├── embassy-stm32 v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   ├── aligned v0.4.2
│   │   └── as-slice v0.2.1
│   │       └── stable_deref_trait v1.2.0
│   ├── bit_field v0.10.2
│   ├── bitflags v2.6.0
│   ├── block-device-driver v0.2.0
│   │   └── aligned v0.4.2 (*)
│   ├── cfg-if v1.0.0
│   ├── cortex-m v0.7.7 (*)
│   ├── cortex-m-rt v0.7.3 (*)
│   ├── critical-section v1.1.3
│   ├── defmt v0.3.8 (*)
│   ├── document-features v0.2.10 (proc-macro) (*)
│   ├── embassy-embedded-hal v0.2.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── defmt v0.3.8 (*)
│   │   ├── embassy-futures v0.1.1 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── embassy-sync v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   │   ├── cfg-if v1.0.0
│   │   │   ├── critical-section v1.1.3
│   │   │   ├── defmt v0.3.8 (*)
│   │   │   ├── embedded-io-async v0.6.1
│   │   │   │   ├── defmt v0.3.8 (*)
│   │   │   │   └── embedded-io v0.6.1
│   │   │   │       └── defmt v0.3.8 (*)
│   │   │   ├── futures-util v0.3.30
│   │   │   │   ├── futures-core v0.3.30
│   │   │   │   ├── futures-task v0.3.30
│   │   │   │   ├── pin-project-lite v0.2.14
│   │   │   │   └── pin-utils v0.1.0
│   │   │   └── heapless v0.8.0
│   │   │       ├── hash32 v0.3.1
│   │   │       │   └── byteorder v1.5.0
│   │   │       └── stable_deref_trait v1.2.0
│   │   ├── embassy-time v0.3.2 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   │   ├── cfg-if v1.0.0
│   │   │   ├── critical-section v1.1.3
│   │   │   ├── defmt v0.3.8 (*)
│   │   │   ├── document-features v0.2.10 (proc-macro) (*)
│   │   │   ├── embassy-time-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   │   │   ├── embassy-time-queue-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   │   ├── embedded-hal v0.2.7 (*)
│   │   │   ├── embedded-hal v1.0.0
│   │   │   ├── embedded-hal-async v1.0.0
│   │   │   │   └── embedded-hal v1.0.0
│   │   │   ├── futures-util v0.3.30 (*)
│   │   │   └── heapless v0.8.0 (*)
│   │   ├── embedded-hal v0.2.7 (*)
│   │   ├── embedded-hal v1.0.0
│   │   ├── embedded-hal-async v1.0.0 (*)
│   │   ├── embedded-storage v0.3.1
│   │   ├── embedded-storage-async v0.4.1
│   │   │   └── embedded-storage v0.3.1
│   │   └── nb v1.1.0
│   ├── embassy-futures v0.1.1 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   ├── embassy-hal-internal v0.2.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── cortex-m v0.7.7 (*)
│   │   ├── critical-section v1.1.3
│   │   ├── defmt v0.3.8 (*)
│   │   └── num-traits v0.2.19
│   │       [build-dependencies]
│   │       └── autocfg v1.4.0
│   ├── embassy-net-driver v0.2.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   └── defmt v0.3.8 (*)
│   ├── embassy-sync v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── embassy-time v0.3.2 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── embassy-time-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── embassy-usb-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   └── defmt v0.3.8 (*)
│   ├── embassy-usb-synopsys-otg v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── critical-section v1.1.3
│   │   ├── embassy-sync v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   │   └── embassy-usb-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── embedded-can v0.4.1
│   │   └── nb v1.1.0
│   ├── embedded-hal v0.2.7 (*)
│   ├── embedded-hal v1.0.0
│   ├── embedded-hal-async v1.0.0 (*)
│   ├── embedded-hal-nb v1.0.0
│   │   ├── embedded-hal v1.0.0
│   │   └── nb v1.1.0
│   ├── embedded-io v0.6.1 (*)
│   ├── embedded-io-async v0.6.1 (*)
│   ├── embedded-storage v0.3.1
│   ├── embedded-storage-async v0.4.1 (*)
│   ├── futures-util v0.3.30 (*)
│   ├── nb v1.1.0
│   ├── rand_core v0.6.4
│   ├── sdio-host v0.5.0
│   ├── static_assertions v1.1.0
│   ├── stm32-fmc v0.3.2
│   │   └── embedded-hal v0.2.7 (*)
│   ├── stm32-metapac v15.0.0 (https://github.com/embassy-rs/stm32-data-generated?tag=stm32-data-ad00827345b4b758b2453082809d6e3b634b5364#e4428351)
│   │   ├── cortex-m v0.7.7 (*)
│   │   └── cortex-m-rt v0.7.3 (*)
│   ├── vcell v0.1.3
│   └── volatile-register v0.2.2 (*)
│   [build-dependencies]
│   ├── proc-macro2 v1.0.86 (*)
│   ├── quote v1.0.37 (*)
│   └── stm32-metapac v15.0.0 (https://github.com/embassy-rs/stm32-data-generated?tag=stm32-data-ad00827345b4b758b2453082809d6e3b634b5364#e4428351)
│       ├── cortex-m v0.7.7
│       │   ├── bare-metal v0.2.5
│       │   │   [build-dependencies]
│       │   │   └── rustc_version v0.2.3 (*)
│       │   ├── bitfield v0.13.2
│       │   ├── embedded-hal v0.2.7
│       │   │   ├── nb v0.1.3
│       │   │   │   └── nb v1.1.0
│       │   │   └── void v1.0.2
│       │   └── volatile-register v0.2.2
│       │       └── vcell v0.1.3
│       └── cortex-m-rt v0.7.3
│           └── cortex-m-rt-macros v0.7.0 (proc-macro) (*)
├── embassy-sync v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
├── embassy-time v0.3.2 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
├── embassy-usb v0.3.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   ├── defmt v0.3.8 (*)
│   ├── embassy-futures v0.1.1 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   ├── embassy-net-driver-channel v0.3.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── embassy-futures v0.1.1 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b)
│   │   ├── embassy-net-driver v0.2.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   │   └── embassy-sync v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── embassy-sync v0.6.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── embassy-usb-driver v0.1.0 (https://github.com/embassy-rs/embassy?rev=7648d42b7f23a2caad29ed6e16123b088ccdc8b5#7648d42b) (*)
│   ├── heapless v0.8.0 (*)
│   ├── ssmarshal v1.0.0
│   │   ├── encode_unicode v0.3.6
│   │   └── serde v1.0.210
│   │       └── serde_derive v1.0.210 (proc-macro)
│   │           ├── proc-macro2 v1.0.86 (*)
│   │           ├── quote v1.0.37 (*)
│   │           └── syn v2.0.79 (*)
│   └── usbd-hid v0.8.2
│       ├── serde v1.0.210 (*)
│       ├── ssmarshal v1.0.0 (*)
│       ├── usb-device v0.3.2
│       │   ├── heapless v0.8.0 (*)
│       │   └── portable-atomic v1.9.0
│       └── usbd-hid-macros v0.8.2 (proc-macro)
│           ├── byteorder v1.5.0
│           ├── hashbrown v0.13.2
│           │   └── ahash v0.8.11
│           │       ├── cfg-if v1.0.0
│           │       ├── once_cell v1.20.1
│           │       └── zerocopy v0.7.35
│           │       [build-dependencies]
│           │       └── version_check v0.9.5
│           ├── log v0.4.22
│           ├── proc-macro2 v1.0.86 (*)
│           ├── quote v1.0.37 (*)
│           ├── serde v1.0.210
│           ├── syn v1.0.109 (*)
│           └── usbd-hid-descriptors v0.8.2
│               └── bitfield v0.14.0
├── embedded-hal v1.0.0
├── embedded-test v0.4.0 (https://github.com/probe-rs/embedded-test.git?rev=784f62c34f87b52de221b6ab6c8390a5655fdaa4#784f62c3)
│   ├── defmt v0.3.8 (*)
│   ├── embassy-executor v0.5.0
│   │   ├── critical-section v1.1.3
│   │   ├── document-features v0.2.10 (proc-macro) (*)
│   │   └── embassy-executor-macros v0.4.1 (proc-macro)
│   │       ├── darling v0.20.10 (*)
│   │       ├── proc-macro2 v1.0.86 (*)
│   │       ├── quote v1.0.37 (*)
│   │       └── syn v2.0.79 (*)
│   ├── embedded-test-macros v0.5.0 (proc-macro) (https://github.com/probe-rs/embedded-test.git?rev=784f62c34f87b52de221b6ab6c8390a5655fdaa4#784f62c3)
│   │   ├── darling v0.20.10 (*)
│   │   ├── proc-macro2 v1.0.86 (*)
│   │   ├── quote v1.0.37 (*)
│   │   └── syn v2.0.79 (*)
│   ├── heapless v0.8.0 (*)
│   ├── semihosting v0.1.15
│   ├── serde v1.0.210 (*)
│   └── serde-json-core v0.5.1
│       ├── heapless v0.7.17
│       │   ├── hash32 v0.2.1
│       │   │   └── byteorder v1.5.0
│       │   └── stable_deref_trait v1.2.0
│       │   [build-dependencies]
│       │   └── rustc_version v0.4.1
│       │       └── semver v1.0.23
│       ├── ryu v1.0.18
│       └── serde v1.0.210 (*)
├── heapless v0.8.0 (*)
├── panic-probe v0.3.2
│   ├── cortex-m v0.7.7 (*)
│   └── defmt v0.3.8 (*)
├── static_cell v2.1.0
│   └── portable-atomic v1.9.0
└── usbd-hid v0.8.2 (*)

KorribanMaster avatar Oct 02 '24 10:10 KorribanMaster

thanks for the reproducer. I'll tackle this soon.

t-moe avatar Oct 02 '24 11:10 t-moe

I have forked the repo and set embassy executor to v0.6 only and that solved the issue. Apparently setting a range for allowed external crates comes with a lot of issues in rust. The resolver might pick two different versions depending on your cached contents and many other variables so it is not advisable to rely on the resolver. In this specific case my suggestion would be to use feature flags like embassy-05 and embassy-06 to allow an explicit selection of the executor.

KorribanMaster avatar Oct 07 '24 07:10 KorribanMaster

sorry for the delay on my side (I'm a bit swamped with my day-job). But I'm glad you found a solution that works. I'll keep this issue open, until its fixed in this repo and released.

t-moe avatar Oct 07 '24 07:10 t-moe

Thanks for keeping me in the loop. I can live with my solution for a while so take your time

KorribanMaster avatar Oct 18 '24 11:10 KorribanMaster

@KorribanMaster your fork does not fix it for me.

Cargo.toml:

[dependencies]
defmt               = "=0.3.8"
defmt-rtt           = "=0.4.1"
static_cell         = "=2.1.0"
esp-alloc           = "=0.5.0"
embassy-sync        = { version = "=0.6.0" }
esp-hal-embassy     = { version = "=0.4.0",  features = ["esp32c3"] }
esp-hal             = { version = "=0.21.0", features = ["esp32c3"] }
esp-println         = { version = "=0.12.0", features = ["esp32c3", "log"] }
embassy-time        = { version = "=0.3.2",  features = ["generic-queue-8"] }
embassy-executor    = { version = "=0.6.0",  features = ["executor-thread", "defmt", "integrated-timers"] }
esp-wifi            = { version = "=0.10.1", features = ["esp32c3", "wifi", "wifi-default", "embassy-net"] }
esp-backtrace       = { version = "=0.14.2", features = ["esp32c3", "println", "exception-handler", "panic-handler"] }
embassy-net         = { version = "=0.4.0",  features = ["proto-ipv4", "tcp", "medium-ip", "medium-ethernet", "dhcpv4"] }

[dev-dependencies]
embedded-test = { git = "https://github.com/KorribanMaster/embedded-test.git", features = ["defmt", "embassy"] }

error:

21 | pub use embassy_executor::Executor; // Please activate the `executor-thread` or `executor-interrupt` feature on the embass...
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Executor` in the root
   |
help: consider importing this struct instead
   |
21 | pub use embassy_executor::raw::Executor; // Please activate the `executor-thread` or `executor-interrupt` feature on the embassy-executor crate (v0.5.x/v0.6.x)!
   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

omani avatar Oct 20 '24 02:10 omani

Ah, you might have to move embedded-test to dependencies. At least for me, this sometimes changed things while I was investigating

KorribanMaster avatar Oct 20 '24 07:10 KorribanMaster

tried that too. doesn't work.

omani avatar Oct 20 '24 13:10 omani

so I guess right now embedded-test is unusable with embassy. are you guys planning to fix this? @t-moe what is the status of this issue?

omani avatar Oct 20 '24 13:10 omani

ah now I get it: https://github.com/embassy-rs/embassy/blob/c9358e1f1e5d88aa0ad998c44eb2da6be73cf477/embassy-executor/src/lib.rs#L38C1-L38C64

one has to enable the arch feature. in my case (for an esp32c3) I need arch-riscv32:

embassy-executor    = { version = "=0.5.0",  features = ["arch-riscv32", "executor-thread", "defmt", "integrated-timers"] }

but notice how this only works with embassy-executor version 0.5.0. as soon as I switch to version 0.6.0 (which I need), it breaks again with the same error.

omani avatar Oct 20 '24 13:10 omani

considering your comment:

I have forked the repo and set embassy executor to v0.6 only and that solved the issue. Apparently setting a range for allowed external crates comes with a lot of issues in rust. The resolver might pick two different versions depending on your cached contents and many other variables so it is not advisable to rely on the resolver. In this specific case my suggestion would be to use feature flags like embassy-05 and embassy-06 to allow an explicit selection of the executor.

using your fork, with fixed version 0.6.0 doesn't work either.

so far, Im only able to use embassy-executor 0.5.0. and I dont quite understand what the difference here is (embassy-executor hasn't changed from 0.5.0 to 0.6.0 in this context). maybe it has something to do with the cache like you said.

omani avatar Oct 20 '24 14:10 omani

ok investigating further I made it work with version 0.6.0. @KorribanMaster you are funny man. why dont you tell us that your fork is not different from upstream?

ONE HAS TO PIN THE COMMIT REV IN CARGO.TOML to get your commit (fix 0.6.0 version in Cargo.toml):

embedded-test = { git = "https://github.com/KorribanMaster/embedded-test.git", rev = "3157a7f74ce886acbc751d7b505a6c651284efdc", features = ["defmt", "embassy"] }

to get https://github.com/KorribanMaster/embedded-test/commit/3157a7f74ce886acbc751d7b505a6c651284efdc

now everything works.

omani avatar Oct 20 '24 14:10 omani

to summarize:

  • you need to explicitly specify arch-riscv32 (or whatever arch you have) feature in embassy-executor to get access to the ::Executor trait in embassy
  • you need to pin embassy-executor to a version. a range does not work.

conclusion: a version range does not work because rust is doing weird things then. a fixed version works.

@t-moe I support @KorribanMaster's suggestion about different feature flags for different embassy-executor versions. see https://github.com/probe-rs/embedded-test/issues/40#issuecomment-2396077605

omani avatar Oct 20 '24 14:10 omani

Oh I guess I never thought someone else would use my fork. However, I always pin everything. I patch to a commit sha as this ensures stability and is generally considered good practice

KorribanMaster avatar Oct 20 '24 14:10 KorribanMaster

Oh I guess I never thought someone else would use my fork. However, I always pin everything. I patch to a commit sha as this ensures stability and is generally considered good practice

yeah Im just kidding. my bad for not checking out the commit :)

omani avatar Oct 20 '24 14:10 omani

everything works and Im happy now. you guys decide what you wanna do with this issue.

thanks everyone and thank you for this beautiful piece of software.

omani avatar Oct 20 '24 14:10 omani

Released to crates.io as 0.5.0. Hope this fixes your issues. Otherwise just comment again.

t-moe avatar Oct 21 '24 10:10 t-moe

Hi! I'm still seeing this issue when using the git version of embassy-executor: embassy-executor = { git = "https://github.com/embassy-rs/embassy", features = [ "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", ] } instead of embassy-executor = { version = "0.6.2", features = [ "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", ] } in my Cargo.toml. I would like to use the git version instead of the crates.io version if possible. It should be reproducible if you make this change in your own Cargo.toml

tullom avatar Nov 06 '24 16:11 tullom

.... I would like to use the git version instead of the crates.io version if possible....

When you override embassy-executor with a git dependency, cargo tree | grep embassy-executor will show two different versions being used . The fix is to add a patch section and keep the original embassy-executor dependency.

[dependencies]
embassy-executor = { version = "0.6.2", features = [ "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", ] }

[patch.crates.io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy" }

t-moe avatar Nov 06 '24 19:11 t-moe

Thank you!!! that fixed the issue. 😄

tullom avatar Nov 06 '24 19:11 tullom