denoland / deno_bindgen

Write high-level Deno FFI libraries in Rust.
MIT License
269 stars 31 forks source link

Bug: missing crate version/bad documentation #148

Open RaphaelDarley opened 4 months ago

RaphaelDarley commented 4 months ago

The README of this project says to install deno_bindgen_cli via cargo install however, the version on crates.io is v0.1.0 and does not work. The crate should either be updated or instruction should be given to install it via deno as on crates.io

I'm also unable to get the command in the crates.io documentation to work

nearest-river commented 4 months ago

The documentation is updated for release 0.9 but release 0.9 isn't out yet

so you must do it as the old documentation says

Sleepful commented 3 months ago

I had added:

cargo add deno_bindgen

I had installed:

cargo install deno_bindgen_cli

But then I was getting this weird error...

$ deno_bindgen -o mod.ts

Error: Custom { kind: Other, error: "failed to load library: Could not obtain symbol from the library: dlsym(0x83731040, init_deno_bindgen): symbol not found" }

Then I found your issue. So debugging accordingly, I added this to my Rust project:

cargo add deno_bindgen@=0.9.0-alpha
cargo add linkme

And now I can run:

$ deno_bindgen -o mod.ts

So... yeah, very confusing :S The README should be updated indeed.

Sleepful commented 3 months ago

or, if you want to use stable release 8.1, which I had to do (see here https://github.com/denoland/deno_bindgen/issues/149), do as the old docs say: https://github.com/denoland/deno_bindgen/tree/0.8.1

So you will install a deno CLI instead of a cargo CLI, and you will use cargo add deno_bindgen to get the 8.1