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

Argument names must be unique, but '' is in use by more than one argument or group' #2180

Closed
embeddedpenguin opened this issue Oct 20, 2020 · 2 comments
Labels
C-bug Category: Updating dependencies

Comments

@embeddedpenguin
Copy link

Code

The project is getting pretty big at this point so I'm just going to link the repo. Please excuse my awful code =(
https://git.epenguin.net/ePenguin/ePenguin-Igloo

Steps to reproduce the issue

  1. Run "cargo run new"
  2. Get error
thread 'main' panicked at 'Argument names must be unique, but '' is in use by more than one argument or group', /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1613:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Version

  • Rust: rustc 1.45.0 (5c1f21c3b 2020-07-13)
  • Clap: clap 3.0.0-beta.1

Actual Behavior Summary

There isn't a whole lot of behavior to report. It just fails when I use "new" as an arg. All other subcommands work. I've tried backtracing this and got this output:

$ RUST_BACKTRACE=1 ./target/debug/igloo new samd21
thread 'main' panicked at 'Argument names must be unique, but '' is in use by more than one argument or group', /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1613:13
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:486
  11: rust_begin_unwind
             at src/libstd/panicking.rs:388
  12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:342
  13: clap::build::app::App::_debug_asserts
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1613
  14: clap::build::app::App::_build
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1559
  15: clap::parse::parser::Parser::parse_subcommand
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/parse/parser.rs:1020
  16: clap::parse::parser::Parser::get_matches_with
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/parse/parser.rs:730
  17: clap::build::app::App::_do_parse
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1497
  18: clap::build::app::App::try_get_matches_from_mut
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1479
  19: clap::build::app::App::get_matches_from
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1369
  20: clap::build::app::App::get_matches
             at /home/penguin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.1/src/build/app/mod.rs:1274
  21: igloo::igloo::Igloo::new
             at src/igloo.rs:74
  22: igloo::main
             at src/main.rs:18
  23: std::rt::lang_start::{{closure}}
             at /home/penguin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
  24: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  25: std::panicking::try::do_call
             at src/libstd/panicking.rs:297
  26: std::panicking::try
             at src/libstd/panicking.rs:274
  27: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  28: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  29: std::rt::lang_start
             at /home/penguin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
  30: main
  31: __libc_start_main
  32: _start

I definitely triggered whatever is happening because it wasn't doing this earlier. I'm trying to roll back changes to see what I did now, but the panic error makes no sense. It says '' is being repeated as an argument name, which is nothing.

@embeddedpenguin embeddedpenguin added the C-bug Category: Updating dependencies label Oct 20, 2020
@embeddedpenguin
Copy link
Author

Update: This doesn't happen when running with the --release flag. I don't know why that would be.

@embeddedpenguin
Copy link
Author

Solved by switching from beta1 to beta2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

1 participant