Skip to content

feat(wasm): Add lib to matrix-sdk-ffi target #5242

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

Merged
merged 3 commits into from
Jun 19, 2025

Conversation

zzorba
Copy link
Contributor

@zzorba zzorba commented Jun 18, 2025

The uniffi tool for generating JS/Wasm bindings utilizes rust as its intermediate language.

As a result, the 'target' uniffi annotated library needs to be marked as a 'lib' so that the generated rust code can utilize it to generate the Wasm create + typescript bindings.

  • Public API changes documented in changelogs (optional)

Signed-off-by: Daniel Salinas

@zzorba zzorba requested a review from a team as a code owner June 18, 2025 13:21
@zzorba zzorba requested review from poljar and removed request for a team June 18, 2025 13:21
Copy link
Collaborator

@jplatte jplatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that PR description helps. Maybe I just missed where you explained this before. I would love if you could make this a multi-line array with explanations what each individual crate-type is for, but I think this can merge without that too. (I'll let the actual team do the merging though)

@zzorba
Copy link
Contributor Author

zzorba commented Jun 18, 2025

Sostaticlib is used by iOS and Android, lib is used for Wasm. But I don't know what actually uses cdylib, do you?

@jplatte
Copy link
Collaborator

jplatte commented Jun 18, 2025

I seem to remember it was staticlib -> iOS, cdylib -> android.

@zzorba
Copy link
Contributor Author

zzorba commented Jun 18, 2025

Yep, just read the uniffi docs and that's what it says. I think my android react-native tool might be using the static lib, which was the source of my confusion. Updated the Cargo.toml file with comments.

@poljar
Copy link
Contributor

poljar commented Jun 19, 2025

Could you rebase this to get the CI going?

Daniel Salinas added 3 commits June 19, 2025 09:18
The uniffi tool for generating JS/Wasm bindings utilizes rust
as its intermediate language.  As a result, the 'target' uniffi
annotated library needs to be marked as a 'lib' so that the generated
rust code can utilize it.
@zzorba zzorba force-pushed the wasm_add_lib_to_ffi_target branch from e7ab2c0 to ccd2aca Compare June 19, 2025 13:18
@zzorba
Copy link
Contributor Author

zzorba commented Jun 19, 2025

Rebased

Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.13%. Comparing base (cc7f624) to head (ccd2aca).
Report is 38 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5242      +/-   ##
==========================================
- Coverage   90.13%   90.13%   -0.01%     
==========================================
  Files         334      334              
  Lines      104717   104717              
  Branches   104717   104717              
==========================================
- Hits        94389    94387       -2     
- Misses       6275     6276       +1     
- Partials     4053     4054       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jplatte jplatte merged commit 798cece into matrix-org:main Jun 19, 2025
45 checks passed
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.

3 participants