Skip to content
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

PoC for supporting uniffi bindgen with multiple crates #1910

Closed
wants to merge 1 commit into from

Conversation

Hinton
Copy link
Contributor

@Hinton Hinton commented Jan 9, 2024

Uniffi supports using types from dependent crates, https://mozilla.github.io/uniffi-rs/proc_macro/index.html#types-from-dependent-crates. Consider a crate a which depends on b. This results in two python files being generated, a.py and b.py.

The previous solution relied on manually building the expected bindgen filename, which worked well with just a single python output. This atlernative approach relies on finding all python files in the target directory and including them in the wheel.

At the current stage this is a fairly brute force approach which resolves my use case. I would appreciate feedback on the general approach.

Resolves #1904

Copy link

netlify bot commented Jan 9, 2024

Deploy Preview for maturin-guide ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 36f9ac6
🔍 Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/659d1818b7ff7f00089e965f
😎 Deploy Preview https://deploy-preview-1910--maturin-guide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Nickersoft
Copy link
Contributor

@Hinton The fact this hasn't landed is causing #2294 for me :( Any chance these changes will get in?

@Hinton
Copy link
Contributor Author

Hinton commented Nov 14, 2024

@Nickersoft unfortunately I haven't had time to work on this since I opened the PR. If I remember correctly I believe some tests failed in a non trivial way. I was hoping to get a initial review on if the changes were appropriate as I'm not familiar with the Maturin codebase.

At the moment I'm not actively working on anything producing python bindings either, which means I probably won't be able to prioritize this PR in the near future. If anyone wants to continue on my rough PoC they have my permission and gratitude.

@Nickersoft
Copy link
Contributor

Nickersoft commented Nov 16, 2024

I might be able to help! I think a good chunk of this PR was already landed in #2208, short of updating the __init__ file correctly, which was causing my issue. So this is good info to know – I'll see if I can get a PR open, as it's been a huge blocker for me for months :)

@Nickersoft
Copy link
Contributor

Opened #2294 😊

@messense messense closed this Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uniffi multiple crates not supported
3 participants