Skip to content

Commit 5d6c71c

Browse files
committed
nightly: use exact branch name in $BUILDVERSION_EXEC
1 parent 5127748 commit 5d6c71c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/helios-build/src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,11 @@ fn regen_illumos_sh<P: AsRef<Path>>(
555555
* numbers:
556556
*/
557557
BuildType::Quick | BuildType::QuickDebug | BuildType::Full => {
558-
let vers = "$(git describe --long --all HEAD | cut -d/ -f2-)";
558+
let vers = "$($(git describe --all --long --dirty \
559+
--match $(git branch --show-current) --exact-match \
560+
2>/dev/null || \
561+
git describe --all --long --dirty) | \
562+
cut -d/ -f2-)";
559563
(999999, vers.into(), "Oxide Helios Version ^v ^w-bit (onu)")
560564
}
561565
};
@@ -599,7 +603,12 @@ fn regen_illumos_sh<P: AsRef<Path>>(
599603
smatch,$SMATCHBIN,smatch\"\n";
600604
}
601605
}
602-
env += "export BUILDVERSION_EXEC=\"git describe --all --long --dirty\"\n";
606+
env += "helios_build_buildversion_exec_function() { \n\
607+
git describe --all --long --dirty \
608+
--match $(git branch --show-current) --exact-match 2>/dev/null || \
609+
git describe --all --long --dirty \n\
610+
}\n";
611+
env += "export BUILDVERSION_EXEC=helios_build_buildversion_exec_function\n";
603612
env += &format!("export DMAKE_MAX_JOBS={}\n", maxjobs);
604613
env += "export ENABLE_SMB_PRINTING='#'\n";
605614
match relver {

0 commit comments

Comments
 (0)