Skip to content

Commit 47710ab

Browse files
authored
fix version report: replace git dirty with ci platform due to bug in crate (#23)
* test dirty cache * add debug * test build_info * test build_info * replace git dirty with ci platform due to bug in crate * alphabetize vars * appease lint
1 parent 0af371d commit 47710ab

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/release.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ jobs:
6565
runner: warp-ubuntu-latest-x64-16x
6666

6767
steps:
68-
- uses: WarpBuilds/rust-cache@v2
69-
7068
- name: Install dependencies
7169
run: |
7270
apt-get update
@@ -90,6 +88,7 @@ jobs:
9088
git config --global --add safe.directory "$(pwd)"
9189
. $HOME/.cargo/env
9290
cargo build --release --target ${{ matrix.configs.target }}
91+
./target/${{ matrix.configs.target }}/release/rbuilder version
9392
9493
- name: Upload artifact
9594
uses: actions/upload-artifact@v4

src/build_info.rs

+11-13
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ mod internal {
55
}
66

77
use internal::{
8-
BUILT_TIME_UTC, FEATURES, GIT_COMMIT_HASH_SHORT, GIT_DIRTY, GIT_HEAD_REF, PROFILE,
8+
BUILT_TIME_UTC, CI_PLATFORM, FEATURES, GIT_COMMIT_HASH_SHORT, GIT_HEAD_REF, PROFILE,
99
RUSTC_VERSION,
1010
};
1111
use rbuilder::utils::build_info::Version;
1212

1313
pub fn print_version_info() {
14-
println!("commit: {}", GIT_COMMIT_HASH_SHORT.unwrap_or_default());
15-
println!("dirty: {}", GIT_DIRTY.unwrap_or_default());
16-
println!("branch: {}", GIT_HEAD_REF.unwrap_or_default());
17-
println!("build_time: {}", BUILT_TIME_UTC);
18-
println!("rustc: {}", RUSTC_VERSION);
19-
println!("features: {:?}", FEATURES);
20-
println!("profile: {}", PROFILE);
14+
println!(
15+
"commit: {}",
16+
GIT_COMMIT_HASH_SHORT.unwrap_or_default()
17+
);
18+
println!("branch: {}", GIT_HEAD_REF.unwrap_or_default());
19+
println!("build_platform: {:?}", CI_PLATFORM.unwrap_or_default());
20+
println!("build_time: {}", BUILT_TIME_UTC);
21+
println!("features: {:?}", FEATURES);
22+
println!("profile: {}", PROFILE);
23+
println!("rustc: {}", RUSTC_VERSION);
2124
}
2225

2326
pub fn rbuilder_version() -> Version {
@@ -26,11 +29,6 @@ pub fn rbuilder_version() -> Version {
2629
if let Some(hash) = GIT_COMMIT_HASH_SHORT {
2730
commit.push_str(hash);
2831
}
29-
if let Some(dirty) = GIT_DIRTY {
30-
if dirty {
31-
commit.push_str("-dirty");
32-
}
33-
}
3432
if commit.is_empty() {
3533
commit.push_str("unknown");
3634
}

0 commit comments

Comments
 (0)