second-state / wasmedge-bindgen

Let WebAssembly's exported function support more data types for its parameters and return values.
Apache License 2.0
29 stars 8 forks source link

Update dependencies to the latest version #12

Closed michael-0acf4 closed 9 months ago

michael-0acf4 commented 1 year ago

Here is my Cargo.toml

[dependencies]
# ...
wasmedge-sdk = {git = "https://github.com/WasmEdge/WasmEdge", tag = "0.12.1"}
wasmedge-sys = {git = "https://github.com/WasmEdge/WasmEdge", tag = "0.12.1"}
wasmedge-sdk-bindgen = "0.4.0"
# ...

And here is what I get

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 `wasmedge v0.1.0 (/home/afmika/dev-env/python-wasi-reactor/python-wasi-reactor/wasmedge)`
versions that meet the requirements `^0.9.0` are: 0.9.0
juntao commented 1 year ago

Hmm, WasmEdge Bindgen is this one:

https://crates.io/crates/wasmedge-bindgen

Here is a tutorial:

https://wasmedge.org/docs/develop/rust/bindgen

michael-0acf4 commented 1 year ago

Hmm, WasmEdge Bindgen is this one:

https://crates.io/crates/wasmedge-bindgen

Here is a tutorial:

https://wasmedge.org/docs/develop/rust/bindgen

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

hydai commented 1 year ago

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?

NyanHelsing commented 9 months ago
[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]% ❯
DarumaDocker commented 9 months ago

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.