NordSecurity / uniffi-bindgen-cs

C# bindings generator for uniffi-rs
https://github.com/NordSecurity/uniffi-bindgen-cs
Mozilla Public License 2.0
112 stars 21 forks source link

`Error: Unexpected metadata type code` when using the library mode #46

Closed meenzen closed 1 year ago

meenzen commented 1 year ago

I can't get the library mode to work for the matrix-rust-sdk, somehow the embedded metadata is not being read correctly. The upstream uniffi-bindgen tool does not have the same issue.

> uniffi-bindgen-cs --library ../../target/debug/libmatrix_sdk_ffi.so --out-dir out                             
Error: Unexpected metadata type code: 82
> uniffi-bindgen-cs --library ../../target/release/libmatrix_sdk_ffi.so --out-dir out
Error: Unexpected metadata type code: 37

rel: https://github.com/mozilla/uniffi-rs/blob/main/uniffi_meta/src/reader.rs#L61

Version: v0.5.1+v0.24.0

arg0d commented 1 year ago

Are you using the same uniffi-bindgen upstream version?

meenzen commented 1 year ago

I don't control the uniffi-bindgen version of the matrix-rust-sdk project, but v0.6.0+v0.25.0 of uniffi-bindgen-cs seems to work now.

The issue probably was a version mismatch, could we maybe add a more descriptive error message in case someone has the same problem in the future?

arg0d commented 1 year ago

Reading metadata is done by upstream uniffi-rs code, so thats where any changes would have to be made.