fix: Zig transitve failure failsafe (#4464) (#4466)

(cherry picked from commit 5e63223d90)

Signed-off-by: Gilver <rockgrub@disroot.org>
Co-authored-by: Gilver <rockgrub@disroot.org>
This commit is contained in:
Raboneko
2025-04-27 09:16:49 -07:00
committed by GitHub
parent ba6e7d07e5
commit c2a939dbe8
+13 -11
View File
@@ -156,21 +156,23 @@ help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=vers
%if %{with docs}
# Use the newly made stage 3 compiler to generate docs
# Zig has an extremely annoying issue with transitive failures when trying to build the docs, retry until it succeeds
r=3
for ((i=0; i<r; i++)); do
./zig-out/bin/zig build docs \
max=3
attempt=1
while ./zig-out/bin/zig build docs \
--verbose \
--global-cache-dir "%{zig_cache_dir}" \
-Dversion-string="%(v=%{ver}; echo ${v:0:6})"
[[ $? -eq 0 ]] && break
-Dversion-string="%(v=%{ver}; echo ${v:0:6})"; [[ $? -ne 0 ]];
do
echo "Transitive failure. Trying again."
echo "Transitive failure. Trying again."
if [[ $attempt -eq $max ]]
then
break
fi
sleep 1
((attempt++))
done
(( r == i )) && { exit 1; }
exit 0
%endif
%install