Rust SDK on crates.io and support of wasm

Hi Team, we have a use case to decode temporal grpc requests to extract namespace in rust for which we would need proto files. We see that temporal-sdk-core is alpha and last updated 3 years ago and on README of temporal sdk core repo we see there are no plans to productionize it. Can you guide us what is the better way to get proto files to use in rust code.

Also we want to do it for wasm, when we try to directly use it or by adding it as submodule to use “sdk-core-protos”, we are getting below error for tokio feature dependency, is wasm compilation supported for temporal?

66.04 error: Only features sync,macros,io-util,rt,time are supported on wasm.
66.04 → /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/lib.rs:467:1
66.04 |
66.05 467 | compile_error!(“Only features sync,macros,io-util,rt,time are supported on wasm.”);
66.05 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 Like

You may be better off using prost/tonic yourself against the protos from the api repo similar to how the sdk-core-protos crate does or how you’d do this in any other language Temporal does not have an SDK for. The sdk-core repo has no stability guarantees and is unlikely to be versioned and published on its own. When Temporal develops a Rust SDK, it will likely be versioned and published with models for the protos similar to other SDKs.

@Pavithra_M

There’s no explicit support for compiling to WASM, and compiling temporal-sdk-core-protos targeting it is unlikely to work because it contains an entire generated client: sdk-core/sdk-core-protos/build.rs at 32191cf461c662e19801fc494b6c0433613968ee · temporalio/sdk-core · GitHub

If you are interested in submitting a PR to make the building of the client selective, which should be relatively simple, as well as whatever else needs to happen to make it able to build to WASM put behind feature flags, etc. I’d be happy to accept that PR.

2 Likes