Polkadot-Blockchain-Academy / Academy-PoW

PoW blockchain node to gain hands-on experience starting a real network together
The Unlicense
24 stars 43 forks source link

thread 'main' panicked at 'Command academy-pow: Argument group name must be unique #14

Closed wirednkod closed 1 year ago

wirednkod commented 1 year ago

After building (with or without --release flag, when trying to run the PoW-node the following issue appear:

➜  Academy-PoW git:(main) cargo run  
    Finished dev [unoptimized + debuginfo] target(s) in 0.30s
     Running `target/debug/academy-pow`
thread 'main' panicked at 'Command academy-pow: Argument group name must be unique

    'RunCmd' is already in use', /home/wirednkod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.3.1/src/builder/debug_asserts.rs:278:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
JoshOrndorff commented 1 year ago

Please consider each of these questions and suggestions and reply to each of them with an answer or the results of what happens when you try the suggestion?

  1. What commit were you building?
  2. Does the same thing happen if you use the latest main (f896065a)?
  3. What rust version are you using?
  4. Does the same thing happen if you run rustup update and try again?
  5. Does this still happen after cargo clean?
  6. Does it still happen if you add --dev?
  7. Does it still happen if you use cargo build and then separately run ./target/debug/academy-pow?
wirednkod commented 1 year ago

Thank you @JoshOrndorff - concerning your questions:

What commit were you building?

from Main

Does the same thing happen if you use the latest main (f896065a)?

Yes

What rust version are you using?

➜  Academy-PoW git:(main) rustc --version
rustc 1.70.0 (90c541806 2023-05-31)

Does the same thing happen if you run rustup update and try again?

Yes

Does this still happen after cargo clean?

Yes

Does it still happen if you add --dev?

Yes

Does it still happen if you use cargo build and then separately run ./target/debug/academy-pow?

Yes

fbielejec commented 1 year ago

this will be fixed with 15

JoshOrndorff commented 1 year ago

@fbielejec I was not able to reproduce it. Can you explain a little bit what you know?

fbielejec commented 1 year ago

clap was confused by having to parse two RunCmd structs - this worked for other cases when arguments were passed because we had them as Optional, or with defaults, but actually the were always included, even for subcommands - these are the relevant changes:

https://github.com/Polkadot-Blockchain-Academy/Academy-PoW/commit/547194c21f3c421d9abe17e875b151d3bc27c505#diff-76397c90c6ee2b6b98efd989d3ae3c11e0bde3db30b5ef46f2762180f56041a8R11-R22

JoshOrndorff commented 1 year ago

@wirednkod the expected fix is merged now. Can you please confirm whether it is working as expected?

Thank you @fbielejec

wirednkod commented 1 year ago

@JoshOrndorff Issue is no longer there! Thank you so much

Thank you also @fbielejec