feat: add detailed version information#1202
Open
ivan-aksamentov wants to merge 2 commits intomasterfrom
Open
Conversation
This adds CLI args to display more information about Nextclade version and build environment. - `--version-detailed` (`-W`) shows single-line detailed information, for example: ``` 2.14.0 (Debug; Dirty; Commit d532ea3; Branch v3; Committed on 2023-07-17 17:50:05 +00:00; Built on 2023-07-17 17:59:28 +00:00) ``` - `--version-full` (`-X`) shows even more information in multi-line format, for example: ``` Version 2.14.0 Debug true Dirty true Branch v3 Tag Commit d532ea3 Committed on 2023-07-17 17:50:05 +00:00 Built on 2023-07-17 17:59:28 +00:00 Build OS linux-x86_64 Rust version rustc 1.70.0 (90c541806 2023-05-31) Rust channel 1.70.0-x86_64-unknown-linux-gnu ``` - `--version-json` (`-Y`) shows the same information as `--version-full`, but in JSON format (suitable for machine processing) ```json { "version": "2.14.0", "is_debug": true, "git_is_clean": false, "git_branch": "v3", "git_tag": "", "git_commit": "d532ea3a", "git_commit_date": "2023-07-17 17:50:05 +00:00", "build_time": "2023-07-17 17:59:28 +00:00", "build_os": "linux-x86_64", "rust_version": "rustc 1.70.0 (90c541806 2023-05-31)", "rust_channel": "1.70.0-x86_64-unknown-linux-gnu" } ``` Notes: - "debug" means that the program is compiled without `--release` flag - "dirty" means that there were uncommitted git changes during build This functionality required adding additional build step (`build.rs` file).
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Member
Author
|
This approach using |
Member
|
This is rad :) I think it's ok if it doesn't build on wasm and some linux distributions. It's entirely optional and mostly for internal use. |
93f31a9 to
edefa32
Compare
27d4a31 to
9010d85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds CLI args to display more information about Nextclade version and build environment.
--version-detailed(-W) shows single-line detailed information, for example:--version-full(-X) shows even more information in multi-line format, for example:--version-json(-Y) shows the same information as--version-full, but in JSON format (suitable for machine processing){ "version": "2.14.0", "is_debug": true, "git_is_clean": false, "git_branch": "v3", "git_tag": "", "git_commit": "d532ea3a", "git_commit_date": "2023-07-17 17:50:05 +00:00", "build_time": "2023-07-17 17:59:28 +00:00", "build_os": "linux-x86_64", "rust_version": "rustc 1.70.0 (90c541806 2023-05-31)", "rust_channel": "1.70.0-x86_64-unknown-linux-gnu" }Notes:
--releaseflagThis functionality required adding additional build step (
build.rsfile).