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

Update to Rand 0.6 #56

Closed
coltfred opened this issue Nov 15, 2018 · 4 comments
Closed

Update to Rand 0.6 #56

coltfred opened this issue Nov 15, 2018 · 4 comments

Comments

@coltfred
Copy link
Contributor

Rand 0.6 was released today with support for WASM as well as other features.

@0ndorio
Copy link

0ndorio commented Nov 20, 2018

An update would be great. Especially because in its current version ed25519-dalek v1.0.0-pre.0 can't be used be used as crate dependency as long as the crate doesn't contain a direct dependency on rand v0.5.

In any case where this dependency doesn't exist or the crate tries to use rand v0.6 the following error appears. Reason for this compilation error seems to be a compatibility issue between rand v0.5.5 and rand v0.6 combined with type differences based on the std feature flag. This results in the issue described in rust-random/rand#645.

error[E0277]: the trait bound `rngs::jitter::TimerError: std::error::Error` is not satisfied                         
   --> /home/rnd/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.5.5/src/rngs/jitter.rs:269:9                 
    |                                                                                                                
269 |         Error::with_cause(ErrorKind::Unavailable,                                                              
    |         ^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `rngs::jitter::TimerError`      
    |                                                                                                                
    = note: required because of the requirements on the impl of `core::convert::From<rngs::jitter::TimerError>` for `alloc::boxed::Box<(dyn std::error::Error + core::marker::Sync + core::marker::Send + 'static)>`
    = note: required because of the requirements on the impl of `core::convert::Into<alloc::boxed::Box<(dyn std::error::Error + core::marker::Sync + core::marker::Send + 'static)>>` for `rngs::jitter::TimerError`
    = note: required by `rand_core::Error::with_cause`                                                               
                                                                                                                     
error: aborting due to previous error                                                                                
                                                                                                                     
For more information about this error, try `rustc --explain E0277`.                                                  
error: Could not compile `rand`.

Based on a few quick tests this could either be resolved in one of two ways:

  1. Update rand from v0.5.5 to v0.6

  2. The std feature flag could also imply the rand/std feature.

    Based on a comment inside the Cargo.toml file this currently doesn't happen as it would introduce fuchsia-zircon as additional dependency. This feels like some kind of relic or inconsistency as curve25519-dalek/std already includes rand/std as an indirect dependency and also seems to be the main reason behind this problem.

@coltfred
Copy link
Contributor Author

@0ndorio I have a PR open for this #57 - Since curve25519 moved to rand 0.6 in 1.0.0-pre.1 I was assuming we would do the same for ed25519. If we want to do something else, let's talk about it in the PR.

@0ndorio
Copy link

0ndorio commented Nov 20, 2018

@coltfred Moving to rand v0.6 sounds reasonable to me. Nothing to discuss there. On a second thought the second solution actually describes another minor issue related to some dependency inconsistency. This shouldn't effect #57 at all.

@isislovecruft
Copy link
Member

Fixed in #57

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

3 participants