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

Error when installing Subkey #8131

Closed
centrifugenoder opened this issue Feb 16, 2021 · 12 comments
Closed

Error when installing Subkey #8131

centrifugenoder opened this issue Feb 16, 2021 · 12 comments
Labels
Z7-question Issue is a question. Closer should answer.

Comments

@centrifugenoder
Copy link

centrifugenoder commented Feb 16, 2021

Hey,
I am new to substrate and programming and I am constantly running into the same error when trying installing subkey to generate some keys for a node. I have tried to install subkey following the step in the Substrate Developer Hub but I am not being able to complete the installation. The error is the following:

error[E0034]: multiple applicable items in scope
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:51:25
|
51 | const MASK: u8 = Self::BITS - 1;
| ^^^^ multiple BITS found
|
note: candidate #1 is defined in the trait BitMemory
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:44:2
|
44 | const BITS: u8 = mem::size_of::() as u8 * 8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait IsNumber
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/funty-1.2.0/src/lib.rs:144:2
|
144 | const BITS: u32;
| ^^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
51 | const MASK: u8 = BitMemory::BITS - 1;
| ^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #2
|
51 | const MASK: u8 = IsNumber::BITS - 1;
| ^^^^^^^^^^^^^^

error[E0034]: multiple applicable items in scope
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/order.rs:291:15
|
291 | if ct == R::BITS {
| ^^^^ multiple BITS found
|
note: candidate #1 is defined in the trait BitMemory
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:44:2
|
44 | const BITS: u8 = mem::size_of::() as u8 * 8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait IsNumber
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/funty-1.2.0/src/lib.rs:144:2
|
144 | const BITS: u32;
| ^^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
291 | if ct == BitMemory::BITS {
| ^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #2
|
291 | if ct == IsNumber::BITS {
| ^^^^^^^^^^^^^^

error[E0034]: multiple applicable items in scope
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/order.rs:339:15
|
339 | if ct == R::BITS {
| ^^^^ multiple BITS found
|
note: candidate #1 is defined in the trait BitMemory
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:44:2
|
44 | const BITS: u8 = mem::size_of::() as u8 * 8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait IsNumber
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/funty-1.2.0/src/lib.rs:144:2
|
144 | const BITS: u32;
| ^^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
339 | if ct == BitMemory::BITS {
| ^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #2
|
339 | if ct == IsNumber::BITS {
| ^^^^^^^^^^^^^^

error[E0034]: multiple applicable items in scope
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/order.rs:450:19
|
450 | for n in 0 .. R::BITS {
| ^^^^ multiple BITS found
|
note: candidate #1 is defined in the trait BitMemory
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:44:2
|
44 | const BITS: u8 = mem::size_of::() as u8 * 8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait IsNumber
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/funty-1.2.0/src/lib.rs:144:2
|
144 | const BITS: u32;
| ^^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
450 | for n in 0 .. BitMemory::BITS {
| ^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #2
|
450 | for n in 0 .. IsNumber::BITS {
| ^^^^^^^^^^^^^^

error[E0034]: multiple applicable items in scope
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/order.rs:469:21
|
469 | pos.value() < R::BITS,
| ^^^^ multiple BITS found
|
note: candidate #1 is defined in the trait BitMemory
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:44:2
|
44 | const BITS: u8 = mem::size_of::() as u8 * 8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait IsNumber
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/funty-1.2.0/src/lib.rs:144:2
|
144 | const BITS: u32;
| ^^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
469 | pos.value() < BitMemory::BITS,
| ^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #2
|
469 | pos.value() < IsNumber::BITS,
| ^^^^^^^^^^^^^^

error[E0034]: multiple applicable items in scope
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/order.rs:476:7
|
476 | R::BITS,
| ^^^^ multiple BITS found
|
note: candidate #1 is defined in the trait BitMemory
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.20.1/src/mem.rs:44:2
|
44 | const BITS: u8 = mem::size_of::() as u8 * 8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait IsNumber
--> /home/centifuge/.cargo/registry/src/github.com-1ecc6299db9ec823/funty-1.2.0/src/lib.rs:144:2
|
144 | const BITS: u32;
| ^^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
476 | BitMemory::BITS,
| ^^^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #2
|
476 | IsNumber::BITS,
| ^^^^^^^^^^^^^^

error: aborting due to 60 previous errors

Some errors have detailed explanations: E0034, E0308.
For more information about an error, try rustc --explain E0034.
error: failed to compile subkey v2.0.0 (https://github.com/paritytech/substrate#e03ca38d), intermediate artifacts can be found at /tmp/cargo-installkvO14R

Caused by:
could not compile bitvec

Thank you for the help :).

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Feb 16, 2021
@apopiak
Copy link
Contributor

apopiak commented Feb 16, 2021

This is due to some dependency problem with bitvec. See ferrilab/bitvec#105 (comment)
Solution in case you're building from source: cargo update -p funty --precise 1.1.0

@bkchr
Copy link
Member

bkchr commented Feb 16, 2021

Please use:
cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.0 --locked

@centrifugenoder
Copy link
Author

You are the god of programming @bkchr. Thank tou for your help

@pepa65
Copy link

pepa65 commented Jul 2, 2021

Output of cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.0 --locked:

    Updating git repository `https://github.com/paritytech/substrate`
error: could not find `subkey` in https://github.com/paritytech/substrate with version `=2.0.0`

@bkchr
Copy link
Member

bkchr commented Jul 2, 2021

@pepa65 use

cargo install --force subkey --git https://github.com/paritytech/substrate --tag=v3.0.0 --locked

@pepa65
Copy link

pepa65 commented Jul 3, 2021

Thanks, that totally worked! It might be good to put this somewhere in the readme..!
And here: https://substrate.dev/docs/en/knowledgebase/integrate/subkey#install-with-cargo

@shawntabrizi
Copy link
Member

@nukemandan @jimmychu0807 ^^

@nuke-web3
Copy link
Contributor

nuke-web3 commented Jul 3, 2021

So I guess the tag flag looks for the overall tags of substrate.

subkey is version 2.0.1
https://github.com/paritytech/substrate/blob/master/bin/utils/subkey/Cargo.toml#L3
This is what the docs instruct to use already actually. I think that is better practice than a tag?

Happy to go with either, let me know what you think is best.

@jimmychu0807
Copy link
Contributor

I also tried installing subkey this morning using the instructions from our docs.

cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked

This works fine for me.

@pepa65
Copy link

pepa65 commented Jul 5, 2021

I tried that again, cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked and now got:

    Updating git repository `https://github.com/paritytech/substrate`
error: failed to parse manifest at `/home/pp/.cargo/git/checkouts/substrate-7e08433d4c370a21/fc49802/Cargo.toml`

Caused by:
  feature `resolver` is required

  consider adding `cargo-features = ["resolver"]` to the manifest

@nuke-web3
Copy link
Contributor

nuke-web3 commented Jul 5, 2021

I think you have a too old version of rust toolchain. I believe no less than 1.51 is needed. Best to use rustup update to latest stable and nightly.
If this still gives issues, you may need to clear the installation Dir of build artifacts for thus and try again with the docs v2.0.1 version

In any case, let us know so we can update the docs to avoid this for others 🙏🏼

@nuke-web3 nuke-web3 added Z7-question Issue is a question. Closer should answer. and removed J2-unconfirmed Issue might be valid, but it’s not yet known. labels Jul 5, 2021
@pepa65
Copy link

pepa65 commented Jul 6, 2021

My toolchain is probably not up to date, but @bkchr's command worked flawlessly, so it seems to be more robust.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z7-question Issue is a question. Closer should answer.
Projects
None yet
Development

No branches or pull requests

7 participants