From d577fc8307529613c03b7252de0b03ede7160c22 Mon Sep 17 00:00:00 2001 From: Techmore Date: Tue, 27 Oct 2026 06:32:31 -0400 Subject: [PATCH] fast-apt: replace the whole URIs line so the Azure mirror is really bypassed (port of OS repo #615) --- .github/actions/fast-apt/action.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/actions/fast-apt/action.yml b/.github/actions/fast-apt/action.yml index 3ba9fb4..ada00e4 100644 --- a/.github/actions/fast-apt/action.yml +++ b/.github/actions/fast-apt/action.yml @@ -1,8 +1,9 @@ name: Fast apt on arm64 runners description: >- Point Ubuntu package sources at the official ports mirror and set apt retry/timeout - defaults. The default Azure mirror took over 30 minutes for dependency installs on - arm64 runners (runs 40418762416, 40418762747). No-op on non-arm64 runners. + defaults. The default Azure mirror (azure.archive.ubuntu.com) took 15-34 minutes for + dependency installs on arm64 runners (runs 40418762416, 40418762747, 40482489505). + No-op on non-arm64 runners. Prints the resulting URIs so logs show it took effect. runs: using: composite steps: @@ -11,7 +12,15 @@ runs: [ "$(dpkg --print-architecture)" = arm64 ] || exit 0 printf 'Acquire::Retries "3";\nAcquire::http::Timeout "20";\nAcquire::https::Timeout "20";\n' \ | sudo tee /etc/apt/apt.conf.d/99ci-fast >/dev/null - for f in /etc/apt/sources.list.d/ubuntu.sources; do - [ -f "$f" ] && sudo sed -i -E 's#^URIs:.*(azure\.)?ports\.ubuntu\.com.*#URIs: http://ports.ubuntu.com/ubuntu-ports#; s#^URIs:.*archive\.ubuntu\.com.*#URIs: http://ports.ubuntu.com/ubuntu-ports#' "$f" - done - [ -f /etc/apt/sources.list ] && sudo sed -i -E 's#https?://[a-z.]*(azure\.)?(ports|archive)\.ubuntu\.com/ubuntu(-ports)?#http://ports.ubuntu.com/ubuntu-ports#g' /etc/apt/sources.list || true + f=/etc/apt/sources.list.d/ubuntu.sources + if [ -f "$f" ]; then + # Replace the whole line: the runner may use azure.archive.ubuntu.com or mirror+file:. + sudo sed -i -E 's#^URIs:.*#URIs: http://ports.ubuntu.com/ubuntu-ports#' "$f" + fi + if [ -f /etc/apt/sources.list ]; then + sudo sed -i -E 's#https?://[a-z.]*(archive|ports)\.ubuntu\.com/ubuntu(-ports)?/?#http://ports.ubuntu.com/ubuntu-ports#g' /etc/apt/sources.list + fi + echo "apt sources now:"; grep -h -E '^(URIs:|deb )' /etc/apt/sources.list.d/*.sources /etc/apt/sources.list 2>/dev/null || true + if grep -rqs 'azure.archive.ubuntu.com' /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null; then + echo "::warning::fast-apt: azure.archive.ubuntu.com is still configured" + fi