From 5d6c71cb3323b0cee5d8b3a531a292a85a0f5768 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Mon, 9 Sep 2024 17:17:05 +0000 Subject: [PATCH] nightly: use exact branch name in $BUILDVERSION_EXEC --- tools/helios-build/src/main.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/helios-build/src/main.rs b/tools/helios-build/src/main.rs index 0c12ad3..a0a2837 100644 --- a/tools/helios-build/src/main.rs +++ b/tools/helios-build/src/main.rs @@ -555,7 +555,11 @@ fn regen_illumos_sh>( * numbers: */ BuildType::Quick | BuildType::QuickDebug | BuildType::Full => { - let vers = "$(git describe --long --all HEAD | cut -d/ -f2-)"; + let vers = "$($(git describe --all --long --dirty \ + --match $(git branch --show-current) --exact-match \ + 2>/dev/null || \ + git describe --all --long --dirty) | \ + cut -d/ -f2-)"; (999999, vers.into(), "Oxide Helios Version ^v ^w-bit (onu)") } }; @@ -599,7 +603,12 @@ fn regen_illumos_sh>( smatch,$SMATCHBIN,smatch\"\n"; } } - env += "export BUILDVERSION_EXEC=\"git describe --all --long --dirty\"\n"; + env += "helios_build_buildversion_exec_function() { \n\ + git describe --all --long --dirty \ + --match $(git branch --show-current) --exact-match 2>/dev/null || \ + git describe --all --long --dirty \n\ + }\n"; + env += "export BUILDVERSION_EXEC=helios_build_buildversion_exec_function\n"; env += &format!("export DMAKE_MAX_JOBS={}\n", maxjobs); env += "export ENABLE_SMB_PRINTING='#'\n"; match relver {