From 4428555a2a1c3bfe55e685d23c1e90409e2b37aa Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 4 Aug 2026 07:52:24 +0800 Subject: [PATCH 1/2] CI: Use main Ubuntu archive instead of azure.archive.ubuntu.com The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners regularly degrades to trickle speeds for extended periods, stalling package downloads until the job hits its timeout. This is a recurring upstream problem, see actions/runner-images issues #7048 and #12949. apt retries do not help because the connection stays alive, only slow. Switch affected jobs to archive.ubuntu.com, which is consistently fast from Azure. --- .github/scripts/install-deps.sh | 2 ++ .github/scripts/use-main-ubuntu-mirror.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 .github/scripts/use-main-ubuntu-mirror.sh diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh index dee1d5084b3..174c7a9558e 100755 --- a/.github/scripts/install-deps.sh +++ b/.github/scripts/install-deps.sh @@ -3,6 +3,8 @@ set -eu #Needed so CI fails when anything is wrong set -x +.github/scripts/use-main-ubuntu-mirror.sh + sudo apt-get --quiet update sudo apt-get install --yes --no-install-recommends devscripts equivs build-essential lintian clang debian/configure diff --git a/.github/scripts/use-main-ubuntu-mirror.sh b/.github/scripts/use-main-ubuntu-mirror.sh new file mode 100755 index 00000000000..8a5d12efbaa --- /dev/null +++ b/.github/scripts/use-main-ubuntu-mirror.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners +# regularly degrades to trickle speeds for extended periods, which stalls +# package downloads until the job hits its timeout. apt retries do not +# help because the connection stays alive, only slow. Switch to the main +# Ubuntu archive, which is consistently fast from Azure. + +set -eu #Needed so CI fails when anything is wrong +set -x + +for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do + [ -e "$f" ] || continue + sudo sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' "$f" +done From c2a90fa0f6f4880473fde8f2320bc5ec1f650124 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Thu, 6 Aug 2026 13:01:44 +0800 Subject: [PATCH 2/2] CI: rewrite apt-mirrors.txt so the mirror switch actually applies The runner image configures apt with URIs: mirror+file:///etc/apt/apt-mirrors.txt in ubuntu.sources, so the azure.archive.ubuntu.com URL lives in that file, not in sources.list or the .list/.sources files. The sed pass in 1d46401b07 therefore matched nothing and apt kept using the azure mirror; the rip-and-test job on this branch stalled in Install dependencies and was cancelled at the 45 minute timeout. Add /etc/apt/apt-mirrors.txt to the rewrite list and fail the step if any azure.archive.ubuntu.com reference survives under /etc/apt, so a future runner image layout change cannot turn this script into a silent no-op again. --- .github/scripts/use-main-ubuntu-mirror.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/scripts/use-main-ubuntu-mirror.sh b/.github/scripts/use-main-ubuntu-mirror.sh index 8a5d12efbaa..971633dbae5 100755 --- a/.github/scripts/use-main-ubuntu-mirror.sh +++ b/.github/scripts/use-main-ubuntu-mirror.sh @@ -1,15 +1,22 @@ #!/bin/sh # The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners -# regularly degrades to trickle speeds for extended periods, which stalls -# package downloads until the job hits its timeout. apt retries do not -# help because the connection stays alive, only slow. Switch to the main -# Ubuntu archive, which is consistently fast from Azure. +# regularly degrades to trickle speeds, stalling jobs until they time +# out. Switch to archive.ubuntu.com, which is consistently fast. set -eu #Needed so CI fails when anything is wrong set -x -for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do +# apt-mirrors.txt must be included: the runner image points apt at it +# via mirror+file:// in ubuntu.sources, so the azure URL lives there. +for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources /etc/apt/apt-mirrors.txt; do [ -e "$f" ] || continue sudo sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' "$f" done + +# Fail if azure is still referenced, so an image layout change cannot +# turn this script into a silent no-op. +if grep -rsq 'azure\.archive\.ubuntu\.com' /etc/apt; then + echo "error: azure.archive.ubuntu.com still referenced under /etc/apt after mirror switch" >&2 + exit 1 +fi