Skip to content

feat(deps): support both embassy-executor 0.9.x and 0.10.x#80

Merged
t-moe merged 2 commits intoprobe-rs:masterfrom
kaspar030:ee-features
Mar 27, 2026
Merged

feat(deps): support both embassy-executor 0.9.x and 0.10.x#80
t-moe merged 2 commits intoprobe-rs:masterfrom
kaspar030:ee-features

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

This adds Cargo features for switching between embassy-executor 0.9.x and 0.10.x, as discussed in #71.

I tried to make this backwards compatible (the embassy feature selects embassy09).

(Includes #79)


let spawn_invoker = if cfg!(feature = "embassy09") {
quote!( spawn(#ident_invoker()).unwrap() )
} else if cfg!(feature = "embassy010") {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this the else case.

}
);

let spawn_invoker = if cfg!(feature = "embassy09") {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically #79 but supporting both executors.

@@ -21,7 +21,8 @@ darling = "0.21.1"

[features]
embassy = []
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here,

  • embassy just selects embassy09 for backwards compatibility.
  • embassy-any toggles code where the executor version doesn't matter

Happy to bikeshed this, maybe _embassy? It is only used internally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")))]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now checking for embassy-any as plain embassy is used for backwards-compatibly selecting embassy-09. See below.

@kaspar030
Copy link
Copy Markdown
Contributor Author

kaspar030 commented Mar 24, 2026

I can reproduce the ci errors. Somehow the pub use embassy_executor:... don't pick up the crate even though it is renamed using Cargo's package field.. Changing to e.g., embassy_executor_09 works, so the dependency is actually selected. :/ Getting late, will take another look tomorrow.

Yes it was late, of course I need to dispatch from e_e_09 and e_e_010 to just e_e again in rust code.

@kaspar030 kaspar030 force-pushed the ee-features branch 2 times, most recently from b504e08 to dc530e2 Compare March 25, 2026 06:05
@kaspar030 kaspar030 marked this pull request as ready for review March 25, 2026 06:06
@kaspar030 kaspar030 marked this pull request as draft March 25, 2026 06:21
@kaspar030
Copy link
Copy Markdown
Contributor Author

(need to fix ariel-os case still)

Signed-off-by: Kaspar Schleiser <kaspar@schleiser.de>
@kaspar030 kaspar030 marked this pull request as ready for review March 25, 2026 13:31
@kaspar030
Copy link
Copy Markdown
Contributor Author

(need to fix ariel-os case still)

done. The clippy error is unrelated, there's a fix in #81.

@bugadani
Copy link
Copy Markdown
Contributor

I'm test-driving this PR in esp-rs/esp-hal#5249, a first-pass local test went just fine :)

@t-moe
Copy link
Copy Markdown
Contributor

t-moe commented Mar 26, 2026

Thanks for the PR.
I can hopefully review, merge & release tomorrow

@t-moe t-moe merged commit d18fd7a into probe-rs:master Mar 27, 2026
14 checks passed
@t-moe
Copy link
Copy Markdown
Contributor

t-moe commented Mar 27, 2026

@kaspar030
Thanks for your work.
I've renamed some of the feature flags (embassy-09 instead of embassy09 etc), but otherwise published this as 0.7.1.
In the next breaking release I will probably remove the features kept for backwards compatibility (embassy and ariel-os),...

@bugadani Can you migrate and provide feedback in case I broke something ;) ?

@bugadani
Copy link
Copy Markdown
Contributor

bugadani commented Mar 27, 2026

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants