-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External trait interface isn't compiled (UDL mode) #1831
Comments
Can you provide the actual error you're running into? |
As we see the |
Maybe the problem lies here https://github.com/mozilla/uniffi-rs/blob/main/uniffi_bindgen/src/scaffolding/mod.rs#L66. In case of the external type it generates just |
yeah - the problem here is that the trait is "external". I don't think an external type even knows if it is a trait or not - it probably needs to though. |
this should actually work ok using procmacros I think. There are a few options for UDL though, but all have some work. |
It compiles with proc-macros, but crashes at runtime for example with Kotlin script test:
Reproducible example: https://github.com/Voronar/uniffi_external_trait_interface/tree/external_trait_proc_macro_kotlin_script_crash |
The problem here is still UDL - main_lib's UDL can't reference the trait - so if you remove the trait and function from the UDL and use |
I made reproducible example (mentioned in my previous message) without any UDL and it crashes at runtime (at least on my machine).
|
Fixes mozilla#1831 Also fixes naming problem bindings with external types with unusual names.
I'm trying to reuse uniffi trait interface (https://mozilla.github.io/uniffi-rs/foreign_traits.html) from an external crate living in my own workspace.
main_lib:
main_lib UDL:
shared_lib:
shared_lib UDL:
Error:
Reproducible example: https://github.com/Voronar/uniffi_external_trait_interface
uniffi version: 0.25
The text was updated successfully, but these errors were encountered: