Skip to content
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

Problem with the download crate v0.6.0 #120

Open
hanusek opened this issue Dec 23, 2022 · 1 comment
Open

Problem with the download crate v0.6.0 #120

hanusek opened this issue Dec 23, 2022 · 1 comment

Comments

@hanusek
Copy link

hanusek commented Dec 23, 2022

Hello @slowli
I have a problem with the download and build the crate.

My compiler: rust 1.54 (required by yocto).

Cargo.toml

[package]
name = "jwt_tests"
version = "0.1.0"
edition = "2018"

[dependencies]
jwt-compact = "0.6.0"

Log:

$ cargo +1.54 b
    Blocking waiting for file lock on package cache
    Updating crates.io index
error: failed to select a version for the requirement `jwt-compact = "=0.6.0"`
candidate versions found which didn't match: 0.5.0, 0.4.0, 0.3.0, ...
location searched: crates.io index
required by package `speedy_tests v0.1.0 (/home/mhanusek/work/code/rnd/jwt_tests)`

For jwt-compact = "0.5.0" :

$cargo +1.54 b
    Blocking waiting for file lock on build directory
   Compiling jwt-compact v0.5.0
error[E0277]: the trait bound `serde_json::Error: std::error::Error` is not satisfied
  --> /home/mhanusek/.cargo/registry/src/github.com-1ecc6299db9ec823/jwt-compact-0.5.0/src/error.rs:46:46
   |
46 |             Self::MalformedHeader(e) => Some(e),
   |                                              ^ the trait `std::error::Error` is not implemented for `serde_json::Error`
   |
   = note: required for the cast to the object type `dyn std::error::Error`

error[E0277]: the trait bound `serde_json::Error: std::error::Error` is not satisfied
   --> /home/mhanusek/.cargo/registry/src/github.com-1ecc6299db9ec823/jwt-compact-0.5.0/src/error.rs:143:46
    |
143 |             Self::MalformedClaims(e) => Some(e),
    |                                              ^ the trait `std::error::Error` is not implemented for `serde_json::Error`
    |
    = note: required for the cast to the object type `dyn std::error::Error`

error[E0277]: the trait bound `serde_cbor::Error: std::error::Error` is not satisfied
   --> /home/mhanusek/.cargo/registry/src/github.com-1ecc6299db9ec823/jwt-compact-0.5.0/src/error.rs:145:50
    |
145 |             Self::MalformedCborClaims(e) => Some(e),
    |                                                  ^ the trait `std::error::Error` is not implemented for `serde_cbor::Error`
    |
    = note: required for the cast to the object type `dyn std::error::Error`

error[E0277]: the trait bound `serde_json::Error: std::error::Error` is not satisfied
   --> /home/mhanusek/.cargo/registry/src/github.com-1ecc6299db9ec823/jwt-compact-0.5.0/src/error.rs:180:55
    |
180 |             Self::Header(e) | Self::Claims(e) => Some(e),
    |                                                       ^ the trait `std::error::Error` is not implemented for `serde_json::Error`
    |
    = note: required for the cast to the object type `dyn std::error::Error`

error[E0277]: the trait bound `serde_cbor::Error: std::error::Error` is not satisfied
   --> /home/mhanusek/.cargo/registry/src/github.com-1ecc6299db9ec823/jwt-compact-0.5.0/src/error.rs:182:41
    |
182 |             Self::CborClaims(e) => Some(e),
    |                                         ^ the trait `std::error::Error` is not implemented for `serde_cbor::Error`
    |
    = note: required for the cast to the object type `dyn std::error::Error`

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0277`.
error: could not compile `jwt-compact`
@slowli
Copy link
Owner

slowli commented Dec 23, 2022

Hi! The version 0.6.0 is not available in your case because it requires Rust 1.60+ / Rust 2021 edition as specified in the crate manifest. (The cargo message is not very helpful here, unfortunately, but I'm 99.9% sure that this is the cause.)

0.6.0 is also the first version that fixes the bug with no_std support that you've encountered with version 0.5.0. This bug was reported previously (#92); see #92 (comment) on a moderately hacky fix. Essentially, the fix boils down to specifying serde_cbor as a direct dependency of your crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants