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

Proposal: Add --version flag to print the build info of the binary #120

Closed
Mossaka opened this issue Feb 16, 2023 · 5 comments · Fixed by #167
Closed

Proposal: Add --version flag to print the build info of the binary #120

Mossaka opened this issue Feb 16, 2023 · 5 comments · Fixed by #167

Comments

@Mossaka
Copy link
Member

Mossaka commented Feb 16, 2023

It would be nice to have a --version arg for the shims to be able to determine the build version information.

@Burning1020
Copy link
Member

I agree. How much information that "--version" or "-version" should provide?
eg: name, version number, git commit id, rust version?

@Mossaka
Copy link
Member Author

Mossaka commented Feb 16, 2023

Hey @Burning1020 , thanks for your quick response! I am thinking about at least to provide information about the cargo version from env var like env!(CARGO_PKG_VERSION). It would be better to include information from git, like git commit SHA, last build datetime etc. I am not sure how useful Rust version would be in the binary though.

Here is an example of how to get these information from git in build time.

@Burning1020
Copy link
Member

I see. Would you help commit this PR or I can do it lately (got other work to do now) ?

@Mossaka
Copy link
Member Author

Mossaka commented Feb 16, 2023

Sure I can give it a try. Do you think if it's reasonable to add a new flag to https:/containerd/rust-extensions/blob/main/crates/shim/src/args.rs#L24-L42?

Also, unrelated to this issue, but what do you think about using clap to build the CLI experience of the shim?

@Burning1020
Copy link
Member

Sure I can give it a try. Do you think if it's reasonable to add a new flag to https:/containerd/rust-extensions/blob/main/crates/shim/src/args.rs#L24-L42?

Yes, maybe there is no other reasonable places.

Also, unrelated to this issue, but what do you think about using clap to build the CLI experience of the shim?

Clap doesn't support for short flag at present, see here:clap-rs/clap#2468 (comment), so it can't read the flags from containerd.

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