matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.21k stars 240 forks source link

Released package will not compile due to non implemented PickleError #3738

Closed timthelion closed 2 months ago

timthelion commented 2 months ago

Matrix sdk matrix-sdk = "0.7.1" will not compile:

[nix-shell:~/pu/matrix-bot-tester]$ cargo build
   Compiling matrix-sdk-sqlite v0.7.0
error[E0277]: `?` couldn't convert the error to `error::Error`
   --> /home/timothy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/matrix-sdk-sqlite-0.7.0/src/crypto_store.rs:927:57
    |
927 |         Ok(Some(InboundGroupSession::from_pickle(pickle)?))
    |                                                         ^ the trait `From<matrix_sdk_crypto::vodozemac::PickleError>` is not implemented for `error::Error`, which is required by `std::result::Result<std::option::Option<matrix_sdk_crypto::olm::InboundGroupSession>, error::Error>: FromResidual<std::result::Result<Infallible, matrix_sdk_crypto::vodozemac::PickleError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <error::Error as From<StoreEncryptionError>>
              <error::Error as From<serde_json::Error>>
              <error::Error as From<deadpool::managed::errors::PoolError<rusqlite::Error>>>
              <error::Error as From<rmp_serde::decode::Error>>
              <error::Error as From<rusqlite::Error>>
              <error::Error as From<rmp_serde::encode::Error>>
              <error::Error as From<vodozemac::PickleError>>
    = note: required for `Result<Option<InboundGroupSession>, Error>` to implement `FromResidual<std::result::Result<Infallible, matrix_sdk_crypto::vodozemac::PickleError>>`
    = note: the full type name has been written to '/home/timothy/pu/matrix-bot-tester/target/debug/deps/matrix_sdk_sqlite-5d36225fedcdc1d1.long-type-16015632187657828907.txt'

error[E0277]: `?` couldn't convert the error to `error::Error`
   --> /home/timothy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/matrix-sdk-sqlite-0.7.0/src/crypto_store.rs:938:60
    |
938 |                 Ok(InboundGroupSession::from_pickle(pickle)?)
    |                                                            ^ the trait `From<matrix_sdk_crypto::vodozemac::PickleError>` is not implemented for `error::Error`, which is required by `std::result::Result<matrix_sdk_crypto::olm::InboundGroupSession, _>: FromResidual<std::result::Result<Infallible, matrix_sdk_crypto::vodozemac::PickleError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <error::Error as From<StoreEncryptionError>>
              <error::Error as From<serde_json::Error>>
              <error::Error as From<deadpool::managed::errors::PoolError<rusqlite::Error>>>
              <error::Error as From<rmp_serde::decode::Error>>
              <error::Error as From<rusqlite::Error>>
              <error::Error as From<rmp_serde::encode::Error>>
              <error::Error as From<vodozemac::PickleError>>
    = note: required for `std::result::Result<matrix_sdk_crypto::olm::InboundGroupSession, error::Error>` to implement `FromResidual<std::result::Result<Infallible, matrix_sdk_crypto::vodozemac::PickleError>>`

error[E0277]: `?` couldn't convert the error to `error::Error`
   --> /home/timothy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/matrix-sdk-sqlite-0.7.0/src/crypto_store.rs:958:60
    |
958 |                 Ok(InboundGroupSession::from_pickle(pickle)?)
    |                                                            ^ the trait `From<matrix_sdk_crypto::vodozemac::PickleError>` is not implemented for `error::Error`, which is required by `std::result::Result<matrix_sdk_crypto::olm::InboundGroupSession, _>: FromResidual<std::result::Result<Infallible, matrix_sdk_crypto::vodozemac::PickleError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <error::Error as From<StoreEncryptionError>>
              <error::Error as From<serde_json::Error>>
              <error::Error as From<deadpool::managed::errors::PoolError<rusqlite::Error>>>
              <error::Error as From<rmp_serde::decode::Error>>
              <error::Error as From<rusqlite::Error>>
              <error::Error as From<rmp_serde::encode::Error>>
              <error::Error as From<vodozemac::PickleError>>
    = note: required for `std::result::Result<matrix_sdk_crypto::olm::InboundGroupSession, error::Error>` to implement `FromResidual<std::result::Result<Infallible, matrix_sdk_crypto::vodozemac::PickleError>>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `matrix-sdk-sqlite` (lib) due to 3 previous errors
poljar commented 2 months ago

Sorry, a bit of a mess due to the matrix-sdk-crypto release which bumped the vodozemac dependency.

This was fixed with the releases of the matrix-sdk-sqlite and matrix-sdk-qrcode crates: https://github.com/matrix-org/matrix-rust-sdk/pull/3737 and https://github.com/matrix-org/matrix-rust-sdk/pull/3735.

Running cargo update will fix this for you.