Add compatibility with rustls#6367
Add compatibility with rustls#6367jmartinesp merged 5 commits intorenovate/org.matrix.rustcomponents-sdk-android-26.xfrom
Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## renovate/org.matrix.rustcomponents-sdk-android-26.x #6367 +/- ##
=======================================================================================
+ Coverage 81.20% 81.22% +0.02%
=======================================================================================
Files 2580 2579 -1
Lines 70307 70280 -27
Branches 9031 9031
=======================================================================================
- Hits 57091 57086 -5
+ Misses 9858 9836 -22
Partials 3358 3358 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
A new `rustls-platform-verifier-android` library has to be added to the project, it'll be called from Rust to get access to the certificates on Android. Originally, this was supposed to be added as a local maven repo pointing to the rust crate that publishes the AAR, but that's just plain terrible (more details [here](https://github.com/rustls/rustls-platform-verifier#android). Instead, what we can do is use a script that uses `cargo-download` to download the latest crate or a specified version, unzip it and add the `aar` file to the `:libraries:matrix:impl` module.
This is no longer needed after integrating rustls
0e2873c to
02892a7
Compare
ganfra
left a comment
There was a problem hiding this comment.
LGTM I guess, I trust you on this!
One question, when should we call the script exactly?
| cache-read-only: ${{ github.ref != 'refs/heads/develop' }} | ||
| - name: Build debug code and test fixtures | ||
| run: ./gradlew assembleDebug createFullJarDebugTestFixtures :app:createFullJarGplayDebugTestFixtures $CI_GRADLE_ARG_PROPERTIES | ||
| run: ./gradlew assembleGplayDebug createFullJarDebugTestFixtures :app:createFullJarGplayDebugTestFixtures $CI_GRADLE_ARG_PROPERTIES |
There was a problem hiding this comment.
It seems like assembleDebug causes :libraries:matrix:impl:bundleDebugAar to run, in turn causing this issue:
* What went wrong:
Execution failed for task ':libraries:matrix:impl:bundleDebugAar'.
> Error while evaluating property 'hasLocalAarDeps' of task ':libraries:matrix:impl:bundleDebugAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :libraries:matrix:impl project caused this error: /Users/jorge/Developer/Element/element-x-android/libraries/matrix/impl/libs/rustls-platform-verifier-android.aar
AFAICT, assembleGplayDebug still builds the source Sonarqube needs to scan, but it won't create this 'fat AAR' file.
You don't have to trust me, you can just test the branch 😅 . Without these changes and removing the
When a new rustls version is used in the Rust SDK which comes with a new |
bfa898b
into
renovate/org.matrix.rustcomponents-sdk-android-26.x
|



Content
A new
rustls-platform-verifier-androidlibrary has to be added to the project, it'll be called from Rust to get access to the certificates on Android.Originally, this was supposed to be added as a local maven repo pointing to the rust crate that publishes the AAR, but that's just plain terrible (more details here).
Instead, what we can do is use a script that uses
cargo-downloadto download the latest crate or a specified version, unzip it and add theaarfile to the:libraries:matrix:implmodule.Motivation and context
Android counterpart of matrix-org/matrix-rust-sdk#6306.
Tests
Without any self-signed certificates - those are still failing - try a fresh login to any homeserver. When I tried this before, every request was failing because rustls couldn't fetch Android's credentials storage.
Tested devices
Checklist