Skip to content

Commit 69d482f

Browse files
committed
.github/zephyr: simplify and fix the git describe performance hack
Fixes the git describe/tag performance hack added in commit 2328478 (".github/zephyr.yml: fix tags missing from `git -C zephyr/ describe`") which worked for an amazingly long time (1.5 year) but apparently ran its course. Git version 2.48 apparently does not like it anymore. Replace it with something slower but simpler and safer. Should fix build reproducibility issue #9797, much more details there. Also fixes commit 4bc6488 (".github/zephyr: de-hardcode the name of the zephyr remote") Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent 503ae3e commit 69d482f

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/zephyr.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,17 @@ jobs:
179179
# does not use --tags.
180180
#
181181
# 2. west fetches using the remote URL, not the remote name. So remote
182-
# branches (if any) are missing from --decorate below
183-
#
184-
# => an "empty" and quick fetch _with_ a refspec and the remote name fixes
185-
# both issues in no time.
182+
# branches are missing from --decorate below. Cosmetic but annoying;
183+
# especially in the "zmain" case.
186184
187185
cd zephyr
188-
time git fetch --filter=tree:0 "$(git remote |head -n1)" "$rem_rev":_branch_placeholder
189-
git branch -D _branch_placeholder
186+
# Fix problem 1. Indirectly fetches useless branches but seems quick enough
187+
# thanks to the --filter
188+
time git fetch --tags
189+
# Fix problem 2.
190+
_zurl=$(west list -f '{url}' zephyr)
191+
git remote add sof_zep_rem "$_zurl"
192+
time git fetch sof_zep_rem "$rem_rev"
190193
191194
set -x
192195
west list
@@ -327,11 +330,16 @@ jobs:
327330
west init -l sof
328331
west update --narrow --fetch-opt=--filter=tree:0
329332
330-
# Get some tags to fix `git describe`, see build-linux comments above.
333+
# Get some tags to fix `git describe` etc., see detailed build-linux comments above.
331334
cd zephyr
335+
git fetch --tags
336+
332337
$_rev = "$(git rev-parse HEAD)"
333-
git fetch --filter=tree:0 "$(west list -f '{url}' zephyr)" "${_rev}:_branch_placeholder"
334-
git branch -D _branch_placeholder
338+
$_zurl = "$(west list -f '{url}' zephyr)"
339+
git remote add sof_zep_rem "${_zurl}"
340+
# Unlike Linux above, hardcode "main" for now. Will make no difference most
341+
# of the time but keeps this bit consistent with Linux, tested and ready to use.
342+
git fetch sof_zep_rem main
335343
336344
337345
# Call Setup Python again to save the PIP packages in cache

0 commit comments

Comments
 (0)