Skip to content

Commit f566ef9

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/helios-build/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ 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 = "$(helios_build_git_version_func | cut -d/ -f2-)";
559559
(999999, vers.into(), "Oxide Helios Version ^v ^w-bit (onu)")
560560
}
561561
};
@@ -564,6 +564,11 @@ fn regen_illumos_sh<P: AsRef<Path>>(
564564
* Construct an environment file to build illumos-gate.
565565
*/
566566
let mut env = String::new();
567+
env += "helios_build_git_version_func() {\n \
568+
git describe --all --long --dirty \
569+
--match $(git branch --show-current) --exact-match 2>/dev/null || \
570+
git describe --all --long --dirty\n\
571+
}\n";
567572
match bt {
568573
BuildType::Full => env += "export NIGHTLY_OPTIONS='-nCDAprt'\n",
569574
BuildType::Release => env += "export NIGHTLY_OPTIONS='-nCDAprt'\n",
@@ -599,7 +604,7 @@ fn regen_illumos_sh<P: AsRef<Path>>(
599604
smatch,$SMATCHBIN,smatch\"\n";
600605
}
601606
}
602-
env += "export BUILDVERSION_EXEC=\"git describe --all --long --dirty\"\n";
607+
env += "export BUILDVERSION_EXEC=helios_build_git_version_func\n";
603608
env += &format!("export DMAKE_MAX_JOBS={}\n", maxjobs);
604609
env += "export ENABLE_SMB_PRINTING='#'\n";
605610
match relver {

0 commit comments

Comments
 (0)