Skip to content

Conversation

cataggar
Copy link
Member

@cataggar cataggar commented Sep 7, 2025

This is an experiment to make targeting wasi32-wasip2 possible. I think the exciting breakthrough will be when wasi32-wasip3 lands with composable concurrency. https://www.fermyon.com/blog/looking-ahead-to-wasip3

Introduces an optional spin feature to enable a Spin-based async runtime and HTTP client when targeting wasm32-wasip2, allowing clients to run in Spin environments.

Wires runtime selection to use Spin on wasm with the feature enabled and falls back to existing backends otherwise. Adds workspace dependencies, updates the changelog, and provides VS Code tasks to build the WASI p2 target with Spin.

Note: sleep in the Spin runtime is currently a no-op pending stable WASI timing APIs.
- Limits spin dependencies and HTTP client/runtime to wasm32-wasip2 and selects them on WASI.
- Excludes reqwest on wasm32-wasip2 while keeping it on other targets.
- Auto-enables the spin feature via target-specific dependency in the core crate.
- Improves target correctness, avoids incompatible deps, and reduces WASI build surface.
@github-actions github-actions bot added the Azure.Core The azure_core crate label Sep 7, 2025
Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

I appreciate this is a draft, but I did want to note that we want to avoid adding more "parity features" or even specific implementations to the Azure SDK crates for the same reason: we provide the means to implement HttpClient and AsyncRuntime like you did, but don't want to get into the business of providing countless implementations in the crates for the currently most popular crates. This was the purpose of #2933.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core The azure_core crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants