Skip to content

Commit da94cc1

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 uses '|| true' to prevent the exit code from failing the action, then manually checks for critical package index failures (Packages/Sources/ Release/InRelease). Non-critical dep11 metadata failures are ignored. Package installation uses apt-get with --fix-missing for robustness. Also fixes stale build configuration bug where 'make clean' doesn't regenerate build/.config, causing JIT extension tests to fail with 'map_file() (null) failed' errors. Changed to 'make distclean' for proper configuration reset between test runs.
1 parent b7dd6a7 commit da94cc1

File tree

1 file changed

+66
-29
lines changed

1 file changed

+66
-29
lines changed

.github/workflows/main.yml

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ jobs:
238238
ENABLE_Zicsr ENABLE_Zifencei \
239239
ENABLE_MOP_FUSION ENABLE_BLOCK_CHAINING; do
240240
echo "JIT test with ${ext}=0"
241-
if ! (make ENABLE_JIT=1 clean && make ${ext}=0 ENABLE_JIT=1 check $PARALLEL); then
241+
if ! (make distclean && make ${ext}=0 ENABLE_JIT=1 check $PARALLEL); then
242242
echo "ERROR: JIT test failed with ${ext}=0"
243243
exit 1
244244
fi
@@ -343,39 +343,76 @@ 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+
# Force success even with dep11 failures (we check for critical failures below)
353+
apt update --allow-releaseinfo-change 2>&1 | tee /tmp/apt-update.log || true
354+
APT_EXIT=${PIPESTATUS[0]:-$?} # Capture apt update exit code, not tee
355+
356+
# Check for critical package index failures (ignore dep11 metadata)
357+
# dep11 files like Components-arm64.yml.gz are non-critical (AppStream metadata)
358+
# Core package indices (Packages/Sources/Release/InRelease) MUST succeed
359+
if grep -q -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log 2>/dev/null; then
360+
# Critical failure detected
361+
echo "ERROR: Critical package index files failed to download"
362+
grep -E "Failed to fetch.*/(Packages|Sources|Release|InRelease)" /tmp/apt-update.log | head -5
363+
if [ $i -lt 3 ]; then
364+
delay=$((i * 30))
365+
echo "Retrying in ${delay}s... (attempt $((i + 1))/3)"
366+
sleep $delay
367+
else
368+
echo "FATAL: Core package indices unavailable after 3 attempts"
369+
cat /tmp/apt-update.log
370+
exit 1
371+
fi
351372
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)"
373+
# Success: core package indices available (dep11 failures OK)
374+
APT_SUCCESS=1
375+
if [ $APT_EXIT -eq 0 ]; then
376+
echo "✓ apt update succeeded (all package lists available)"
377+
else
378+
echo "✓ apt update completed with warnings (exit=$APT_EXIT)"
379+
echo " Core package indices: AVAILABLE"
380+
if grep -q "dep11" /tmp/apt-update.log 2>/dev/null; then
381+
echo " dep11 metadata: INCOMPLETE (non-critical, GUI app metadata)"
382+
echo " Ignoring dep11 failures - build dependencies will install correctly"
383+
fi
384+
fi
358385
break
359386
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
367387
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
388+
389+
# Verify we succeeded in at least one attempt
390+
if [ $APT_SUCCESS -ne 1 ]; then
391+
echo "FATAL: apt update failed after all retry attempts"
392+
exit 1
393+
fi
394+
395+
# Install packages (dep11 metadata failures are benign)
396+
echo "=== Installing build dependencies ==="
397+
set -e # Re-enable exit on error for package installation
398+
apt-get install -yqq --fix-missing \
399+
make git curl wget clang libsdl2-dev libsdl2-mixer-dev lsb-release software-properties-common gnupg bc
400+
401+
# Verify critical packages were installed successfully
402+
echo "=== Verifying critical build tools ==="
403+
MISSING_PKGS=""
371404
for pkg in make git curl clang bc; do
372405
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
406+
MISSING_PKGS="$MISSING_PKGS $pkg"
376407
fi
377408
done
378-
echo "All critical build tools installed successfully"
409+
410+
if [ -n "$MISSING_PKGS" ]; then
411+
echo "ERROR: Critical packages failed to install:$MISSING_PKGS"
412+
exit 1
413+
fi
414+
415+
echo "✓ All critical build tools installed successfully"
379416
# FIXME: gcc build fails on Aarch64/Linux hosts
380417
env: |
381418
CC: clang-18
@@ -405,9 +442,9 @@ jobs:
405442
make $PARALLEL
406443
make check $PARALLEL
407444
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 check $PARALLEL
408-
make ENABLE_JIT=1 clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check $PARALLEL
409-
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check $PARALLEL
410-
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check $PARALLEL
445+
make distclean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check $PARALLEL
446+
make distclean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check $PARALLEL
447+
make distclean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check $PARALLEL
411448
# TSAN on ARM64: Fixed memory layout (0x150000000000 for main, 0x151000000000 for JIT)
412449
set -o pipefail
413450
echo "=== TSAN Test 1/3: Interpreter + FULL4G (ARM64) ==="
@@ -601,7 +638,7 @@ jobs:
601638
ENABLE_Zicsr ENABLE_Zifencei \
602639
ENABLE_MOP_FUSION ENABLE_BLOCK_CHAINING; do
603640
echo "JIT test with ${ext}=0"
604-
if ! (make ENABLE_JIT=1 clean && make ${ext}=0 ENABLE_JIT=1 check $PARALLEL); then
641+
if ! (make distclean && make ${ext}=0 ENABLE_JIT=1 check $PARALLEL); then
605642
echo "ERROR: JIT test failed with ${ext}=0"
606643
exit 1
607644
fi

0 commit comments

Comments
 (0)