You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[package]
name = "rust_write"
version = "0.1.0"
edition ="2018"
[lib]
crate-type = ["cdylib"]
I am using rustc 1.51.0-nightly, and I compiled the file with this command cargo build --target wasm32-wasi.
The Wa. module will not work either with wasmtime CLI ( wasmtime --dir=. --invoke hello rust_write.wasm ) or embedded, however if I remove the crate-type = ["cdylib"] from cargo.toml and write the exact same hello function as a main function in ````src/main.rs```, then it works without problems.
Could it be that the issue is that _start is not called when you directly --invoke the hello function.
Am I intended to not be able to access files if I am using a WASI library, or is it a bug?
Am I just straight up doing something wrong when I compile?
The text was updated successfully, but these errors were encountered:
AndreaEsposit
changed the title
Rust and Wasm problems with file access.
Rust and Wasm problems when trying to access a file
Feb 3, 2021
I have been trying to create/read/edit a file though a WebAssembly module originally written in Rust, but it is not working.
The code looks like this(src/lib.rs):
This is my cargo.toml:
I am using rustc 1.51.0-nightly, and I compiled the file with this command
cargo build --target wasm32-wasi
.The Wa. module will not work either with wasmtime CLI (
wasmtime --dir=. --invoke hello rust_write.wasm
) or embedded, however if I remove thecrate-type = ["cdylib"]
fromcargo.toml
and write the exact same hello function as a main function in ````src/main.rs```, then it works without problems.Could it be that the issue is that
_start
is not called when you directly --invoke the hello function.Am I intended to not be able to access files if I am using a WASI library, or is it a bug?
Am I just straight up doing something wrong when I compile?
The text was updated successfully, but these errors were encountered: