From 8bb496bac92e0750281161e7e3f8c81f0afb6f0c Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Thu, 23 Jul 2026 18:12:11 +0100 Subject: [PATCH 1/5] CI: Use 26.04 Github runner (subarch amd64v3) 1/ Switch to the 26.04 Github runner 2/ Some repositories (maybe external) don't have packages for the new Ubuntu subarchitecture "amd64v3". Whilst apparently it is bad practice and potentially unreliable to mix plain amd64 packages with amd64v3 where linking will take place, it's okay if the app is self contained. Fortunately this is the case for us, where both problem packages are compilers producing non-host binaries. Add detection that the host desires amd64v3 packages, and tweak the problem repository definitions to access plain amd64 packages. 3/ Avoid doing apt-add-repository's automatic apt update. Run one update after adding multiple repositories. --- .github/workflows/ci-build.yml | 3 +-- ci_prereq.sh | 2 +- ci_setup_test.sh | 20 +++++++++++++++----- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 53eadc2f..5890aeb1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -3,7 +3,6 @@ on: pull_request: types: - opened - - edited - ready_for_review - reopened - synchronize @@ -20,7 +19,7 @@ jobs: if: contains(github.event.head_commit.message, '[skip ci]') == false - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 steps: - uses: actions/checkout@v6 diff --git a/ci_prereq.sh b/ci_prereq.sh index 0258bc8f..3a245e71 100755 --- a/ci_prereq.sh +++ b/ci_prereq.sh @@ -7,5 +7,5 @@ sudo apt install -y \ git \ clang -sudo add-apt-repository ppa:stsp-0/thunk-gen +sudo add-apt-repository -y ppa:stsp-0/thunk-gen mk-build-deps --install --root-cmd sudo diff --git a/ci_setup_test.sh b/ci_setup_test.sh index 7bd21d4a..48cb6d6c 100755 --- a/ci_setup_test.sh +++ b/ci_setup_test.sh @@ -34,8 +34,10 @@ fi sed -i -e 's/fdpp-dev,/bash,/' debian/control # Use debian package build deps so we don't have to maintain a list here - sudo add-apt-repository ppa:stsp-0/dj64 - sudo add-apt-repository -y ppa:dosemu2/ppa + sudo add-apt-repository -y --no-update ppa:stsp-0/dj64 + sudo add-apt-repository -y --no-update ppa:dosemu2/ppa + sudo apt update -q + mk-build-deps --install --root-cmd sudo CC=clang ./default-configure -d \ @@ -56,9 +58,17 @@ fi sudo chmod 755 /bin/dosemu_tap_interface.sh # Install the extra packages needed to run the test suite - sudo add-apt-repository -y ppa:dosemu2/ppa - sudo add-apt-repository -y ppa:jwt27/djgpp-toolchain - sudo add-apt-repository -y ppa:stsp-0/gcc-ia16 + sudo add-apt-repository -y --no-update ppa:dosemu2/ppa + + # Install djgpp and ia16 compilers / libs. + sudo add-apt-repository -y --no-update ppa:jwt27/djgpp-toolchain + sudo add-apt-repository -y --no-update ppa:stsp-0/gcc-ia16 + is_amd64v3=$(apt-config dump | grep -q 'Variants.*amd64v3' && echo true || echo false) # APT::Architecture-Variants "amd64v3" + if [ "$is_amd64v3" = "true" ] ; then + # Since there are no host libs to link against we can use amd64 arch on arm64v3 + sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/jwt27-ubuntu-djgpp-toolchain-resolute.sources + sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/stsp-0-ubuntu-gcc-ia16-resolute.sources + fi sudo apt update -q sudo apt install -y \ From ff9be49f703ffac86db3f16505647cdd2d87ddb4 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sat, 25 Jul 2026 15:34:43 +0100 Subject: [PATCH 2/5] CI: Copy some workflow items from Dosemu2 1/ Add an ACL for KVM use 2/ Add most of the info block 3/ Upload the failure logs to Artifacts --- .github/workflows/ci-build.yml | 40 +++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 5890aeb1..f8f35a2f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -22,7 +22,37 @@ jobs: runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v6 + - name: Checkout + uses: actions/checkout@v6 + + - name: Add an ACL to KVM for ourselves + run: | + echo 'SUBSYSTEM=="misc", KERNEL=="kvm", RUN+="/usr/bin/setfacl -m u:'${USER}':rw- /dev/kvm"' | sudo tee /etc/udev/rules.d/99-kvm4dosemu2.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Information + run: | + # + echo "::group::CPU" + lscpu + echo "::endgroup::" + + echo "::group::Kernel Config" + cat /boot/config-$(uname -r) + echo "::endgroup::" + + echo "::group::Kernel Modules" + sudo lsmod + echo "::endgroup::" + + echo "::group::Kernel Parameters (sysctl)" + sysctl -a + echo "::endgroup::" + + echo "::group::KVM permissions" + getfacl -p /dev/kvm + echo "::endgroup::" - name: Package install run: ./ci_prereq.sh @@ -34,4 +64,12 @@ jobs: run: ./ci_setup_test.sh - name: Test + id: test run: ./ci_test.sh + + - name: Upload failure logs + if: ${{ always() && (steps.test.outcome == 'failure') }} + uses: actions/upload-artifact@v6 + with: + name: failure-logs + path: ${{ env.DIR_TEST_DOSEMU }}/test_* From 9942e4fee0dbfe92a581210000427996a815a7ec Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sat, 25 Jul 2026 17:56:22 +0100 Subject: [PATCH 3/5] CI: Only need one script for test setup 1/ Stop sourcing the mostly empty ci_test_prereq.sh 2/ Move the contents of ci_test_prereq.sh to ci_setup_test.sh 3/ Rename ci_setup_test.sh to ci_test_prereq.sh and change the workflow step to use it. --- .github/workflows/ci-build.yml | 2 +- ci_setup_test.sh | 97 ---------------------------------- ci_test.sh | 2 - ci_test_prereq.sh | 96 +++++++++++++++++++++++++++++++-- 4 files changed, 94 insertions(+), 103 deletions(-) delete mode 100755 ci_setup_test.sh diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f8f35a2f..f43edf40 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -61,7 +61,7 @@ jobs: run: ./ci_build.sh - name: Set up test environment - run: ./ci_setup_test.sh + run: ./ci_test_prereq.sh - name: Test id: test diff --git a/ci_setup_test.sh b/ci_setup_test.sh deleted file mode 100755 index 48cb6d6c..00000000 --- a/ci_setup_test.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh - -set -e - -if [ -z "${DIR_TEST_DOSEMU}" ] ; then - echo env var "DIR_TEST_DOSEMU" is empty or missing - exit 1 -fi - -if [ -z "${DIR_INSTALLED_FDPP}" ] ; then - echo env var "DIR_INSTALLED_FDPP" is empty or missing - exit 1 -fi - -test -d ${DIR_TEST_DOSEMU} && (echo $DIR_TEST_DOSEMU already exists && exit 1) - -DIR_ROOT="$(pwd)" - -# Grab the dosemu2 source -git clone --depth 1 --no-single-branch https://github.com/dosemu2/dosemu2.git ${DIR_TEST_DOSEMU} - -# Install fdpp into local directory -if false ; then - make install prefix="${DIR_ROOT}/${DIR_INSTALLED_FDPP}" -else - meson install -C ${DIR_ROOT}/build -fi - -( - cd ${DIR_TEST_DOSEMU} || exit 2 - [ -z "${USE_DOSEMU_BRANCH}" ] || git checkout "${USE_DOSEMU_BRANCH}" - - # Remove fdpp-dev from debian build dependencies (use bash as padding) - sed -i -e 's/fdpp-dev,/bash,/' debian/control - - # Use debian package build deps so we don't have to maintain a list here - sudo add-apt-repository -y --no-update ppa:stsp-0/dj64 - sudo add-apt-repository -y --no-update ppa:dosemu2/ppa - sudo apt update -q - - mk-build-deps --install --root-cmd sudo - - CC=clang ./default-configure -d \ - --prefix=${DIR_ROOT}/${DIR_INSTALLED_FDPP} \ - --with-fdpp-lib-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib \ - --with-fdpp-include-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/include \ - --with-fdpp-pkgconf-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib/pkgconfig - make - - # Install the FAT mount helper - sudo cp test/dosemu_fat_mount.sh /bin/. - sudo chown root:root /bin/dosemu_fat_mount.sh - sudo chmod 755 /bin/dosemu_fat_mount.sh - - # Install the TAP helper - sudo cp test/dosemu_tap_interface.sh /bin/. - sudo chown root:root /bin/dosemu_tap_interface.sh - sudo chmod 755 /bin/dosemu_tap_interface.sh - - # Install the extra packages needed to run the test suite - sudo add-apt-repository -y --no-update ppa:dosemu2/ppa - - # Install djgpp and ia16 compilers / libs. - sudo add-apt-repository -y --no-update ppa:jwt27/djgpp-toolchain - sudo add-apt-repository -y --no-update ppa:stsp-0/gcc-ia16 - is_amd64v3=$(apt-config dump | grep -q 'Variants.*amd64v3' && echo true || echo false) # APT::Architecture-Variants "amd64v3" - if [ "$is_amd64v3" = "true" ] ; then - # Since there are no host libs to link against we can use amd64 arch on arm64v3 - sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/jwt27-ubuntu-djgpp-toolchain-resolute.sources - sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/stsp-0-ubuntu-gcc-ia16-resolute.sources - fi - sudo apt update -q - - sudo apt install -y \ - comcom64 \ - python3-cpuinfo \ - python3-pexpect \ - mtools \ - gcc-djgpp \ - djgpp-dev \ - qemu-system-common \ - gcc-ia16-elf \ - libi86-ia16-elf \ - libi86-testsuite-ia16-elf \ - nasm \ - gcc-multilib \ - dos2unix \ - bridge-utils \ - libvirt-daemon \ - libvirt-daemon-system - - # Prepare the cputests - make -C test/cpu clean all - - # Get the test binaries - test/test_dosemu.py --get-test-binaries -) diff --git a/ci_test.sh b/ci_test.sh index 6548053c..d4f80eca 100755 --- a/ci_test.sh +++ b/ci_test.sh @@ -2,8 +2,6 @@ set -e -. ./ci_test_prereq.sh - if [ -z "${DIR_TEST_DOSEMU}" ] ; then echo env var "DIR_TEST_DOSEMU" is empty or missing exit 1 diff --git a/ci_test_prereq.sh b/ci_test_prereq.sh index c416716e..80832d8b 100755 --- a/ci_test_prereq.sh +++ b/ci_test_prereq.sh @@ -1,6 +1,96 @@ #!/bin/sh -sudo apt update -q -sudo apt install -y \ +set -e + +if [ -z "${DIR_TEST_DOSEMU}" ] ; then + echo env var "DIR_TEST_DOSEMU" is empty or missing + exit 1 +fi + +if [ -z "${DIR_INSTALLED_FDPP}" ] ; then + echo env var "DIR_INSTALLED_FDPP" is empty or missing + exit 1 +fi + +test -d ${DIR_TEST_DOSEMU} && (echo $DIR_TEST_DOSEMU already exists && exit 1) + +DIR_ROOT="$(pwd)" + +# Grab the dosemu2 source +git clone --depth 1 --no-single-branch https://github.com/dosemu2/dosemu2.git ${DIR_TEST_DOSEMU} + +# Install fdpp into local directory +if false ; then + make install prefix="${DIR_ROOT}/${DIR_INSTALLED_FDPP}" +else + meson install -C ${DIR_ROOT}/build +fi + +( + cd ${DIR_TEST_DOSEMU} || exit 2 + [ -z "${USE_DOSEMU_BRANCH}" ] || git checkout "${USE_DOSEMU_BRANCH}" + + # Remove fdpp-dev from debian build dependencies (use bash as padding) + sed -i -e 's/fdpp-dev,/bash,/' debian/control + + # Use debian package build deps so we don't have to maintain a list here + sudo add-apt-repository -y --no-update ppa:stsp-0/dj64 + sudo add-apt-repository -y --no-update ppa:dosemu2/ppa + sudo apt update -q + + mk-build-deps --install --root-cmd sudo + + CC=clang ./default-configure -d \ + --prefix=${DIR_ROOT}/${DIR_INSTALLED_FDPP} \ + --with-fdpp-lib-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib \ + --with-fdpp-include-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/include \ + --with-fdpp-pkgconf-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib/pkgconfig + make + + # Install the FAT mount helper + sudo cp test/dosemu_fat_mount.sh /bin/. + sudo chown root:root /bin/dosemu_fat_mount.sh + sudo chmod 755 /bin/dosemu_fat_mount.sh + + # Install the TAP helper + sudo cp test/dosemu_tap_interface.sh /bin/. + sudo chown root:root /bin/dosemu_tap_interface.sh + sudo chmod 755 /bin/dosemu_tap_interface.sh + + # Install the extra packages needed to run the test suite + sudo add-apt-repository -y --no-update ppa:dosemu2/ppa + + # Install djgpp and ia16 compilers / libs. + sudo add-apt-repository -y --no-update ppa:jwt27/djgpp-toolchain + sudo add-apt-repository -y --no-update ppa:stsp-0/gcc-ia16 + is_amd64v3=$(apt-config dump | grep -q 'Variants.*amd64v3' && echo true || echo false) # APT::Architecture-Variants "amd64v3" + if [ "$is_amd64v3" = "true" ] ; then + # Since there are no host libs to link against we can use amd64 arch on arm64v3 + sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/jwt27-ubuntu-djgpp-toolchain-resolute.sources + sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/stsp-0-ubuntu-gcc-ia16-resolute.sources + fi + sudo apt update -q + + sudo apt install -y \ diffutils \ - gdb + gdb \ + comcom64 \ + python3-cpuinfo \ + python3-pexpect \ + mtools \ + gcc-djgpp \ + djgpp-dev \ + qemu-system-common \ + gcc-ia16-elf \ + libi86-ia16-elf \ + libi86-testsuite-ia16-elf \ + nasm \ + gcc-multilib \ + dos2unix \ + bridge-utils \ + libvirt-daemon \ + libvirt-daemon-system + + # Get the test binaries + test/test_dosemu.py --get-test-binaries +) From 834e6edd6bbe49d7ea6af88b6a1f2a70f4c8927c Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Mon, 27 Jul 2026 21:42:29 +0100 Subject: [PATCH 4/5] CI: Allow CI test to use another repo for dosemu Useful for testing when a fix in dosemu needs testing from FDPP CI before it should be merged into dosemu. --- .github/workflows/ci-build.yml | 1 + ci_test_prereq.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f43edf40..34dc418d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -11,6 +11,7 @@ on: env: DIR_TEST_DOSEMU: test-dosemu DIR_INSTALLED_FDPP: test-dosemu/installed-fdpp + USE_DOSEMU_REPO: https://github.com/dosemu2/dosemu2.git USE_DOSEMU_BRANCH: devel jobs: diff --git a/ci_test_prereq.sh b/ci_test_prereq.sh index 80832d8b..65b8fa02 100755 --- a/ci_test_prereq.sh +++ b/ci_test_prereq.sh @@ -17,7 +17,7 @@ test -d ${DIR_TEST_DOSEMU} && (echo $DIR_TEST_DOSEMU already exists && exit 1) DIR_ROOT="$(pwd)" # Grab the dosemu2 source -git clone --depth 1 --no-single-branch https://github.com/dosemu2/dosemu2.git ${DIR_TEST_DOSEMU} +git clone --depth 1 --no-single-branch ${USE_DOSEMU_REPO} ${DIR_TEST_DOSEMU} # Install fdpp into local directory if false ; then From 96e0f401838d3e01f2a5e45e01825cdbe17dc5b8 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sat, 25 Jul 2026 18:24:53 +0100 Subject: [PATCH 5/5] CI: Enable the processor tests again 1/ The processor tests got moved to a separate file, so they were no longer being run in this repo. 2/ The processor tests now make the test binaries themselves. 3/ Install Watcom --- .github/workflows/ci-build.yml | 5 +++++ ci_test.sh | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 34dc418d..28cb3cdf 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -64,6 +64,11 @@ jobs: - name: Set up test environment run: ./ci_test_prereq.sh + - name: Open Watcom install + uses: open-watcom/setup-watcom@v1 + with: + version: 2.0-64 + - name: Test id: test run: ./ci_test.sh diff --git a/ci_test.sh b/ci_test.sh index d4f80eca..9110759a 100755 --- a/ci_test.sh +++ b/ci_test.sh @@ -19,6 +19,20 @@ DIR_ROOT="$(pwd)" # Now do the tests export LD_LIBRARY_PATH=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib/fdpp + export PYTHONUNBUFFERED=1 export SKIP_EXPENSIVE=1 + + cat >&2 << EOF +=============================================================== += Processor tests run on emulated CPU, KVM and VM86 = +=============================================================== +EOF + env NO_FAILFAST=1 python3 test/test_processor.py + +cat >&2 << EOF2 +=============================================================== += Other tests run on KVM = +=============================================================== +EOF2 test/test_dosemu.py PPDOSGITTestCase )