.github/workflows: resolve QEMU 10.x packages more flexibly (#444)
Closes #443
- commit
- 56b2dd8c83ff2a0095a9a7b576a85455e9ffe618
- author
- Travis Cline · · 2026-04-21 01:26 UTC
- committer
- GitHub · · 2026-04-21 01:26 UTC
- parent
- 386f7c8
- signature
- GPG Unverified
B5690EEEBB952194The key is unknown
1 file · +29 -9
M .github/workflows/test.yml +29 -9
| @@ -3,7 +3,7 @@ name: Test | |||
| 3 | 3 | on: [push, pull_request] | |
| 4 | 4 | ||
| 5 | 5 | env: | |
| 6 | - | QEMU_VERSION: "10.2.1+ds-1" | |
| 6 | + | QEMU_MAJOR_VERSION: "10" | |
| 7 | 7 | ||
| 8 | 8 | jobs: | |
| 9 | 9 | test: | |
| @@ -136,12 +136,22 @@ jobs: | |||
| 136 | 136 | sudo apt-get update | |
| 137 | 137 | sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-armhf-cross | |
| 138 | 138 | ||
| 139 | - | # Install QEMU 10.x from Debian trixie. Ubuntu 24.04 ships QEMU 8.2 | |
| 139 | + | # Install the latest QEMU 10.x package from Debian. Ubuntu 24.04 ships QEMU 8.2 | |
| 140 | 140 | # which has a bug where inter-thread signal delivery (tgkill) hangs, | |
| 141 | 141 | # causing TestSetuidEtc to deadlock. | |
| 142 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user_${QEMU_VERSION}_arm64.deb -O /tmp/qemu-user.deb | |
| 143 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-binfmt_${QEMU_VERSION}_arm64.deb -O /tmp/qemu-user-binfmt.deb | |
| 144 | - | sudo dpkg --force-depends -i /tmp/qemu-user.deb /tmp/qemu-user-binfmt.deb | |
| 142 | + | arch=$(dpkg --print-architecture) | |
| 143 | + | qemu_user_deb=$( | |
| 144 | + | curl -fsSL https://ftp.debian.org/debian/pool/main/q/qemu/ | | |
| 145 | + | grep -Eo "qemu-user_${QEMU_MAJOR_VERSION}\.[0-9.]+\+ds-[0-9]+([+~][A-Za-z0-9.+:~-]+)*_${arch}\.deb" | | |
| 146 | + | sort -V | | |
| 147 | + | tail -n 1 | |
| 148 | + | ) | |
| 149 | + | if [ -z "${qemu_user_deb}" ]; then | |
| 150 | + | echo "missing qemu-user ${QEMU_MAJOR_VERSION}.x package for ${arch}" >&2 | |
| 151 | + | exit 1 | |
| 152 | + | fi | |
| 153 | + | wget -q "https://ftp.debian.org/debian/pool/main/q/qemu/${qemu_user_deb}" -O /tmp/qemu-user.deb | |
| 154 | + | sudo dpkg --force-depends -i /tmp/qemu-user.deb | |
| 145 | 155 | sudo apt-get -f install -y | |
| 146 | 156 | ||
| 147 | 157 | # Create symlink for the dynamic linker that QEMU expects | |
| @@ -195,12 +205,22 @@ jobs: | |||
| 195 | 205 | gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \ | |
| 196 | 206 | gcc-s390x-linux-gnu g++-s390x-linux-gnu | |
| 197 | 207 | ||
| 198 | - | # Install QEMU 10.x from Debian trixie. Ubuntu 24.04 ships QEMU 8.2 | |
| 208 | + | # Install the latest QEMU 10.x package from Debian. Ubuntu 24.04 ships QEMU 8.2 | |
| 199 | 209 | # which has a bug where inter-thread signal delivery (tgkill) hangs, | |
| 200 | 210 | # causing TestSetuidEtc to deadlock. | |
| 201 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user_${QEMU_VERSION}_amd64.deb -O /tmp/qemu-user.deb | |
| 202 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-binfmt_${QEMU_VERSION}_amd64.deb -O /tmp/qemu-user-binfmt.deb | |
| 203 | - | sudo dpkg --force-depends -i /tmp/qemu-user.deb /tmp/qemu-user-binfmt.deb | |
| 211 | + | arch=$(dpkg --print-architecture) | |
| 212 | + | qemu_user_deb=$( | |
| 213 | + | curl -fsSL https://ftp.debian.org/debian/pool/main/q/qemu/ | | |
| 214 | + | grep -Eo "qemu-user_${QEMU_MAJOR_VERSION}\.[0-9.]+\+ds-[0-9]+([+~][A-Za-z0-9.+:~-]+)*_${arch}\.deb" | | |
| 215 | + | sort -V | | |
| 216 | + | tail -n 1 | |
| 217 | + | ) | |
| 218 | + | if [ -z "${qemu_user_deb}" ]; then | |
| 219 | + | echo "missing qemu-user ${QEMU_MAJOR_VERSION}.x package for ${arch}" >&2 | |
| 220 | + | exit 1 | |
| 221 | + | fi | |
| 222 | + | wget -q "https://ftp.debian.org/debian/pool/main/q/qemu/${qemu_user_deb}" -O /tmp/qemu-user.deb | |
| 223 | + | sudo dpkg --force-depends -i /tmp/qemu-user.deb | |
| 204 | 224 | sudo apt-get -f install -y | |
| 205 | 225 | ||
| 206 | 226 | # Verify that the expected QEMU binaries are installed and usable. | |
| @@ -3,7 +3,7 @@ name: Test | |||||
| 3 | on: [push, pull_request] | 3 | on: [push, pull_request] | ||
| 4 | 4 | ||||
| 5 | env: | 5 | env: | ||
| 6 | - | QEMU_VERSION: "10.2.1+ds-1" | 6 | + | QEMU_MAJOR_VERSION: "10" |
| 7 | 7 | ||||
| 8 | jobs: | 8 | jobs: | ||
| 9 | test: | 9 | test: | ||
| @@ -136,12 +136,22 @@ jobs: | |||||
| 136 | sudo apt-get update | 136 | sudo apt-get update | ||
| 137 | sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-armhf-cross | 137 | sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-armhf-cross | ||
| 138 | 138 | ||||
| 139 | - | # Install QEMU 10.x from Debian trixie. Ubuntu 24.04 ships QEMU 8.2 | 139 | + | # Install the latest QEMU 10.x package from Debian. Ubuntu 24.04 ships QEMU 8.2 |
| 140 | # which has a bug where inter-thread signal delivery (tgkill) hangs, | 140 | # which has a bug where inter-thread signal delivery (tgkill) hangs, | ||
| 141 | # causing TestSetuidEtc to deadlock. | 141 | # causing TestSetuidEtc to deadlock. | ||
| 142 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user_${QEMU_VERSION}_arm64.deb -O /tmp/qemu-user.deb | 142 | + | arch=$(dpkg --print-architecture) |
| 143 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-binfmt_${QEMU_VERSION}_arm64.deb -O /tmp/qemu-user-binfmt.deb | 143 | + | qemu_user_deb=$( |
| 144 | - | sudo dpkg --force-depends -i /tmp/qemu-user.deb /tmp/qemu-user-binfmt.deb | 144 | + | curl -fsSL https://ftp.debian.org/debian/pool/main/q/qemu/ | |
| 145 | + | grep -Eo "qemu-user_${QEMU_MAJOR_VERSION}\.[0-9.]+\+ds-[0-9]+([+~][A-Za-z0-9.+:~-]+)*_${arch}\.deb" | | |||
| 146 | + | sort -V | | |||
| 147 | + | tail -n 1 | |||
| 148 | + | ) | |||
| 149 | + | if [ -z "${qemu_user_deb}" ]; then | |||
| 150 | + | echo "missing qemu-user ${QEMU_MAJOR_VERSION}.x package for ${arch}" >&2 | |||
| 151 | + | exit 1 | |||
| 152 | + | fi | |||
| 153 | + | wget -q "https://ftp.debian.org/debian/pool/main/q/qemu/${qemu_user_deb}" -O /tmp/qemu-user.deb | |||
| 154 | + | sudo dpkg --force-depends -i /tmp/qemu-user.deb | |||
| 145 | sudo apt-get -f install -y | 155 | sudo apt-get -f install -y | ||
| 146 | 156 | ||||
| 147 | # Create symlink for the dynamic linker that QEMU expects | 157 | # Create symlink for the dynamic linker that QEMU expects | ||
| @@ -195,12 +205,22 @@ jobs: | |||||
| 195 | gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \ | 205 | gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \ | ||
| 196 | gcc-s390x-linux-gnu g++-s390x-linux-gnu | 206 | gcc-s390x-linux-gnu g++-s390x-linux-gnu | ||
| 197 | 207 | ||||
| 198 | - | # Install QEMU 10.x from Debian trixie. Ubuntu 24.04 ships QEMU 8.2 | 208 | + | # Install the latest QEMU 10.x package from Debian. Ubuntu 24.04 ships QEMU 8.2 |
| 199 | # which has a bug where inter-thread signal delivery (tgkill) hangs, | 209 | # which has a bug where inter-thread signal delivery (tgkill) hangs, | ||
| 200 | # causing TestSetuidEtc to deadlock. | 210 | # causing TestSetuidEtc to deadlock. | ||
| 201 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user_${QEMU_VERSION}_amd64.deb -O /tmp/qemu-user.deb | 211 | + | arch=$(dpkg --print-architecture) |
| 202 | - | wget -q https://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-binfmt_${QEMU_VERSION}_amd64.deb -O /tmp/qemu-user-binfmt.deb | 212 | + | qemu_user_deb=$( |
| 203 | - | sudo dpkg --force-depends -i /tmp/qemu-user.deb /tmp/qemu-user-binfmt.deb | 213 | + | curl -fsSL https://ftp.debian.org/debian/pool/main/q/qemu/ | |
| 214 | + | grep -Eo "qemu-user_${QEMU_MAJOR_VERSION}\.[0-9.]+\+ds-[0-9]+([+~][A-Za-z0-9.+:~-]+)*_${arch}\.deb" | | |||
| 215 | + | sort -V | | |||
| 216 | + | tail -n 1 | |||
| 217 | + | ) | |||
| 218 | + | if [ -z "${qemu_user_deb}" ]; then | |||
| 219 | + | echo "missing qemu-user ${QEMU_MAJOR_VERSION}.x package for ${arch}" >&2 | |||
| 220 | + | exit 1 | |||
| 221 | + | fi | |||
| 222 | + | wget -q "https://ftp.debian.org/debian/pool/main/q/qemu/${qemu_user_deb}" -O /tmp/qemu-user.deb | |||
| 223 | + | sudo dpkg --force-depends -i /tmp/qemu-user.deb | |||
| 204 | sudo apt-get -f install -y | 224 | sudo apt-get -f install -y | ||
| 205 | 225 | ||||
| 206 | # Verify that the expected QEMU binaries are installed and usable. | 226 | # Verify that the expected QEMU binaries are installed and usable. | ||