Skip to content

embed-rust bindgen - #107

Merged
dOrgJelli merged 11 commits into
mainfrom
kris/embed-rust
Oct 2, 2023
Merged

embed-rust bindgen#107
dOrgJelli merged 11 commits into
mainfrom
kris/embed-rust

Conversation

@krisbitney

@krisbitney krisbitney commented Sep 8, 2023

Copy link
Copy Markdown
Contributor

This PR adds a new interface embed-bindgen and a Rust implementation. The implementations are expected to be called from wrap-abi-bindgen app binding implementations as an optional way to add embedded Wasm wraps to generated types. This PR adds only the Rust implementation, along with modifications to the app-rust bindings wrap to add support for embeds.

The rust-embed-bindgen wrap was e2e tested locally, using the app/rust template in the CLI repo, to ensure correct Rust syntax.

use wrap::embeds;

let mut config = PolywrapClientConfig::new();
config.add_packages(embeds::packages());

PolywrapClient::new(config.into())

Questions

The CI is not currently passing because the wraps were set to depend on wrapscan URIs. I can't upload to wrapscan. Should I use IPFS URIs for now?

Also, I did not add embedded serialized compiled Wasm modules. For that, I think we need a Rust client plugin that performs compilation and serialization.

See also

The Polywrap CLI has also been updated to add a --embed option to the codegen command: polywrap/wrap-cli#1893

Also see polywrap/wrap-cli#1703

@dOrgJelli dOrgJelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we avoid making a whole new set of wraps for this, and instead just add this as a feature within the existing abi-bindgen wraps?

@krisbitney

Copy link
Copy Markdown
Contributor Author

Can we avoid making a whole new set of wraps for this, and instead just add this as a feature within the existing abi-bindgen wraps?

Yes, I'll make the changes tomorrow

@dOrgJelli
dOrgJelli merged commit f86234c into main Oct 2, 2023
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.

2 participants