-
-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
as discussed on matrix this may be helpful for user bug reports I could not find a way to format the string at compile time in which case I could have used something like: `#[structopt(version = git_version::git_version!() + ... )]` output: $ cargo run - --version cargo-embed 0.9.1 git commit: baca8ba
@@ -28,8 +28,14 @@ use probe_rs::{ | |||
use probe_rs_cli_util::build_artifact; | |||
use probe_rs_rtt::{Rtt, ScanRegion}; | |||
|
|||
const CARGO_NAME: &'static str = env!("CARGO_PKG_NAME"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add those constants to the cli-util lib? :) I think that should work and then we can also add this to cargo-flash? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not seem to work for git_version
$ git status
On branch version
nothing to commit, working tree clean
$ git rev-parse --short HEAD
e0104b6
$ cargo run - --version
probe-rs-cli-util 0.9.0
git commit: v0.5.1-467-g7b33b4b-modified
I don't even see where 0.5.1 comes from :/ but both cargo env variable and git_version do the wrong thing or maybe phrased more accurately are used in a way they were not meant to be ;)
We can still add it to cargo flash as well though, just copy pasting :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sounds good to me :) Do this now, possibly improve later :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded: |
same as probe-rs/cargo-embed#116 output: cargo-flash 0.10.2 git commit: db4e2c3
155: add git commit hash to version r=Yatekii a=benmkw same as probe-rs/cargo-embed#116 output: ``` cargo-flash 0.10.2 git commit: db4e2c3 ``` I scrolled though matrix and saw this was still needed :) (this was not put into probe-rs-cli-util because it would then use the wrong commit hash iirc) Co-authored-by: Benedikt Mandelkow <[email protected]>
same as probe-rs/cargo-embed#116 output: cargo-flash 0.10.2 git commit: db4e2c3
155: add git commit hash to version r=Yatekii a=benmkw same as probe-rs/cargo-embed#116 output: ``` cargo-flash 0.10.2 git commit: db4e2c3 ``` I scrolled though matrix and saw this was still needed :) (this was not put into probe-rs-cli-util because it would then use the wrong commit hash iirc) Co-authored-by: Benedikt Mandelkow <[email protected]>
as discussed on matrix this may be helpful for user bug reports
I could not find a way to format the string at compile time in which
case I could have used something like:
#[structopt(version = git_version::git_version!() + .... )]
output:
If you want to do the cargo update stuff separately I can also adjust after thats done.
Tested on macos only.