spruceid / ssi

Core library for decentralized identity.
https://spruceid.dev
Apache License 2.0
187 stars 59 forks source link

ssi-ldp 0.2.0 fails to compile #505

Closed dbcfd closed 1 year ago

dbcfd commented 1 year ago
index.crates.io-6f17d22bba15001f/ssi-ldp-0.2.0/src/lib.rs:484:25
    |
484 |         proof.context = serde_json::json!([context_uri]);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                         |
    |                         the trait `Serialize` is not implemented for `iref::Iri<'_>`
    |                         required by a bound introduced by this call
    |
    = help: the following other types implement trait `Serialize`:
              &'a T
              &'a mut T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
            and 193 others
    = note: required for `&iref::Iri<'_>` to implement `Serialize`

Pulled in via ssi = "0.6.0", fails on both 1.70.0-nightly and 1.68.0

sbihel commented 1 year ago

Hi, I did discover that v0.5.0 broke with the new release, but I can't replicate with v0.6.0. Have you tried doing cargo update? I am surprised by this error because Iri seems to have always implemented Display, which should be used by json!.

Otherwise, if you could provide an example or the project you are building that would be great.

sbihel commented 1 year ago

Another option for now is to keep using ssi v0.5.0 but pin ssi-dids to v0.1.0

dbcfd commented 1 year ago

Another option for now is to keep using ssi v0.5.0 but pin ssi-dids to v0.1.0

0.5.0 is yanked.

Additional compile error

ssi-ldp-0.2.0/src/proof.rs:375:9
    |
372 |     graph_ref.take_object_and_assert_eq_iri(
    |               ----------------------------- arguments to this method are incorrect
...
375 |         proof.proof_purpose.as_ref().map(|pp| pp.to_iri()),
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Iri`, found `&str`
    |
    = note: expected enum `std::option::Option<iref::Iri<'_>>`
               found enum `std::option::Option<&str>`
sbihel commented 1 year ago

Sorry, I was in a rush and forgot that it wasn't possible to force the use of a yanked version.

I don't know if it's the correct project, but I've tried building 3box/wheel and it worked with v0.6.0. This last error indicates that you are using the latest ssi-ldp but not the latest ssi-dids. So I think if you update all ssi- crates it should work.

Apologies for the situation. A breaking change was missed and I thought it would be easy for users to upgrade.

sbihel commented 1 year ago

Hi, is it still an issue or did upgrading to v0.6.0 work?

dbcfd commented 1 year ago

Hi, is it still an issue or did upgrading to v0.6.0 work?

@sbihel Sorry for the delayed response, github is bad at notifications sometimes. Was actually in a different project https://github.com/3box/rust-ceramic/tree/feat-document. I eventually did get it to work, after using individual crates, then moving back to just the whole ssi crate with ed25519 enabled. There might still be an issue, but I think closing this is correct.