From 6f68172a2f52962cec697ac25863da76b541e5b1 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 12 Oct 2026 23:43:10 +1100 Subject: [PATCH 1/3] tests: print 64-bit ini values with PRId64/PRIu64 ini_api_c printed rtapi_s64/rtapi_u64 with %ld/%lu, which only matches on LP64. On i386 and armhf the test failed to compile with -Werror. --- tests/inifile/ini_api_c/initest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/inifile/ini_api_c/initest.c b/tests/inifile/ini_api_c/initest.c index d71f5a3e213..f2996c30d8c 100644 --- a/tests/inifile/ini_api_c/initest.c +++ b/tests/inifile/ini_api_c/initest.c @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -94,7 +95,7 @@ int main(int argc, char *argv[]) case 'i': rv = iniFindSInt(argv[optind], var, sec, &i); if(!rv) { - printf("%ld\n", i); + printf("%" PRId64 "\n", i); } else { myerror("iniFindSInt", rv); return -rv; @@ -103,7 +104,7 @@ int main(int argc, char *argv[]) case 'u': rv = iniFindUInt(argv[optind], var, sec, &u); if(!rv) { - printf("%lu\n", u); + printf("%" PRIu64 "\n", u); } else { myerror("iniFindUInt", rv); return -rv; From 3d40a28b1afced691de40f860ec50c0690911fe5 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 12 Oct 2026 23:43:10 +1100 Subject: [PATCH 2/3] interp: G76 no duplicate full-depth pass with x87 math The pass loop compared the freshly computed depth against end_depth. With x87 math (Debian i386) the depth stays in an 80-bit register and can sit just below an end_depth it equals once rounded to double, so the loop cut one more pass at full depth before the final full-depth pass. Seen in tests/interp/g76-d-word (i-.05 j.01 k.02): the second pass lands exactly on end_depth. Stop the loop TINY short of end_depth; the final pass covers it. --- src/emc/rs274ngc/interp_convert.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emc/rs274ngc/interp_convert.cc b/src/emc/rs274ngc/interp_convert.cc index 6a4e77b8c71..76a4f7b90ab 100644 --- a/src/emc/rs274ngc/interp_convert.cc +++ b/src/emc/rs274ngc/interp_convert.cc @@ -6086,7 +6086,9 @@ int Interp::convert_threading_cycle(block_pointer block, depth = start_depth; zoff = (depth - full_dia_depth) * tan(compound_angle); - while (depth < end_depth) { + // TINY: with x87 math (i386) depth can be held in extended precision just + // below an end_depth it equals as a double, adding a duplicate full-depth pass + while (depth < end_depth - TINY) { threading_pass(settings, block, boring, safe_x, depth, end_depth, start_y, start_z, zoff, taper_dist, entry_taper, exit_taper, taper_pitch, pitch, full_threadheight, target_z, angle_offset); From b8fa444df6c3c9d38359413c918ce6346213907b Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 12 Oct 2026 23:17:42 +1100 Subject: [PATCH 3/3] CI: build and test 32-bit Debian packages (i386, armhf) 32-bit support stays (BeagleBone and similar armhf boards), but nothing in CI builds for an ILP32 target, so breakage like the libnml long vs int64_t overload errors fixed in #4614 goes unnoticed until someone builds on such a machine. Add a package-arch-32bit job that runs the same steps as package-arch (build the arch Debian packages, install them, run the test suite) in a Debian trixie container for i386 and armhf. The GitHub "container:" key cannot be used for these images because the runner injects its own 64-bit node into the container to run actions, so the job checks out on the host and starts the container with "docker run --platform". i386 runs natively on the x86_64 runner. armhf runs on the arm64 runner, natively if the CPU can execute AArch32, otherwise through QEMU. --- .github/scripts/package-arch-in-container.sh | 35 +++++++++++++ .github/workflows/ci.yml | 52 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100755 .github/scripts/package-arch-in-container.sh diff --git a/.github/scripts/package-arch-in-container.sh b/.github/scripts/package-arch-in-container.sh new file mode 100755 index 00000000000..304b4474533 --- /dev/null +++ b/.github/scripts/package-arch-in-container.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +# Build and test the architecture-specific Debian packages inside a plain +# Debian container started with "docker run", for architectures where the +# GitHub "container:" job key cannot be used (the runner injects its own +# 64-bit node into the container to run actions). +# Same steps as the package-arch job, run from the repository root. + +echo "Kernel: $(uname -m), userland: $(dpkg --print-architecture), CPUs: $(nproc)" + +apt-get -q update +apt-get --yes upgrade +# Install stuff needed to turn the repo into a debian source package and run tests. +apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts sudo adduser xauth + +git config --global --add safe.directory "${PWD}" + +DEBEMAIL=emc-developers@lists.sourceforge.net \ +DEBFULLNAME="LinuxCNC Github CI Robot" \ + .github/scripts/build-package-arch.sh + +.github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' + +apt-get --yes --no-install-recommends install ../*.deb + +adduser --disabled-password --gecos "" testrunner +passwd -d testrunner +adduser testrunner sudo +find tests/ -type d -exec chmod 0777 {} + # make test dirs world-writable for the testrunner +su -c "./scripts/runtests -p -d ./tests" testrunner + +.github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f943a1152a9..597d17646bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -393,6 +393,58 @@ jobs: path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} if-no-files-found: error + package-arch-32bit: + runs-on: ${{ matrix.runner }} + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + include: + - arch: i386 + platform: linux/386 + runner: ubuntu-24.04 + - arch: armhf + platform: linux/arm/v7 + runner: ubuntu-24.04-arm + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: false + # "fetch-depth: 0" fetches all of history, this is needed by + # our build system to determine the version from tags + fetch-depth: 0 + - name: Check for native 32-bit execution + id: native + run: | + set -x + if docker run --rm --platform ${{ matrix.platform }} debian:trixie true; then + echo "native=true" >> $GITHUB_OUTPUT + else + echo "native=false" >> $GITHUB_OUTPUT + fi + - name: Set up QEMU + if: steps.native.outputs.native != 'true' + uses: docker/setup-qemu-action@v3 + with: + platforms: ${{ matrix.platform }} + - name: Build and test ${{ matrix.arch }} Debian packages + run: | + set -x + # IPC_OWNER is needed for shmget IPC_CREAT + # SYS_ADMIN is needed for shmctl IPC_SET + docker run --rm --platform ${{ matrix.platform }} \ + --cap-add=IPC_OWNER --cap-add=SYS_ADMIN \ + -e DEBIAN_FRONTEND \ + -v "$PWD:/build/linuxcnc" -w /build/linuxcnc \ + debian:trixie .github/scripts/package-arch-in-container.sh + package-indep: runs-on: ubuntu-24.04 timeout-minutes: 75