-
Notifications
You must be signed in to change notification settings - Fork 206
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
Using module_name or package_name with external types causes invalid code to be generated. #2028
Comments
I don't quite understand this report. We do have some tests which use external types, so it would be ideal if you can reproduce this problem in our https://github.com/mozilla/uniffi-rs/tree/main/fixtures/ext-types test - that will both help explain the report and give us the start of a test-case for any fix. |
The gist of it is if When I have time I'll produce a pull request with an example case. |
I have pushed and example to my fork. Generate the bindings with library mode in the
Observe that the swift bindings do not have any of the exported types and that the kotlin code has compilation issues. |
Your fork adds new crates and no tests - you will find all these types already exist in that ext-types fixture and it has tests. It's likely your uniffi.toml configs aren't quite correct, but you will need to be a little more concrete with the exact problem for us to help. |
(eg,
|
Thanks for that, I am a bit busy this week, but I will try to adapt that example next week, |
Tested on uniffi v0.26.1 with proc macros
The issues below can be reproduced by having a target library (final product) which uses external types exported in by dependent crates.
Swift
When setting
module_name
inuniffi.toml
for the target crate the bindings generated for swift only include the glue code produced by uniffi. All the exported types from the current and external crates are missing.Kotlin
When setting
package_name
for the target crate the bindings generated for kotlin do not compile and they have a mixture ofRedeclartion
andUnresolved Reference
errors for all the ffi functions.E.g:
The text was updated successfully, but these errors were encountered: