matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

chore(cargo): Update `rand` to 0.9, and `getrandom` to 0.3.2

Open Hywan opened this issue 8 months ago • 4 comments

This patch updates rand to 0.9. It brings several nice advantages:

  • it is compatible with the new Rust edition 2024,
  • it simplifies several signatures since try_fill is replaced by fill, there is no failure, thus removing many unwraps!

This patch also updates getrandom to 0.3.2 and improves testing with Wasm and getrandom.


  • ~Based on https://github.com/matrix-org/matrix-rust-sdk/pull/4884~

Hywan avatar Apr 04 '25 07:04 Hywan

I'm afraid that this will have to wait for https://github.com/matrix-org/vodozemac/pull/206 and its deps.

poljar avatar Apr 04 '25 08:04 poljar

Codecov Report

Attention: Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.81%. Comparing base (13ca27d) to head (d871b9b). Report is 1235 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-crypto/src/store/mod.rs 60.00% 4 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4885      +/-   ##
==========================================
- Coverage   85.82%   85.81%   -0.02%     
==========================================
  Files         299      299              
  Lines       35233    35235       +2     
==========================================
- Hits        30239    30236       -3     
- Misses       4994     4999       +5     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 04 '25 08:04 codecov[bot]

Why?

rand exists in 2 versions in the deps tree with this PR, but I think waiting on vodozemac isn't blocking.

Hywan avatar Apr 04 '25 08:04 Hywan

We have 2 versions of getrandom, the 0.3.2 from our crates, and 0.2.15 from:

  • chacha20poly1305 which still requires rand 0.6.4,
  • backoff, which still requires rand 0.8.5,
  • vodozemac which still requires rand 0.6.4,
  • ctr, same,
  • hkdf, same,
  • indexed_db_futures,

We have to move many crates…

Hywan avatar Apr 04 '25 08:04 Hywan

Let's close this for now. We're going to collect merge conflicts for quite a bit here otherwise.

poljar avatar Jul 17 '25 12:07 poljar