Comments (4)
Where are your build scripts for the bindings? None of our examples have good examples of building, but ultimately you probably need to run uniffi_bindgen in "library mode" by pointing it at the final built .so. I'll try and clarify some more tomorrow.
from uniffi-rs.
I went through a megazord + library mode build just before posting this but didn't get it cleaned up into a build script yet. It had the same issue. I'll try to have my project updated tonight or tomorrow morning with that, plus an example Python project consuming the wheel.
from uniffi-rs.
Alright, I updated that project. There's a build/install script, a megazord, and an updated README. Also added a workaround script that does the .tiny_lib
replacement, which is less than ideal but I can move forward on the main project for now.
from uniffi-rs.
Uniffi is broken for external types and Python :( The specific issue here is that your example fails in the generated code at:
from tiny_lib import TinyLibType
where what it wants is:
from .tiny_lib import TinyLibType
Unfortunately the Python bindings don't understand packages and external types. The UniFFI examples all run in the context where each module is top-level - but that's clearly not a viable strategy.
I think UniFFI should just include that leading period, with a future enhancement being you can override it per external type. This patch is simple, but it will break our tests, so our test infra will need to learn about packages.
from uniffi-rs.
Related Issues (20)
- Callback interface method cannot return callback interface HOT 2
- Proc Macros: the trait bound `str: LiftRef<UniFfiTag>` is not satisfied HOT 3
- How can I enable Rust features in Swift? HOT 1
- weedle 4.0.0 breaks uniffi_udl v0.25.3 HOT 4
- What are the advantages of using an external crate for hash instead of the one from the std HOT 4
- Allow UniFFI exported types (e.g. `Object`) from EXTERNAL crates to be used in a crate's e.g. `Record` HOT 6
- Python bindings missing threading import HOT 3
- Long docstrings result in build assertion failure. HOT 3
- Python doesn't generate return type of async functions HOT 6
- Ability to share data across FFI without a copy HOT 1
- Vec capacity can unnecessarily cause Rust panics when creating a `RustBuffer`.
- Kotlin global reference table overflow HOT 2
- Equality check on records when arrays are involved in Kotlin HOT 8
- `uniffi::custom_newtype!(Newtype, u16)` gives `Lift<UniFfiTag>` is not implemented for `Newtype` HOT 11
- Example: How to run the trait function defined in rust instead the implementation in caller? HOT 2
- First callback interface produces "expected value, found struct variant `Self::Other`" error HOT 3
- Tests broken in kotlin project using uniffi HOT 7
- Call requires API level 33 (current min is 29): android.system.SystemCleaner#cleaner
- Android: `java.lang.ClassNotFoundException: Didn't find class "*UniffiRustFutureContinuationCallback"` HOT 2
- Unable to conditionally enable uniffi::constructor macro HOT 28
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uniffi-rs.