From 8b6a585250b822bf9e305c53fde96ae772b53bbf Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sat, 22 Jan 2022 23:03:47 +0200 Subject: [PATCH] =?UTF-8?q?build:=20=F0=9F=9B=A0=20Set=20machine=20ID=20fo?= =?UTF-8?q?r=20QEMU=20versions=20after=206.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Work around ancient QEMU versions on CI boxes. --- .github/workflows/build.yml | 7 ++++++- Makefile.toml | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81ad3ed..adcfc56 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,8 +101,13 @@ jobs: - name: 'Build kernel' run: cargo make build - - name: 'Run tests' + - name: 'Run tests (macOS)' run: cargo make test + if: runner.os == 'macOS' + + - name: 'Run tests (other OSes)' + run: env QEMU_MACHINE=raspi3 cargo make test + if: runner.os != 'macOS' check_formatting: name: "Check Formatting" diff --git a/Makefile.toml b/Makefile.toml index d697f9f..a4b8552 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -22,6 +22,8 @@ TARGET_BOARD = { value = "rpi4", condition = { env_not_set = ["TARGET_BOARD"] } # AArch64 QEMU binary QEMU = { value = "qemu-system-aarch64", condition = { env_not_set = ["QEMU"] } } +# QEMU machine type, defaults to raspi3b but CI runners override it due to ancient QEMU versions they use. +QEMU_MACHINE = { value = "raspi3b", condition = { env_not_set = ["QEMU_MACHINE"] } } # An aarch64-enabled GDB GDB = { value = "/usr/local/opt/gdb/HEAD-a2c58332-aarch64/bin/aarch64-unknown-elf-gdb", condition = { env_not_set = ["GDB"] } } @@ -57,7 +59,8 @@ QEMU_CONTAINER_CMD = "qemu-system-aarch64" # Could additionally use -nographic to disable GUI -- this shall be useful for automated tests. # # -d in_asm,unimp,int -QEMU_OPTS = "-M raspi3 -d int -semihosting" +# QEMU has renamed the RasPi machines since version 6.2.0, use just `raspi3` for previous versions. +QEMU_OPTS = "-M ${QEMU_MACHINE} -d int -semihosting" QEMU_SERIAL_OPTS = "-serial null -serial stdio" QEMU_TESTS_OPTS = "-nographic" # For gdb connection: