Open pacu opened 4 months ago
I'm guessing you want to generate bindings straight from the library, without touching UDL files. In that case, you should use:
uniffi-bindgen-go --library frost-uniffi-sdk/target/universal-ios/release/libfrost_uniffi_sdk.a
The --lib-file
API you are trying to use expects you to give a path UDL file, though the error is a bit cryptic :( I'm guessing your project doesn't even have a UDL file.
uniffi-bindgen-go --lib-file path/to/library.a path/to/library.udl
Thank you for your quick response @arg0d.
I'm guessing you want to generate bindings straight from the library, without touching UDL files. In that case, you should use:
Yes I'm actually generating the bindings for swift using proc macros like the docs say so https://mozilla.github.io/uniffi-rs/latest/proc_macro/index.html here using cargo swift
see project
I want to achieve something similar for GoLang but I can't seem to be able to figure it out. I'm trying what you suggested
uniffi-bindgen-go --library 'frost-uniffi-sdk/target/universal-ios/
release/libfrost_uniffi_sdk.a' --out-dir .
Error: Failed to extract data from archive member `frost_uniffi_sdk-9ff18b138f383e0a.frost_uniffi_sdk.a7d54b623a26d530-cgu.0.rcgu.o`
Caused by:
Unknown library format
I guess I could create a UDL file but I'd fancy not to.
Update:
I was able to generate the bindings from a cdylib instead.
I had to add it to my [lib] section of the Cargo.toml
[lib]
crate-type = ["lib","staticlib", "cdylib"]
name = "frost_uniffi_sdk"
then the command uniffi-bindgen-go --library 'frost-uniffi-sdk/target/debug/libfrost_uniffi_sdk.dylib' --out-dir .
worked.
--library
doesn't work with a static library?
--library
doesn't work with a static library?
Apparently not
I'm trying to generate go bindings for a project I'm working on, but I can't seem to be able to do so from proc_macros
According to help this would be possible
but when I try something like
uniffi-bindgen-go -l 'frost-uniffi-sdk/target/universal-ios/release/libfrost_uniffi_sdk.a' frost-uniffi-sdk
fails with
Error: UDL file has no grand-parent folder!
how can I achieve it?
Context: this is the project I'm working on https://github.com/pacu/frost-uniffi-sdk