Skip to content

Commit 01bafe8

Browse files
committed
CI: Fix ARM64 apt-get dep11 metadata failures
Fix regression where apt update exits with code 100 due to dep11 (AppStream metadata) mirror sync failures, causing ARM64 CI builds to fail even when core package indices are available. Root Cause: - Ubuntu mirrors occasionally have size mismatches for dep11 metadata during synchronization (e.g., Components-arm64.yml.gz files) - apt update returns exit code 100 when ANY file fails to download - Previous logic required APT_EXIT == 0 AND no critical failures - This meant dep11 failures (non-critical) caused retries and eventual failure after 3 attempts Issue Example: E: Failed to fetch .../dep11/Components-arm64.yml.gz File has unexpected size (3692 != 3697). Mirror sync in progress? E: Some index files failed to download. They have been ignored, or old ones used instead. Error: The process failed with exit code 100 Fix Strategy: - Check ONLY for critical package index failures (Packages/Sources/ Release/InRelease), not exit code - dep11 metadata failures are non-critical (GUI application metadata) - Core build tools (make, git, curl, clang, bc) don't require dep11 - If core indices available, proceed regardless of dep11 status
1 parent b7dd6a7 commit 01bafe8

File tree

1 file changed

+66
-17
lines changed

1 file changed

+66
-17
lines changed

.github/workflows/main.yml

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -343,39 +343,88 @@ 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
346+
# dep11 = AppStream metadata (GUI app discovery, non-critical for CLI builds)
347+
# Critical files: Packages, Sources, Release, InRelease (binary/source indices)
347348
set -o pipefail
349+
APT_SUCCESS=0
348350
for i in 1 2 3; do
351+
echo "=== apt update attempt $i/3 ==="
349352
if apt update -qq --allow-releaseinfo-change 2>&1 | tee /tmp/apt-update.log; then
350353
APT_EXIT=0
351354
else
352355
APT_EXIT=$?
353356
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)"
358-
break
357+
358+
# Check if log file was created
359+
if [ ! -f /tmp/apt-update.log ]; then
360+
echo "ERROR: apt update log file not created"
361+
if [ $i -lt 3 ]; then
362+
sleep $((i * 30))
363+
continue
364+
else
365+
exit 1
366+
fi
359367
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
368+
369+
# Check for critical package index failures (ignore dep11 metadata)
370+
# dep11 files like Components-arm64.yml.gz are non-critical (AppStream metadata)
371+
# Core package indices (Packages/Sources/Release/InRelease) MUST succeed
372+
if grep -q -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log; then
373+
# Critical failure detected
374+
echo "ERROR: Critical package index files failed to download"
375+
grep -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log | head -5
376+
if [ $i -lt 3 ]; then
377+
delay=$((i * 30))
378+
echo "Retrying in ${delay}s... (attempt $((i + 1))/3)"
379+
sleep $delay
380+
else
381+
echo "FATAL: Core package indices unavailable after 3 attempts"
382+
cat /tmp/apt-update.log
383+
exit 1
384+
fi
364385
else
365-
echo "Warning: Proceeding after 3 attempts - some package lists may be incomplete"
386+
# Success: core package indices available (dep11 failures OK)
387+
APT_SUCCESS=1
388+
if [ $APT_EXIT -eq 0 ]; then
389+
echo "✓ apt update succeeded (all package lists available)"
390+
else
391+
echo "✓ apt update completed with warnings (exit=$APT_EXIT)"
392+
echo " Core package indices: AVAILABLE"
393+
if grep -q "dep11" /tmp/apt-update.log; then
394+
echo " dep11 metadata: INCOMPLETE (non-critical, GUI app metadata)"
395+
fi
396+
fi
397+
break
366398
fi
367399
done
368-
# Install packages - exit 0 even if dep11 metadata is incomplete
400+
401+
# Verify we succeeded in at least one attempt
402+
if [ $APT_SUCCESS -ne 1 ]; then
403+
echo "FATAL: apt update failed after all retry attempts"
404+
exit 1
405+
fi
406+
407+
# Install packages (exit 0 even if dep11 metadata is incomplete)
408+
echo "=== Installing build dependencies ==="
369409
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
410+
411+
# Verify critical packages were installed successfully
412+
echo "=== Verifying critical build tools ==="
413+
MISSING_PKGS=""
371414
for pkg in make git curl clang bc; do
372415
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
416+
MISSING_PKGS="$MISSING_PKGS $pkg"
376417
fi
377418
done
378-
echo "All critical build tools installed successfully"
419+
420+
if [ -n "$MISSING_PKGS" ]; then
421+
echo "ERROR: Critical packages failed to install:$MISSING_PKGS"
422+
echo "=== apt install log ==="
423+
cat /tmp/apt-install.log
424+
exit 1
425+
fi
426+
427+
echo "✓ All critical build tools installed successfully"
379428
# FIXME: gcc build fails on Aarch64/Linux hosts
380429
env: |
381430
CC: clang-18

0 commit comments

Comments
 (0)