From 2798910293a0330f43504337e72dd182bca370cc Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Tue, 7 Apr 2026 18:11:55 -0700 Subject: [PATCH] ci(ubuntu): use AWS regional mirror for apt in compile workflow The compile_ubuntu workflow's apt operations talk directly to archive.ubuntu.com, which round-robins across community mirrors that occasionally serve out-of-sync index files mid-sync and break apt update for everyone until the upstream catches up. Apply the same mirror swap as build_deb_package.yml: rewrite the container's apt sources to point at us-west-2.ec2.archive.ubuntu.com before any apt operation runs, so both the inline 'apt update' and the later Tools/setup/ubuntu.sh call benefit from the regional mirror. Signed-off-by: Ramon Roche --- .github/workflows/compile_ubuntu.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/compile_ubuntu.yml b/.github/workflows/compile_ubuntu.yml index 019081b9f6..3502a19d2b 100644 --- a/.github/workflows/compile_ubuntu.yml +++ b/.github/workflows/compile_ubuntu.yml @@ -38,6 +38,17 @@ jobs: - name: Fix git in container run: | + # Switch to AWS regional mirrors. runs-on instances are in us-west-2, + # and the EC2 archive mirrors are Canonical-operated, region-local, + # and sync aggressively. The default archive.ubuntu.com round-robin + # sometimes serves out-of-sync index files mid-sync, breaking + # apt-get update. + if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then + sed -i 's|http://archive.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list.d/ubuntu.sources + fi + if [ -f /etc/apt/sources.list ]; then + sed -i 's|http://archive.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list + fi # we only need this because we are running the job in a container # when checkout pulls git it does it in a shared volume # and file ownership changes between steps