-
Notifications
You must be signed in to change notification settings - Fork 304
feat(wasm): Change matrix-sdk-ffi to rely on features over platform targets #5211
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
feat(wasm): Change matrix-sdk-ffi to rely on features over platform targets #5211
Conversation
It would be nice to split the addition of the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #5211 +/- ##
==========================================
- Coverage 90.13% 90.12% -0.01%
==========================================
Files 334 334
Lines 104717 104717
Branches 104717 104717
==========================================
- Hits 94389 94381 -8
- Misses 6275 6282 +7
- Partials 4053 4054 +1 ☔ View full report in Codecov by Sentry. |
f727f83
to
461fe31
Compare
The complement-crypto system just needs to have |
b0b65ea
to
4b7c823
Compare
@Hywan this contains the recommendations we discussed today, along with its complement-crypto PR in matrix-org/complement-crypto#189 |
4b7c823
to
61e67a4
Compare
If you name the branch in complement crypto the same as the one here, complement crypto should™ use the branch for the CI here. Though perhaps that doesn't work for branches on forks. |
Worth a shot, opened up matrix-org/complement-crypto#190 on complement-crypto with the same branch name, though it won't run without someone granting it permission. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of nits, can you please document the feature flags in the readme and explain why we're using feature flags instead of configuring things for users on a per-platform basis.
bindings/matrix-sdk-ffi/Cargo.toml
Outdated
|
||
[features] | ||
default = ["bundled-sqlite", "unstable-msc4274"] | ||
bundled-sqlite = ["matrix-sdk/bundled-sqlite"] | ||
unstable-msc4274 = ["matrix-sdk-ui/unstable-msc4274"] | ||
# Required when targeting a js environment, like wasm in a browser. | ||
js = ["matrix-sdk-ui/js"] | ||
# Use native-tls system, necessary on ios and wasm platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Use native-tls system, necessary on ios and wasm platforms. | |
# Use the TLS implementation provided by the host system, necessary on iOS and Wasm platforms. |
bindings/matrix-sdk-ffi/Cargo.toml
Outdated
native-tls = ["matrix-sdk/native-tls", "sentry?/native-tls"] | ||
# Use the rustls-tls system, necessary on android platforms. | ||
rustls-tls = ["matrix-sdk/rustls-tls", "sentry?/rustls"] | ||
# Enable sentry, not compatible with wasm platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Enable sentry, not compatible with wasm platforms. | |
# Enable sentry, not compatible with Wasm platforms. |
bindings/matrix-sdk-ffi/CHANGELOG.md
Outdated
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. | |||
<!-- next-header --> | |||
|
|||
## [Unreleased] - ReleaseDate | |||
|
|||
- Adjust features in the `matrix-sdk-ffi` crate to expose more platform-specific knobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a missing category for this entry and a missing newline and the entry doesn't quite explain what's going on. It's also a breaking feature.
Could we reword this somehow to explain that we're switching from platform specific configuration to feature specific configuration, explaining the rationale here would be helpful to other consumers as well.
- Adjust features in the `matrix-sdk-ffi` crate to expose more platform-specific knobs | |
- Adjust features in the `matrix-sdk-ffi` crate to expose more platform-specific knobs | |
Thank you for the feedback @poljar, I expanded the Changelog with a motivation and backwards compatibility instructions. I added a similar entry to the README file explaining the current features. |
I left a small nit about whitespace in the changelog file, also please resolve the conflicts. After that we can merge this. |
@poljar merge conflicts addressed and last changes updated. I believe complement-crypto should work with the corresponding PR, the code-coverage break seems to be intermittent? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can merge before CI is green, but looks like that's being worked on separately. Changes LGTM.
Besides the break, the complement crypto won't go green without the corresponding pr, so one will have to break in order to land this |
The system of platform targets was already quite messy, and becoming even worse as we start preparing for Wasm support. Switch to features instead to make this easier to work with.
Co-authored-by: Damir Jelić <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
Co-authored-by: Damir Jelić <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
Co-authored-by: Damir Jelić <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
Co-authored-by: Jonas Platte <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
Co-authored-by: Jonas Platte <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
Co-authored-by: Jonas Platte <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
Co-authored-by: Jonas Platte <[email protected]> Signed-off-by: Daniel Salinas <[email protected]>
d1bedb5
to
e3b92a6
Compare
I rebased to try to make the CI happy. |
The system of platform targets was already quite messy, and becoming even worse as we start preparing for Wasm support. Switch to features instead to make this easier to work with.
The idea is that whether than a large number of platform specific checks in the toml file, these should be cfg features that can be enabled/disabled on the various platforms as needed. The xtask build system for the matrix-sdk-ffi bindings has been updated to use this to maintain existing behavior.
The new features are:
In the future, we will add the following additional features:
Signed-off-by: Daniel Salinas