Compile rust code with lind-wasm and enable shared memory#577
Compile rust code with lind-wasm and enable shared memory#577rennergade merged 4 commits intomainfrom
Conversation
|
Code looks good. @yzhang71 needs a doc with at least the cargo command |
End-to-End Test ReportTest PreviewTest Report Deterministic TestsSummary
Test Results by Category
Non Deterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Yes, I will do another PR to update docs/contributing/compiling-with-rust.md |
Would love to just have it with this one. |
Got it. I will update it now. |
End-to-End Test ReportTest PreviewTest Report Deterministic TestsSummary
Test Results by Category
Non Deterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docs/contribute/compile-with-rust.md
Outdated
| * Avoids linker errors such as: | ||
|
|
||
| ``` | ||
| --shared-memory is disallowed because std was not compiled with atomics |
docs/contribute/compile-with-rust.md
Outdated
| --shared-memory is disallowed because std was not compiled with atomics | ||
| ``` | ||
|
|
||
| > ⚠️ This requires a **nightly toolchain**, which you already have. |
There was a problem hiding this comment.
just state requires nightly, doesnt need "which you already have".
End-to-End Test ReportTest PreviewTest Report Deterministic TestsSummary
Test Results by Category
Non Deterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stupendoussuperpowers
left a comment
There was a problem hiding this comment.
Added a few minor comments, rest of it looks good!
docs/contribute/compile-with-rust.md
Outdated
| * Forces Rust to rebuild `std` for `wasm32-wasip1` | ||
| * Applies your `rustflags` to `std` itself | ||
| * Enables atomics + bulk-memory inside `libstd` | ||
| * Requires a nightly Rust toolchain (because `-Z build-std` is a nightly-only feature) No newline at end of file |
There was a problem hiding this comment.
Nit: Maybe this can be step 0 in the docs to say that we need rustup nightly.
| After configuring Cargo, compile your Rust project using **nightly** and rebuild the standard library: | ||
|
|
||
| ```bash | ||
| cargo build -Z build-std=std,panic_abort |
There was a problem hiding this comment.
Nit:
Adding this in the .cargo/config.toml also does the same, and is perhaps easier to not miss during build
[unstable]
build-std = ["std", "panic_abort"]
002b73d
End-to-End Test ReportTest PreviewTest Report Deterministic TestsSummary
Test Results by Category
Non Deterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Add: Compile rust code with lind-wasm and enable shared memory * Add: steps to compile rust with lind-wasm * Mod: steps to compile rust with lind-wasm * Mod: steps to compile rust with lind-wasm
* Add: Compile rust code with lind-wasm and enable shared memory * Add: steps to compile rust with lind-wasm * Mod: steps to compile rust with lind-wasm * Mod: steps to compile rust with lind-wasm
PURPOSE
This PR introduces initial support for compiling Rust programs into Lind-WASM, allowing Rust source code to be built into WebAssembly modules that run correctly within the Lind runtime environment. The goal is to extend Lind’s existing C toolchain so that Rust developers can write, compile, and execute programs using the same infrastructure and conventions used by other Lind-supported languages.
This work includes:
rustc/ Cargo targetingwasm32-wasi)RELATED ISSUE
Fixes: lind-wasm #422
"Compile Rust code into Lind WASM"
This PR implements the functionality, providing a working pipeline to compile and run Rust programs in Lind.