Running into an issue bringing wasmedge

Running into an issue bringing wasmedge_quickjs into a worker, hoping someone with more rust experience with workers can help!
3 Replies
DanTheGoodman
DanTheGoodman2y ago
error[E0412]: cannot find type `c_uchar` in crate `libc`
--> /Users/dangoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmedge_wasi_socket-0.1.0/src/lib.rs:8:25
|
8 | pub buf: *mut libc::c_uchar,
| ^^^^^^^ not found in `libc`
|
help: consider importing one of these items
|
1 | use core::ffi::c_uchar;
|
1 | use std::ffi::c_uchar;
|
1 | use std::os::raw::c_uchar;
|
help: if you import `c_uchar`, refer to it directly
|
8 - pub buf: *mut libc::c_uchar,
8 + pub buf: *mut c_uchar,
|
error[E0412]: cannot find type `c_uchar` in crate `libc`
--> /Users/dangoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmedge_wasi_socket-0.1.0/src/lib.rs:8:25
|
8 | pub buf: *mut libc::c_uchar,
| ^^^^^^^ not found in `libc`
|
help: consider importing one of these items
|
1 | use core::ffi::c_uchar;
|
1 | use std::ffi::c_uchar;
|
1 | use std::os::raw::c_uchar;
|
help: if you import `c_uchar`, refer to it directly
|
8 - pub buf: *mut libc::c_uchar,
8 + pub buf: *mut c_uchar,
|
error[E0412]: cannot find type `c_uchar` in crate `libc`
--> /Users/dangoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmedge_wasi_socket-0.1.0/src/lib.rs:12:27
|
12 | pub buf: *const libc::c_uchar,
| ^^^^^^^ not found in `libc`
|
help: consider importing one of these items
|
1 | use core::ffi::c_uchar;
|
1 | use std::ffi::c_uchar;
|
1 | use std::os::raw::c_uchar;
|
help: if you import `c_uchar`, refer to it directly
|
12 - pub buf: *const libc::c_uchar,
12 + pub buf: *const c_uchar,
|

error[E0412]: cannot find type `c_uchar` in crate `libc`
--> /Users/dangoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmedge_wasi_socket-0.1.0/src/lib.rs:16:27
|
16 | pub buf: *const libc::c_uchar,
| ^^^^^^^ not found in `libc`
|
help: consider importing one of these items
|
1 | use core::ffi::c_uchar;
|
1 | use std::ffi::c_uchar;
|
1 | use std::os::raw::c_uchar;
|
help: if you import `c_uchar`, refer to it directly
|
16 - pub buf: *const libc::c_uchar,
16 + pub buf: *const c_uchar,
|

For more information about this error, try `rustc --explain E0412`.
error: could not compile `wasmedge_wasi_socket` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"
Error: wasm-pack exited with status exit status: 1
error[E0412]: cannot find type `c_uchar` in crate `libc`
--> /Users/dangoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmedge_wasi_socket-0.1.0/src/lib.rs:12:27
|
12 | pub buf: *const libc::c_uchar,
| ^^^^^^^ not found in `libc`
|
help: consider importing one of these items
|
1 | use core::ffi::c_uchar;
|
1 | use std::ffi::c_uchar;
|
1 | use std::os::raw::c_uchar;
|
help: if you import `c_uchar`, refer to it directly
|
12 - pub buf: *const libc::c_uchar,
12 + pub buf: *const c_uchar,
|

error[E0412]: cannot find type `c_uchar` in crate `libc`
--> /Users/dangoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmedge_wasi_socket-0.1.0/src/lib.rs:16:27
|
16 | pub buf: *const libc::c_uchar,
| ^^^^^^^ not found in `libc`
|
help: consider importing one of these items
|
1 | use core::ffi::c_uchar;
|
1 | use std::ffi::c_uchar;
|
1 | use std::os::raw::c_uchar;
|
help: if you import `c_uchar`, refer to it directly
|
16 - pub buf: *const libc::c_uchar,
16 + pub buf: *const c_uchar,
|

For more information about this error, try `rustc --explain E0412`.
error: could not compile `wasmedge_wasi_socket` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"
Error: wasm-pack exited with status exit status: 1
DanTheGoodman
DanTheGoodman2y ago
I think it's because wrangler uses the wasm32-unknown-unknown target where as the docs for wasmedge uses wasm32-wasi https://wasmedge.org/book/en/write_wasm/js/rust.html
DanTheGoodman
DanTheGoodman2y ago
But not sure, very very new to rust. This happens when putting wasmedge_quickjs in the cargo.toml wasmedge_quickjs = "0.2.0"