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

Fix use of deprecated function in kairos-cli #37

Closed
marijanp opened this issue Mar 17, 2024 · 9 comments · Fixed by #38
Closed

Fix use of deprecated function in kairos-cli #37

marijanp opened this issue Mar 17, 2024 · 9 comments · Fixed by #38
Assignees

Comments

@marijanp
Copy link
Contributor

kairos> warning: use of deprecated function `<common::args::AmountArg as clap::Args>::augment_args::id_is_only_for_arg`: `#[arg(name)] was allowed by mistake, instead use `#[arg(id
)]` or `#[arg(value_name)]`                                                                                                                                                         
kairos>  --> kairos-cli/src/common/args.rs:7:11                                                                                                                                     
kairos>   |                                                                                                                                                                         
kairos> 7 |     #[arg(name = "amount", long, short, value_name = "NUM_MOTES")]                                                                                                      
kairos>   |           ^^^^                                                                                                                                                          
kairos>   |                                                                                                                                                                         
kairos>   = note: `#[warn(deprecated)]` on by default                                                                                                                               
kairos> warning: use of deprecated function `<common::args::PrivateKeyPathArg as clap::Args>::augment_args::id_is_only_for_arg`: `#[arg(name)] was allowed by mistake, instead use `
#[arg(id)]` or `#[arg(value_name)]`                                                                                                                                                 
kairos>   --> kairos-cli/src/common/args.rs:13:11                                                                                                                                   
kairos>    |                                                                                                                                                                        
kairos> 13 |     #[arg(name = "private-key", long, short = 'k', value_name = "FILE_PATH")]                                                                                          
kairos>    |           ^^^^                                                                      
@koxu1996
Copy link
Contributor

Not reproducible locally, neither in CI/CD.

@koxu1996 koxu1996 reopened this Mar 18, 2024
@marijanp
Copy link
Contributor Author

@koxu1996 It will when using future clap versions. This PR's pipeline will not pass without these changes: #34 (comment)

And I decided to submit this commit through a separate PR

@koxu1996
Copy link
Contributor

Future clap version (4.5.3) was already used on main branch, and there was no warning.

@marijanp
Copy link
Contributor Author

Ok I will investigate it and prove

@marijanp
Copy link
Contributor Author

Semantic versions don't provide confidence whether sources might have changed. So you could have different sources for a package with the same semantic version.

Here is the code that causes these warnings: https://github.com/clap-rs/clap/blob/4e07b438584bb8a19e37599d4c5b11797bec5579/clap_derive/src/item.rs#L317

@koxu1996
Copy link
Contributor

Thank you! I am just trying to understand what happened here, to avoid such undetected warnings in the future.

image

@koxu1996
Copy link
Contributor

koxu1996 commented Mar 18, 2024

Here is the code that causes these warnings: https://github.com/clap-rs/clap/blob/4e07b438584bb8a19e37599d4c5b11797bec5579/clap_derive/src/item.rs#L317

@marijanp Deprecation was introduced in February 2022 and seems to be released in older versions of clap as well.

I guess you just executed some extra commands/checks, and if so, we should have them included in CI/CD.

@marijanp
Copy link
Contributor Author

I can create a CI run which removes the changes in the PR and prove that the audit fails. I can't find the core reason that triggers this depreciation warning.

koxu1996 added a commit that referenced this issue Mar 19, 2024
@koxu1996
Copy link
Contributor

@marijanp Please go ahead, I am pretty sure audit will succeed.

Btw. I solved the mystery 🎉. To get this warning you have to enable extra feature flag - please see #42.

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

Successfully merging a pull request may close this issue.

2 participants