-
Notifications
You must be signed in to change notification settings - Fork 758
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
Why I was getting "Incompatible("The provided bytes are not wasmer-universal")" Err #3082
Comments
loading module using new() gives error
|
Is there any inbuilt compiler to build rust code instead of wasm text ? Yes, I was following examples in the repo. But all those are restricted to raw wat, which most don't write by bear hand. We should include other lang examples, at least rust example as engine is written in rust. I was following this example's code snippet to import my module https://github.com/wasmerio/wasmer/blob/master/examples/engine_headless.rs |
But,
now gives
See the attached wat file and wasm file |
Consider sharing your working branch, if related assigned changes is started. and what do you think about the error
I see that those declarations are from wasm_bindgen generated binary, but are these gen libraries half baked ? |
I do had an alternative impl, which is use std::ffi::{c_char, CString};
use std::path::PathBuf;
#[no_mangle]
pub extern "C" fn use_block_storage() -> bool {
true
}
#[no_mangle]
pub extern "C" fn get_block_storage_path(data_path: *const c_char) -> *const c_char {
let data_path = unsafe { CString::from_raw(data_path as *mut _) };
let data_path = PathBuf::from(data_path.to_str().unwrap());
let path = data_path.join("blockstorage").display().to_string();
let path = CString::new(path).unwrap();
path.as_ptr()
}
#[no_mangle]
pub extern "C" fn get_block_file_path(
data_path: *const c_char,
block_id: *const c_char,
) -> *const c_char {
let data_path = unsafe { CString::from_raw(data_path as *mut _) };
let data_path = PathBuf::from(data_path.to_str().unwrap());
let block_id = unsafe { CString::from_raw(block_id as *mut _) };
let path = data_path
.join("blockstorage")
.join(block_id.to_str().unwrap())
.display()
.to_string();
let path = CString::new(path).unwrap();
path.as_ptr()
} which works, but all those attr should be manually added to fns. I see a fork of wit-bindgen here https://github.com/wasmerio/wit-bindgen error[E0599]: no method named `data_unchecked` found for reference `&wasmer::Memory` in the current scope
--> C:\Users\PramUkesh\.cargo\git\checkouts\wit-bindgen-828ec3d74a4dee1a\75c0c14\crates\wasmer\src\lib.rs:122:18
|
122 | .data_unchecked(store)
| ^^^^^^^^^^^^^^ method not found in `&wasmer::Memory`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `wit-bindgen-wasmer` due to previous error |
Yeah, our fork should be fully usable! The issue that we are seeing is that we are precompiling the Wasm module in the server (using Cross-compilation and deserialization works only when the same "wasmer" API is used (as commented, Closing the issue! |
Summary
I was testing wasmer to run rust lib compiled to wasm.
Additional details
using
i got lib.wasm
Trying to load wasm file with wasmer
crate
Error:
The text was updated successfully, but these errors were encountered: