From 0c474a08fd9b2ce9d253fd45a6fb9d29cb1aac6a Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Mon, 10 Aug 2026 09:58:01 +0200 Subject: [PATCH] fix(build): cut the base version at v, not at the first 'v' room-server-v1.17.0 won describe, and find("v") landed inside "server" -- so every board built tonight would have called itself ver-v1.17.0-tth56e1. Earlier upstream tags (companion-, repeater-) have no 'v' in the prefix, which is why this only surfaced now. Co-Authored-By: Claude Opus 5 (1M context) --- tools/build_version.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/build_version.py b/tools/build_version.py index b245b1cd..17a96cc5 100644 --- a/tools/build_version.py +++ b/tools/build_version.py @@ -14,6 +14,7 @@ # FIRMWARE_BUILD_DATE (compile time). NOTE: the define changes every build = # full rebuild each time (~10-30 s) -- the price for an always-fresh timestamp. Import("env") +import re import subprocess from datetime import datetime @@ -41,8 +42,12 @@ try: tag = git(cwd, "describe", "--tags", "--abbrev=0", "--match", "*v[0-9]*", "--exclude", "*+tth*", "--exclude", "backup/*") - i = tag.find("v") - base = tag[i:] if i >= 0 else tag + # Cut at the 'v' that STARTS THE VERSION, not at the first 'v' in the tag: + # "room-server-v1.17.0" has one in "server", and find("v") turned the base + # into "ver-v1.17.0". Every earlier upstream tag we saw (companion-, repeater-) + # happened to have no 'v' in its prefix, so this hid until v1.17.0. + m = re.search(r"v[0-9]", tag) + base = tag[m.start():] if m else tag except Exception: pass