@@ -117,28 +117,51 @@ jobs:
117117 shell : bash
118118 run : |
119119 set -euo pipefail
120- sudo apt-get update
121120
122- if [ "${{ matrix.name }}" = "linux-x86" ]; then
123- # 32-bit x86 target on x86_64 host
124- sudo apt-get install -y zip gcc-multilib g++-multilib libc6-dev-i386 pkg-config
125- sudo dpkg --add-architecture i386
126- sudo apt-get update
127- sudo apt-get install -y libsodium-dev:i386
128-
129- elif [ "${{ matrix.name }}" = "linux-armv7" ]; then
130- # ARMv7 (armhf) cross-compile on x86_64 host
121+ if [ "${{ matrix.name }}" = "linux-armv7" ]; then
122+ # 1) Ensure default Ubuntu sources apply ONLY to amd64 (avoid armhf hitting security.ubuntu.com -> 404)
123+ if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
124+ if ! grep -q '^Architectures: .*amd64' /etc/apt/sources.list.d/ubuntu.sources; then
125+ sudo sed -i 's/^Types: deb$/Types: deb\nArchitectures: amd64/g' /etc/apt/sources.list.d/ubuntu.sources
126+ fi
127+ elif [ -f /etc/apt/sources.list ]; then
128+ # Older style sources.list: keep it as-is; we'll add a separate armhf list below.
129+ true
130+ fi
131+
132+ # 2) Add an armhf-only "ports" source (this is where armhf packages live)
133+ sudo tee /etc/apt/sources.list.d/armhf-ports.sources >/dev/null <<'EOF'
134+ Types : deb
135+ URIs : http://ports.ubuntu.com/ubuntu-ports
136+ Suites : noble noble-updates noble-backports noble-security
137+ Components : main universe multiverse restricted
138+ Architectures : armhf
139+ Signed-By : /usr/share/keyrings/ubuntu-archive-keyring.gpg
140+ EOF
141+
142+ # 3) Enable armhf arch + update indexes
131143 sudo dpkg --add-architecture armhf
132144 sudo apt-get update
145+
146+ # 4) ARMv7 (armhf) cross toolchain + libsodium armhf
133147 sudo apt-get install -y zip pkg-config \
134148 gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
135149 libsodium-dev:armhf
136150
137151 else
138- sudo apt-get install -y zip libsodium-dev
152+ sudo apt-get update
153+
154+ if [ "${{ matrix.name }}" = "linux-x86" ]; then
155+ sudo apt-get install -y zip gcc-multilib g++-multilib libc6-dev-i386 pkg-config
156+ sudo dpkg --add-architecture i386
157+ sudo apt-get update
158+ sudo apt-get install -y libsodium-dev:i386
159+ else
160+ sudo apt-get install -y zip libsodium-dev
161+ fi
139162 fi
140163
141- # Host tools (OK to be x86_64 / aarch64 host)
164+ # Host tools (fine to be host-arch )
142165 /home/linuxbrew/.linuxbrew/bin/brew install ninja llvm
143166
144167 - name : Install dependencies (Windows)
0 commit comments