-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1/x] feature(cargo-miden): support building Wasm component from a Cargo project #329
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a9e4fcc
to
a876d8b
Compare
6dfa67a
to
58b8dcf
Compare
58b8dcf
to
02f855d
Compare
change module and function names for core Wasm module imports for stdlib and tx kernel.
6a1ba88
to
45df95c
Compare
SDK functions that were renamed to satisfy the Wasm Component Model requirements and remove Wasm component imports for the intrinsics that were converted to IR ops.
45df95c
to
2a83384
Compare
574e01e
to
e1796ab
Compare
e1796ab
to
97b92ae
Compare
2802aa7
to
787f4e3
Compare
Build MASM for the basic wallet Rust SDK test.
787f4e3
to
6a59e3d
Compare
Just wanted to follow up and let you know I've started reviewing, but haven't finished just yet, I'll try to get my review wrapped up today (Tuesday). |
I forgot to address the provisioning of the WIT interface for the Miden SDK. I made #343 for it. |
bitwalker
approved these changes
Oct 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #90
Close #117
Close #308
Close #334
This PR adds support to the
cargo-miden
to usecargo-component
library to build Wasm component Rust projects. The existingcargo-miden
ability to build core Wasm module Rust projects is preserved.The Miden SDK and intrinsics are pulled through the Wasm CM as an imported interface (see
miden-core-import.wit
). The Miden SDK types are defined in WIT (seemiden.wit
) and remapped to themiden-sdk
crate types atcargo-component
library invocation incargo-miden
along with the skip list for function bindings generation atcompiler/tools/cargo-miden/src/lib.rs
Lines 175 to 203 in fe28b1c
Then, when translating Wasm component the original(linkable) MASM module and function names are recovered at the core Wasm module and the component level by https://github.com/0xPolygonMiden/compiler/blob/fe28b1cffef6a15b02f8e86fadce9c14263281cb/frontend-wasm/src/miden_abi/mod.rs#L61-L111
See
test/rust-apps-wasm/rust-sdk/basic-wallet/
test project for an example andrust_sdk_basic_wallet()
test.To not grow this PR any bigger, #341 and #342 are created to fix the introduced quick-and-dirty ways for function generation skipping and MASM module and function names recovery.