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

Help and usage show wrong executable name 'ibc-relayer-cli` #590

Closed
1 of 5 tasks
andynog opened this issue Jan 31, 2021 · 2 comments · Fixed by #597
Closed
1 of 5 tasks

Help and usage show wrong executable name 'ibc-relayer-cli` #590

andynog opened this issue Jan 31, 2021 · 2 comments · Fixed by #597
Assignees
Labels
A: bug Admin: something isn't working O: usability Objective: cause to improve the user experience (UX) and ease using the product
Milestone

Comments

@andynog
Copy link
Contributor

andynog commented Jan 31, 2021

Crate

ibc-relayer-cli

Summary of Bug

When I compile the ibc-relayer-cli crate it generates an executable called hermes but if I run it, when the help message is displayed, hermes is not shown but ibc-relayer-cli which might be confusing to the end user.

$ ./target/release/hermes 
ibc-relayer-cli 0.1.0
Informal Systems <[email protected]>

USAGE:
    ibc-relayer-cli <SUBCOMMAND>

SUBCOMMANDS:
    help       get usage information
    start      start the relayer (currently this refers to the v0 relayer)
    channel    channel functionality for managing channels
    listen     listen to IBC events
    config     manipulate the relayer configuration
    version    display version information
    query      query state from chain
    tx         create IBC transactions on configured chains
    light      basic functionality for managing the lite clients
    keys       manage keys in the relayer for each chain

Version

v0.1.0

Steps to Reproduce

Build and run


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@andynog andynog added A: bug Admin: something isn't working O: usability Objective: cause to improve the user experience (UX) and ease using the product labels Jan 31, 2021
@andynog andynog added this to the v0.1.0 milestone Jan 31, 2021
@adizere adizere self-assigned this Feb 1, 2021
@adizere
Copy link
Member

adizere commented Feb 1, 2021

I looked into this and renaming the content of the help message is not obvious. This is because abscissa uses by default the package name (instead of binary name) to create all usage and help messages:

Some pointers:

  • under the hood, when we run ./target/release/hermes what we actually run is an abscissa_core::EntryPoint, parametrized with CliCmd:

https://github.com/informalsystems/ibc-rs/blob/9d0a7b8f11a252e68e039a976910edd33107f074/relayer-cli/src/application.rs#L60

  • the EntryPoint inherits its name field (which is used in all usage/help messages) from CliCmd::name()

  • CliCmd has its name setup by a derive: #[derive(Command..

https://github.com/informalsystems/ibc-rs/blob/93c0e6d4342696523adbde4ea57f4e2c3965b6a2/relayer-cli/src/commands.rs#L35-L37

  • the derive Command macro is defined here, which assigns the env!("CARGO_PKG_NAME") as name to any command.

Some solutions would be:

  • renaming the crate name from ibc-relayer-cli to hermes (not ideal)
  • write our own derive for Command (not ideal...)

@romac
Copy link
Member

romac commented Feb 1, 2021

Yeah Abscissa should use CARGO_BIN_NAME instead of CARGO_PKG_NAME.

We can try overriding the CARGO_PKG_NAME env variable in build.rs but that may break a bunch of stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working O: usability Objective: cause to improve the user experience (UX) and ease using the product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants