Skip to content

Commit e425f7f

Browse files
committed
Make sure to error on bad arch
1 parent fd42a52 commit e425f7f

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

test/distro-qemu/build-and-run.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ case "$QEMU_ARCH" in
3636
aarch64)
3737
DEBOOTSTRAP_ARCH="arm64"
3838
;;
39+
*)
40+
echo "Unsupported QEMU_ARCH: $QEMU_ARCH"
41+
exit 1
42+
;;
3943
esac
4044

45+
GOARCH=$DEBOOTSTRAP_ARCH
46+
4147
# Choose mirror based on distro and architecture
4248
if [[ "$DISTRO" == "ubuntu" ]]; then
4349
# Ubuntu ARM64 packages are on ports.ubuntu.com
@@ -63,17 +69,6 @@ sudo chown -R "$(id -u):$(id -g)" "$ROOTFS_DIR"
6369
# Build the test binary (must be dynamic for dlopen to work)
6470
echo "Building test binary for $DISTRO $RELEASE $DEBOOTSTRAP_ARCH..."
6571

66-
# Determine Go architecture
67-
GOARCH="amd64"
68-
case "$QEMU_ARCH" in
69-
x86_64)
70-
GOARCH="amd64"
71-
;;
72-
aarch64)
73-
GOARCH="arm64"
74-
;;
75-
esac
76-
7772
# For cross-compilation or Ubuntu jammy/noble, local build works (host has compatible or newer glibc)
7873
# For older distros, would need Docker build (disabled by default for speed)
7974
if [[ "${USE_DOCKER}" == "1" ]] && command -v docker &> /dev/null; then

0 commit comments

Comments
 (0)