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

Building latest version fails #118

Open
DylanVerstraete opened this issue Jun 24, 2020 · 4 comments
Open

Building latest version fails #118

DylanVerstraete opened this issue Jun 24, 2020 · 4 comments

Comments

@DylanVerstraete
Copy link

version 0.11.0 does not build.

Stacktrace:

   Compiling hypercore v0.11.0
error[E0277]: the trait bound `random_access_memory::RandomAccessMemory: random_access_storage::RandomAccess` is not satisfied
   --> /Users/dylan/.cargo/registry/src/github.com-1ecc6299db9ec823/hypercore-0.11.0/src/feed.rs:572:6
    |
30  | pub struct Feed<T>
    |            ---- required by a bound in this
31  | where
32  |     T: RandomAccess<Error = Error> + Debug,
    |        --------------------------- required by this bound in `feed::Feed`
...
572 | impl Default for Feed<RandomAccessMemory> {
    |      ^^^^^^^ the trait `random_access_storage::RandomAccess` is not implemented for `random_access_memory::RandomAccessMemory`
    |
help: trait impl with same name found
   --> /Users/dylan/.cargo/registry/src/github.com-1ecc6299db9ec823/random-access-memory-1.2.0/src/lib.rs:55:1
    |
55  | / impl RandomAccess for RandomAccessMemory {
56  | |   type Error = Box<dyn std::error::Error + Send + Sync>;
57  | |
58  | |   fn write(&mut self, offset: u64, data: &[u8]) -> Result<(), Self::Error> {
...   |
203 | |   }
204 | | }
    | |_^
    = note: perhaps two different versions of crate `random_access_storage` are being used?
@bltavares
Copy link
Member

Sorry about this, there has been some new work merged that required a new version of random_access_storage and the versions need to match to have it working. Note the last line on the error:

= note: perhaps two different versions of crate random_access_storage are being used?

Would you mind trying out:

[dependencies]
hypercore = "0.11.1-beta.8"
random-access-disk = "2.0.0"
random-access-memory = "2.0.0"
random-access-storage = "4.0.0"

@xoryouyou
Copy link

I had to also add the following crates

async-std = {version = "1", features = ["attributes"]}
anyhow = "1.0.40"

so that examples/main.rs would build

@jalcine
Copy link

jalcine commented Oct 8, 2021

Came here for the same reason - the changes suggested here work for me. Do we have a sense as to when that'll be placed into a stable patch version (or minor)?

@ntauth
Copy link

ntauth commented Mar 23, 2022

Adding this to Cargo.toml fixed it for me:

hypercore = "0.11.1-beta.10"
log = "0.4.16"

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

5 participants