feat(deps): support both embassy-executor 0.9.x and 0.10.x#80
feat(deps): support both embassy-executor 0.9.x and 0.10.x#80t-moe merged 2 commits intoprobe-rs:masterfrom
Conversation
|
|
||
| let spawn_invoker = if cfg!(feature = "embassy09") { | ||
| quote!( spawn(#ident_invoker()).unwrap() ) | ||
| } else if cfg!(feature = "embassy010") { |
There was a problem hiding this comment.
Maybe make this the else case.
| } | ||
| ); | ||
|
|
||
| let spawn_invoker = if cfg!(feature = "embassy09") { |
There was a problem hiding this comment.
This is basically #79 but supporting both executors.
| @@ -21,7 +21,8 @@ darling = "0.21.1" | |||
|
|
|||
| [features] | |||
| embassy = [] | |||
There was a problem hiding this comment.
Here embassy means "any embassy executor".
| # Enables async test and init functions using embassy-executor. | ||
| # Note: You need to enable at least one executor feature on embassy unless you are using the `external-executor` feature | ||
| embassy = ["embedded-test-macros/embassy", "dep:embassy-executor"] | ||
| embassy = ["embassy09"] |
There was a problem hiding this comment.
Here,
embassyjust selectsembassy09for backwards compatibility.embassy-anytoggles code where the executor version doesn't matter
Happy to bikeshed this, maybe _embassy? It is only used internally.
There was a problem hiding this comment.
A semver breaking embedded-test version could also change the executor version that embassy points to. (e.g., e-t 0.9 could make embassy select embassy010, to make the then-current e-e version the default).
src/export.rs
Outdated
|
|
||
| // Reexport the embassy stuff | ||
| #[cfg(all(feature = "embassy", not(feature = "ariel-os")))] | ||
| #[cfg(all(feature = "embassy-any", not(feature = "ariel-os")))] |
There was a problem hiding this comment.
This is now checking for embassy-any as plain embassy is used for backwards-compatibly selecting embassy-09. See below.
|
Yes it was late, of course I need to dispatch from |
b504e08 to
dc530e2
Compare
|
(need to fix ariel-os case still) |
Signed-off-by: Kaspar Schleiser <kaspar@schleiser.de>
done. The clippy error is unrelated, there's a fix in #81. |
|
I'm test-driving this PR in esp-rs/esp-hal#5249, a first-pass local test went just fine :) |
|
Thanks for the PR. |
|
@kaspar030 @bugadani Can you migrate and provide feedback in case I broke something ;) ? |
Yes you renamed the feature flags and I wasn't paying attention 🙃 Update: 0.7.1 looks good, thanks! |
This adds Cargo features for switching between
embassy-executor 0.9.xand0.10.x, as discussed in #71.I tried to make this backwards compatible (the
embassyfeature selectsembassy09).(Includes #79)