Coder Social home page Coder Social logo

Comments (6)

mhammond avatar mhammond commented on June 2, 2024 1

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.

from uniffi-rs.

LBeernaertProton avatar LBeernaertProton commented on June 2, 2024

The gist of it is if package_name or module_name are set in the uniffi binding config file in library mode with proc macros does not generate working bindings.

When I have time I'll produce a pull request with an example case.

from uniffi-rs.

LBeernaertProton avatar LBeernaertProton commented on June 2, 2024

I have pushed and example to my fork.

Generate the bindings with library mode in the lib_main crate

cargo build
uniffi-bindgen generate --library ../../../target/debug/liblib_main.so --config uniffi.toml --language swift --out-dir ./tmp/swift
uniffi-bindgen generate --library ../../../target/debug/liblib_main.so --config uniffi.toml --language kotlin --out-dir ./tmp/kotlin

Observe that the swift bindings do not have any of the exported types and that the kotlin code has compilation issues.

from uniffi-rs.

mhammond avatar mhammond commented on June 2, 2024

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.

from uniffi-rs.

mhammond avatar mhammond commented on June 2, 2024

(eg,

use ext_types_guid::Guid;
is a custom type imported into another crate)

from uniffi-rs.

LBeernaertProton avatar LBeernaertProton commented on June 2, 2024

Thanks for that, I am a bit busy this week, but I will try to adapt that example next week,

from uniffi-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.