Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

ethkey doesnt compile as a Cargo dependency #10894

Closed
felipeargento opened this issue Jul 16, 2019 · 2 comments
Closed

ethkey doesnt compile as a Cargo dependency #10894

felipeargento opened this issue Jul 16, 2019 · 2 comments
Labels
M0-build 🏗 Building and build system. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.

Comments

@felipeargento
Copy link

Before filing a new issue, please provide the following information.

  • Parity Ethereum version: 2.5.5
  • Operating system: Linux

actual:
Building parity-ethereum as a Cargo dependency on either master or stable branch fails with the following error - while compiling ethkey (v0.3.0):

error[E0277]: the trait bound rand::OsRng: secp256k1::rand::RngCore is not satisfied

Cloning the repository and using Cargo build directly on it is successful, but adding it to another projects Cargo.toml as a dependency produces this error.

expected behavior:
Should be able to compile normally as a cargo dependency without any errors.

steps to reproduce:

  • Create a dummy project.
  • Add a Cargo.toml with ethkey = { git = "https://github.com/cartesi/parity-ethereum", branch = "stable" } dependency.
  • Add lib.rs with extern crate ethkey;.
  • Run Cargo build

how to fix:
Modify eth-secp256k1 inside accounts/ethkey/Cargo.toml:
Change:
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
To:
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", rev = "ccc06e7" }

@ordian
Copy link
Collaborator

ordian commented Jul 16, 2019

@felipeargento parity-ethereum master (and beta) branch uses the rand 0.6 and hence the latest revision of eth-secp256k1 (https://github.com/paritytech/parity-ethereum/blob/14e7641835f2ece9d9fef66e6be53cce360d9c53/Cargo.lock#L776). For stable branch, a revision of eth-secp256k1 is fixed inside of the Cargo.lock. We could add a rev to stable branch though to make it work for lib crates that depend on stable branch.

@jam10o-new jam10o-new added M0-build 🏗 Building and build system. Z1-question 🙋‍♀️ Issue is a question. Closer should answer. labels Jul 22, 2019
@niklasad1
Copy link
Collaborator

Fixed by #11239

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M0-build 🏗 Building and build system. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.
Projects
None yet
Development

No branches or pull requests

4 participants