Closed michael-0acf4 closed 9 months ago
Hmm, WasmEdge Bindgen is this one:
https://crates.io/crates/wasmedge-bindgen
Here is a tutorial:
Thanks for the reply, But I was refering to this package https://github.com/second-state/wasmedge-bindgen/blob/main/host/rust-sdk/Cargo.toml https://crates.io/crates/wasmedge-sdk-bindgen/0.4.0
Which seems to depend on wasmedge-sdk 0.4.0
I think this repo is out of sync with the wasmedge-sdk. There are some known issues here: #6 #7. @chenyukang @DarumaDocker Do we have any plan for updating the dependencies?
[josh@Joshuas-Mac-mini:~/proj/native/calljs]% ❯ cat Cargo.toml
[package]
name = "calljs"
version = "0.1.0"
authors = []
edition = "2021"
[lib]
name = "calljs"
path = "src/lib.rs"
crate-type = ["dylib"]
[dependencies]
rustler = "0.30.0"
num-traits = "0.2.14"
[josh@Joshuas-Mac-mini:~/prob/native/calljs]% ❯ cargo clean
[josh@Joshuas-Mac-mini:~/proj/native/calljs]% ❯ cargo add wasmedge-sdk-bindgen
Updating crates.io index
Adding wasmedge-sdk-bindgen v0.4.0 to dependencies.
[josh@Joshuas-Mac-mini:~/proj/native/calljs]% ❯ cargo add wasmedge-sdk
Updating crates.io index
Adding wasmedge-sdk v0.13.2 to dependencies.
Features:
- aot
- async
- ffi
- standalone
- static
- wasi_crypto
- wasi_nn
- wasmedge_process
Updating crates.io index
error: failed to select a version for `wasmedge-sys`.
... required by package `wasmedge-sdk v0.4.0`
... which satisfies dependency `wasmedge-sdk = "^0.4.0"` of package `wasmedge-sdk-bindgen v0.4.0`
... which satisfies dependency `wasmedge-sdk-bindgen = "^0.4.0"` of package `calljs v0.1.0 (/Users/josh/proj/native/calljs)`
versions that meet the requirements `^0.9.0` are: 0.9.0
the package `wasmedge-sys` links to the native library `wasmedge`, but it conflicts with a previous package which links to `wasmedge` as well:
package `wasmedge-sys v0.17.5`
... which satisfies dependency `wasmedge-sys = "^0.17.5"` of package `wasmedge-sdk v0.13.2`
... which satisfies dependency `wasmedge-sdk = "^0.13.2"` of package `calljs v0.1.0 (/Users/josh/proj/native/calljs)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='wasmedge-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
failed to select a version for `wasmedge-sys` which could resolve this conflict
[josh@Joshuas-Mac-mini:~/proj/native/calljs]% ❯
Please refer to this example: https://github.com/second-state/wasmedge-rustsdk-examples/blob/main/wasmedge-bindgen/README.md The wasmedge-sdk-bindgen is obsoleted.
Here is my
Cargo.toml
And here is what I get