knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
645 stars 75 forks source link

Obtain git-version from macro, instead of custom build-script #221

Closed Urhengulas closed 3 years ago

Urhengulas commented 3 years ago

This implements the idea from @japaric to utilize the git_version crate for obtaining the git hash, instead of the custom build-script we used so far.

In case git is not present on the system the reported version will only consist of the CARGO_PKG_VERSION.


_note: I am a bit unsure where exactly to put the extract_git_hash helper function. I mainly considered the utils module. I decided to put it into main.rs for now to not potentially conflict with the upcoming refactoring from @Lotterleben and @japaric._

Lotterleben commented 3 years ago

main.rs will be heavily refactored, but this PR shouldn't be too painful to rebase onto the refactored code I think. If that*#s okay with you, I'd like to wait with merging this PR until after the refactoring is done.

Urhengulas commented 3 years ago

main.rs will be heavily refactored, but this PR shouldn't be too painful to rebase onto the refactored code I think. If that*#s okay with you, I'd like to wait with merging this PR until after the refactoring is done.

Sure!

Urhengulas commented 3 years ago

@Lotterleben I've rebased it onto the latest main.

Lotterleben commented 3 years ago

feel free to bors rplus

Urhengulas commented 3 years ago

bors r+

bors[bot] commented 3 years ago

Build succeeded: