diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ba03923..20ee6ab3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,46 +132,46 @@ jobs: - name: go test (Linux 386) if: ${{ runner.os == 'Linux' && runner.arch != 'ARM64' }} run: | - sudo apt-get update - sudo apt-get install gcc-multilib - sudo apt-get install g++-multilib - env CGO_ENABLED=0 GOARCH=386 go test -shuffle=on -v -count=10 ./... - env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./... + sudo apt-get update + sudo apt-get install gcc-multilib + sudo apt-get install g++-multilib + env CGO_ENABLED=0 GOARCH=386 go test -shuffle=on -v -count=10 ./... + env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./... - name: go test (Linux arm) if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }} run: | - sudo apt-get update - sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-armhf-cross - - # Install the latest QEMU 10.x package from Debian. Ubuntu 24.04 ships QEMU 8.2 - # which has a bug where inter-thread signal delivery (tgkill) hangs, - # causing TestSetuidEtc to deadlock. - arch=$(dpkg --print-architecture) - qemu_user_deb=$( - curl -fsSL https://ftp.debian.org/debian/pool/main/q/qemu/ | - grep -Eo "qemu-user_${QEMU_MAJOR_VERSION}\.[0-9.]+\+ds-[0-9]+([+~][A-Za-z0-9.+:~-]+)*_${arch}\.deb" | - sort -V | - tail -n 1 - ) - if [ -z "${qemu_user_deb}" ]; then - echo "missing qemu-user ${QEMU_MAJOR_VERSION}.x package for ${arch}" >&2 - exit 1 - fi - wget -q "https://ftp.debian.org/debian/pool/main/q/qemu/${qemu_user_deb}" -O /tmp/qemu-user.deb - sudo dpkg --force-depends -i /tmp/qemu-user.deb - sudo apt-get -f install -y - - # Create symlink for the dynamic linker that QEMU expects - sudo ln -sf /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3 - go env -w CC=arm-linux-gnueabihf-gcc - go env -w CXX=arm-linux-gnueabihf-g++ - env GOOS=linux GOARCH=arm CGO_ENABLED=0 go test -c -o=purego-test-nocgo . - env QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf qemu-arm ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10 - env GOOS=linux GOARCH=arm CGO_ENABLED=1 go test -c -o=purego-test-cgo . - env QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf qemu-arm ./purego-test-cgo -test.shuffle=on -test.v -test.count=10 - go env -u CC - go env -u CXX + sudo apt-get update + sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-armhf-cross + + # Install the latest QEMU 10.x package from Debian. Ubuntu 24.04 ships QEMU 8.2 + # which has a bug where inter-thread signal delivery (tgkill) hangs, + # causing TestSetuidEtc to deadlock. + arch=$(dpkg --print-architecture) + qemu_user_deb=$( + curl -fsSL https://ftp.debian.org/debian/pool/main/q/qemu/ | + grep -Eo "qemu-user_${QEMU_MAJOR_VERSION}\.[0-9.]+\+ds-[0-9]+([+~][A-Za-z0-9.+:~-]+)*_${arch}\.deb" | + sort -V | + tail -n 1 + ) + if [ -z "${qemu_user_deb}" ]; then + echo "missing qemu-user ${QEMU_MAJOR_VERSION}.x package for ${arch}" >&2 + exit 1 + fi + wget -q "https://ftp.debian.org/debian/pool/main/q/qemu/${qemu_user_deb}" -O /tmp/qemu-user.deb + sudo dpkg --force-depends -i /tmp/qemu-user.deb + sudo apt-get -f install -y + + # Create symlink for the dynamic linker that QEMU expects + sudo ln -sf /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3 + go env -w CC=arm-linux-gnueabihf-gcc + go env -w CXX=arm-linux-gnueabihf-g++ + env GOOS=linux GOARCH=arm CGO_ENABLED=0 go test -c -o=purego-test-nocgo . + env QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf qemu-arm ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10 + env GOOS=linux GOARCH=arm CGO_ENABLED=1 go test -c -o=purego-test-cgo . + env QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf qemu-arm ./purego-test-cgo -test.shuffle=on -test.v -test.count=10 + go env -u CC + go env -u CXX - name: go test race (no Cgo) if: runner.os == 'macOS'