Skip to content

Commit 919f33c

Browse files
committed
CI: Fix ARM64 apt-get dep11 metadata failures
ARM64 CI builds fail when apt update returns exit code 100 due to dep11 metadata size mismatches during Ubuntu mirror synchronization. The fix distinguishes between critical package index failures (Packages/Sources/Release/InRelease) and non-critical dep11 metadata failures (AppStream GUI application metadata). Builds proceed if core package indices are available, ignoring dep11 transient sync issues.
1 parent b7dd6a7 commit 919f33c

File tree

1 file changed

+59
-24
lines changed

1 file changed

+59
-24
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -343,39 +343,74 @@ jobs:
343343
# No 'sudo' is available
344344
install: |
345345
# Retry apt update with exponential backoff for mirror sync issues
346-
# Note: dep11 (AppStream metadata) failures are non-critical for build tools
347-
set -o pipefail
346+
# dep11 = AppStream metadata (GUI app discovery, non-critical for CLI builds)
347+
# Critical files: Packages, Sources, Release, InRelease (binary/source indices)
348+
set +e # Don't exit on apt update failure, we'll handle it manually
349+
APT_SUCCESS=0
348350
for i in 1 2 3; do
349-
if apt update -qq --allow-releaseinfo-change 2>&1 | tee /tmp/apt-update.log; then
350-
APT_EXIT=0
351+
echo "=== apt update attempt $i/3 ==="
352+
apt update --allow-releaseinfo-change 2>&1 | tee /tmp/apt-update.log
353+
APT_EXIT=$?
354+
355+
# Check for critical package index failures (ignore dep11 metadata)
356+
# dep11 files like Components-arm64.yml.gz are non-critical (AppStream metadata)
357+
# Core package indices (Packages/Sources/Release/InRelease) MUST succeed
358+
if grep -q -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log 2>/dev/null; then
359+
# Critical failure detected
360+
echo "ERROR: Critical package index files failed to download"
361+
grep -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log | head -5
362+
if [ $i -lt 3 ]; then
363+
delay=$((i * 30))
364+
echo "Retrying in ${delay}s... (attempt $((i + 1))/3)"
365+
sleep $delay
366+
else
367+
echo "FATAL: Core package indices unavailable after 3 attempts"
368+
cat /tmp/apt-update.log
369+
exit 1
370+
fi
351371
else
352-
APT_EXIT=$?
353-
fi
354-
# Check for critical failures (package indices), ignore dep11 metadata
355-
# Include InRelease which is the combined Release+Release.gpg file
356-
if [ $APT_EXIT -eq 0 ] && ! grep -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log; then
357-
echo "apt update succeeded (core package lists available)"
372+
# Success: core package indices available (dep11 failures OK)
373+
APT_SUCCESS=1
374+
if [ $APT_EXIT -eq 0 ]; then
375+
echo "✓ apt update succeeded (all package lists available)"
376+
else
377+
echo "✓ apt update completed with warnings (exit=$APT_EXIT)"
378+
echo " Core package indices: AVAILABLE"
379+
if grep -q "dep11" /tmp/apt-update.log 2>/dev/null; then
380+
echo " dep11 metadata: INCOMPLETE (non-critical, GUI app metadata)"
381+
echo " Ignoring dep11 failures - build dependencies will install correctly"
382+
fi
383+
fi
358384
break
359385
fi
360-
if [ $i -lt 3 ]; then
361-
delay=$((i * 30))
362-
echo "apt update attempt $i: errors detected (exit=$APT_EXIT), waiting ${delay}s..."
363-
sleep $delay
364-
else
365-
echo "Warning: Proceeding after 3 attempts - some package lists may be incomplete"
366-
fi
367386
done
368-
# Install packages - exit 0 even if dep11 metadata is incomplete
369-
apt install -yqq make git curl wget clang libsdl2-dev libsdl2-mixer-dev lsb-release software-properties-common gnupg bc 2>&1 | tee /tmp/apt-install.log || true
370-
# Verify critical packages were installed
387+
388+
# Verify we succeeded in at least one attempt
389+
if [ $APT_SUCCESS -ne 1 ]; then
390+
echo "FATAL: apt update failed after all retry attempts"
391+
exit 1
392+
fi
393+
394+
# Install packages (dep11 metadata failures are benign)
395+
echo "=== Installing build dependencies ==="
396+
set -e # Re-enable exit on error for package installation
397+
apt install -yqq make git curl wget clang libsdl2-dev libsdl2-mixer-dev lsb-release software-properties-common gnupg bc
398+
399+
# Verify critical packages were installed successfully
400+
echo "=== Verifying critical build tools ==="
401+
MISSING_PKGS=""
371402
for pkg in make git curl clang bc; do
372403
if ! command -v $pkg >/dev/null 2>&1; then
373-
echo "ERROR: Critical package $pkg failed to install!"
374-
cat /tmp/apt-install.log
375-
exit 1
404+
MISSING_PKGS="$MISSING_PKGS $pkg"
376405
fi
377406
done
378-
echo "All critical build tools installed successfully"
407+
408+
if [ -n "$MISSING_PKGS" ]; then
409+
echo "ERROR: Critical packages failed to install:$MISSING_PKGS"
410+
exit 1
411+
fi
412+
413+
echo "✓ All critical build tools installed successfully"
379414
# FIXME: gcc build fails on Aarch64/Linux hosts
380415
env: |
381416
CC: clang-18

0 commit comments

Comments
 (0)