NordSecurity / uniffi-bindgen-cs

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

cdylib_name not specified error (unclear error message) #92

Open avioletheart opened 2 months ago

avioletheart commented 2 months ago

I am getting this error while trying to generate bindings:

[nix-shell:~/src/pluralkit/pluralkit]$ RUST_BACKTRACE=1 uniffi-bindgen-cs lib/commands/src/commands.udl 
thread 'main' panicked at bindgen/src/gen_cs/mod.rs:79:14:
`cdylib_name` not specified
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::option::expect_failed
   3: uniffi_bindgen_cs::gen_cs::Config::cdylib_name
   4: <uniffi_bindgen_cs::gen_cs::CsWrapper as askama::Template>::render_into
   5: uniffi_bindgen_cs::gen_cs::generate_bindings
   6: <uniffi_bindgen_cs::BindingGenerator as uniffi_bindgen::BindingGenerator>::write_bindings
   7: uniffi_bindgen::generate_external_bindings
   8: uniffi_bindgen_cs::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

here is my udl file:

namespace commands {
    ParsedCommand? parse_command(string input);
};
dictionary ParsedCommand {
    boolean ok;
    string command_ref;
    sequence<string> args;
    record<string, string?> flags;
};
arg0d commented 2 months ago

The error message is not very helpful, we should improve that. You need to specify cdylib_name in ./uniffi.toml file.