From 21f5ee2983d22aaeea7efeb1f274f393e4b69da8 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 07:48:09 +0200 Subject: [PATCH 01/13] ci: Remove eatmydata It fails sometimes and the build time doesn't increase. If it fails, the error is: ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. Merge a few improvements from master. --- .github/workflows/ci.yml | 156 ++++++++++++++++++++++++--------------- 1 file changed, 97 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09ab8aab0a0..ad1cc62ed89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,15 +30,53 @@ jobs: - name: Build RIP & test run: | set -x - sudo apt-get --yes -o Acquire::Retries=5 install eatmydata - eatmydata ./scripts/travis-install-build-deps.sh - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + ./scripts/travis-install-build-deps.sh + sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps - eatmydata make -O -j$((1+$(nproc))) default pycheck V=1 + ./autogen.sh + ./configure --disable-check-runtime-deps + make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs - eatmydata ../scripts/rip-environment runtests -p + ../scripts/rip-environment runtests -p + + rip-rtai: + runs-on: ubuntu-24.04 + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* + - name: Build RIP RTAI + run: | + set -x + #To install the RTAI deb's from linuxcnc base + #echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ trixie base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null + #GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) + #gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 + #gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null + #sudo apt-get --quiet -o Acquire::Retries=5 update + #sudo apt-get --yes -o Acquire::Retries=5 install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 + #----- + #To install the RTAI deb's from NTULINUX git + curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb + sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb + #----- + ./scripts/travis-install-build-deps.sh + sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + cd src + ./autogen.sh + #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps + ./configure --with-realtime=/usr/realtime-5.4.302-rtai-amd64 --disable-check-runtime-deps + make -O -j$((1+$(nproc))) default pycheck V=1 rip-and-test-clang: runs-on: ubuntu-24.04 @@ -55,16 +93,16 @@ jobs: - name: Clang build RIP & test run: | set -x - sudo apt-get --yes -o Acquire::Retries=5 install eatmydata - eatmydata ./scripts/travis-install-build-deps.sh - sudo eatmydata apt-get -y -o Acquire::Retries=5 install clang - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + ./scripts/travis-install-build-deps.sh + sudo apt-get -y -o Acquire::Retries=5 install clang + sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - CC=clang CXX=clang++ eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps - eatmydata make -O -j$((1+$(nproc))) default pycheck V=1 + ./autogen.sh + CC=clang CXX=clang++ ./configure --disable-check-runtime-deps + make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs - eatmydata ../scripts/rip-environment runtests -p + ../scripts/rip-environment runtests -p htmldocs: runs-on: ubuntu-24.04 @@ -81,14 +119,14 @@ jobs: - name: Build HTML docmentation run: | ./scripts/travis-install-build-deps.sh - sudo apt-get -y -o Acquire::Retries=5 install eatmydata - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps --enable-build-documentation=html - eatmydata make -O -j$((1+$(nproc))) manpages - eatmydata make -O -j$((1+$(nproc))) translateddocs - eatmydata make -O -j$((1+$(nproc))) docs + ./autogen.sh + ./configure --disable-check-runtime-deps --enable-build-documentation=html + make -O -j$((1+$(nproc))) manpages + make -O -j$((1+$(nproc))) translateddocs + make -O -j$((1+$(nproc))) docs # Note that the package build covers html docs package-arch: @@ -114,10 +152,10 @@ jobs: set -e set -x apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl - eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + apt-get --yes --quiet -o Acquire::Retries=5 install curl + apt --yes --quiet -o Acquire::Retries=5 upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - uses: actions/checkout@v3 with: @@ -138,11 +176,11 @@ jobs: esac set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common - eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF + apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common + gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base" - eatmydata apt-get --quiet -o Acquire::Retries=5 update + add-apt-repository "deb http://linuxcnc.org $DIST base" + apt-get --quiet -o Acquire::Retries=5 update - name: Build architecture-specific Debian packages env: @@ -152,26 +190,26 @@ jobs: run: | set -e set -x - eatmydata git config --global --add safe.directory "${PWD}" - eatmydata debian/configure - eatmydata debian/update-dch-from-git - eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - eatmydata git diff - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only . - eatmydata debuild -us -uc --build=any + git config --global --add safe.directory "${PWD}" + debian/configure + debian/update-dch-from-git + scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION + git diff + apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only . + debuild -us -uc --build=any - name: Test debian packages env: DEBIAN_FRONTEND: noninteractive run: | set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install sudo adduser # some tests run sudo; adduser no longer pulled implicitly on sid - eatmydata adduser --disabled-password --gecos "" testrunner - eatmydata passwd -d testrunner - eatmydata adduser testrunner sudo + apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb + apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo... + adduser --disabled-password --gecos "" testrunner + passwd -d testrunner + adduser testrunner sudo chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner - su -c "eatmydata ./scripts/runtests -p ./tests" testrunner + su -c "./scripts/runtests -p ./tests" testrunner - name: Gather build artifacts run: | set -e @@ -180,7 +218,7 @@ jobs: DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) OUTDIR="artifacts/${DIST}/${ARCH}" mkdir -p "$OUTDIR" - cp -v ../*.deb ../*.changes ../*.buildinfo "$OUTDIR" || true + cp -v $(find .. -maxdepth 1 -type f | LC_ALL=C sort) "$OUTDIR" || true (cd "$OUTDIR" && sha256sum * > SHA256SUMS.txt) echo "DIST=$DIST" >> "$GITHUB_ENV" echo "ARCH=$ARCH" >> "$GITHUB_ENV" @@ -221,10 +259,10 @@ jobs: set -e set -x apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl - eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + apt-get --yes --quiet -o Acquire::Retries=5 install curl + apt --yes --quiet -o Acquire::Retries=5 upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - uses: actions/checkout@v3 with: @@ -245,11 +283,11 @@ jobs: esac set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common - eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF + apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common + gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base" - eatmydata apt-get --quiet -o Acquire::Retries=5 update + add-apt-repository "deb http://linuxcnc.org $DIST base" + apt-get --quiet -o Acquire::Retries=5 update - name: Build architecture-independent Debian packages env: @@ -259,20 +297,20 @@ jobs: run: | set -e set -x - eatmydata git config --global --add safe.directory "${PWD}" - eatmydata debian/configure - eatmydata debian/update-dch-from-git - eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - eatmydata git diff - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only . - eatmydata debuild -us -uc --build=all + git config --global --add safe.directory "${PWD}" + debian/configure + debian/update-dch-from-git + scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION + git diff + apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only . + debuild -us -uc --build=all - name: Test install debian packages env: DEBIAN_FRONTEND: noninteractive run: | set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb + apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb - name: Gather build artifacts run: | set -e @@ -281,7 +319,7 @@ jobs: ARCH=all OUTDIR="artifacts/${DIST}/${ARCH}" mkdir -p "$OUTDIR" - cp -v ../*.deb ../*.changes ../*.buildinfo "$OUTDIR" || true + cp -v $(find .. -maxdepth 1 -type f | LC_ALL=C sort) "$OUTDIR" || true (cd "$OUTDIR" && sha256sum * > SHA256SUMS.txt) echo "DIST=$DIST" >> "$GITHUB_ENV" echo "ARCH=$ARCH" >> "$GITHUB_ENV" From db397ab978c2d90ed551d890ddc6820ed6534976 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 17:01:58 +0200 Subject: [PATCH 02/13] ci: No quiet / no retry Retry should not have an effect: Either you are rate limited and it fails anyway or it succeeds. No --quiet so you see what is going on. --- .github/workflows/ci.yml | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad1cc62ed89..c20cea8da4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: set -x ./scripts/travis-install-build-deps.sh sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes upgrade cd src ./autogen.sh ./configure --disable-check-runtime-deps @@ -60,8 +60,8 @@ jobs: #GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) #gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 #gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null - #sudo apt-get --quiet -o Acquire::Retries=5 update - #sudo apt-get --yes -o Acquire::Retries=5 install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 + #sudo apt-get update + #sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 #----- #To install the RTAI deb's from NTULINUX git curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb @@ -71,7 +71,7 @@ jobs: #----- ./scripts/travis-install-build-deps.sh sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes upgrade cd src ./autogen.sh #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps @@ -94,9 +94,9 @@ jobs: run: | set -x ./scripts/travis-install-build-deps.sh - sudo apt-get -y -o Acquire::Retries=5 install clang + sudo apt-get -y install clang sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes upgrade cd src ./autogen.sh CC=clang CXX=clang++ ./configure --disable-check-runtime-deps @@ -120,7 +120,7 @@ jobs: run: | ./scripts/travis-install-build-deps.sh sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes upgrade cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-build-documentation=html @@ -151,11 +151,11 @@ jobs: run: | set -e set -x - apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install curl - apt --yes --quiet -o Acquire::Retries=5 upgrade + apt-get update + apt-get --yes install curl + apt --yes upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes install --no-install-suggests git lsb-release python3 devscripts - uses: actions/checkout@v3 with: @@ -176,11 +176,11 @@ jobs: esac set -e set -x - apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common + apt-get --yes install --no-install-recommends gpg software-properties-common gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF DIST=$(echo ${{matrix.image}} | cut -d : -f 2) add-apt-repository "deb http://linuxcnc.org $DIST base" - apt-get --quiet -o Acquire::Retries=5 update + apt-get update - name: Build architecture-specific Debian packages env: @@ -195,7 +195,7 @@ jobs: debian/update-dch-from-git scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION git diff - apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only . + apt-get --yes build-dep --arch-only . debuild -us -uc --build=any - name: Test debian packages env: @@ -203,8 +203,8 @@ jobs: run: | set -e set -x - apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb - apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo... + apt-get --yes install ../*.deb + apt-get --yes install sudo # some tests run sudo... adduser --disabled-password --gecos "" testrunner passwd -d testrunner adduser testrunner sudo @@ -258,11 +258,11 @@ jobs: run: | set -e set -x - apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install curl - apt --yes --quiet -o Acquire::Retries=5 upgrade + apt-get update + apt-get --yes install curl + apt --yes upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes install --no-install-suggests git lsb-release python3 devscripts - uses: actions/checkout@v3 with: @@ -283,11 +283,11 @@ jobs: esac set -e set -x - apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common + apt-get --yes install gpg software-properties-common gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF DIST=$(echo ${{matrix.image}} | cut -d : -f 2) add-apt-repository "deb http://linuxcnc.org $DIST base" - apt-get --quiet -o Acquire::Retries=5 update + apt-get update - name: Build architecture-independent Debian packages env: @@ -302,7 +302,7 @@ jobs: debian/update-dch-from-git scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION git diff - apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only . + apt-get --yes build-dep --indep-only . debuild -us -uc --build=all - name: Test install debian packages env: @@ -310,7 +310,7 @@ jobs: run: | set -e set -x - apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb + apt-get --yes install ../*.deb - name: Gather build artifacts run: | set -e @@ -349,7 +349,7 @@ jobs: run: | set -x git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* - sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck + sudo apt-get --yes install cppcheck shellcheck scripts/cppcheck.sh - name: Shellcheck continue-on-error: true From c1358871d54390f91d44f1fc4567ac974aca2984 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 17:06:21 +0200 Subject: [PATCH 03/13] ci: No upgrade except for debian container Ubuntu image from gitlab should be reasonable up to date. No need to remove firefox any more. In debian containers, there is only a minimal package set, so we can upgrade. Especially for sid, the container is not always up to date. --- .github/workflows/ci.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c20cea8da4b..a237c8e6922 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,6 @@ jobs: run: | set -x ./scripts/travis-install-build-deps.sh - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes upgrade cd src ./autogen.sh ./configure --disable-check-runtime-deps @@ -70,8 +68,6 @@ jobs: sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb #----- ./scripts/travis-install-build-deps.sh - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes upgrade cd src ./autogen.sh #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps @@ -95,8 +91,6 @@ jobs: set -x ./scripts/travis-install-build-deps.sh sudo apt-get -y install clang - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes upgrade cd src ./autogen.sh CC=clang CXX=clang++ ./configure --disable-check-runtime-deps @@ -119,8 +113,6 @@ jobs: - name: Build HTML docmentation run: | ./scripts/travis-install-build-deps.sh - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes upgrade cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-build-documentation=html @@ -152,8 +144,8 @@ jobs: set -e set -x apt-get update - apt-get --yes install curl apt --yes upgrade + apt-get --yes install curl # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes install --no-install-suggests git lsb-release python3 devscripts @@ -259,8 +251,8 @@ jobs: set -e set -x apt-get update - apt-get --yes install curl apt --yes upgrade + apt-get --yes install curl # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes install --no-install-suggests git lsb-release python3 devscripts From 3abd2a583ff4123d889e2075458d31cfb34eb6fd Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 17:15:31 +0200 Subject: [PATCH 04/13] ci: Move cppcheck up / Remove unneeded newlines cppcheck is now in test section. --- .github/workflows/ci.yml | 45 +++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a237c8e6922..631f6b74006 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,25 @@ jobs: # Note that the package build covers html docs ../scripts/rip-environment runtests -p + cppcheck: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - name: Perform Source Code checks that were successful in the past + continue-on-error: true + run: | + set -x + git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* + sudo apt-get --yes install cppcheck shellcheck + scripts/cppcheck.sh + - name: Shellcheck + continue-on-error: true + run: | + scripts/shellcheck.sh + htmldocs: runs-on: ubuntu-24.04 steps: @@ -173,7 +192,6 @@ jobs: DIST=$(echo ${{matrix.image}} | cut -d : -f 2) add-apt-repository "deb http://linuxcnc.org $DIST base" apt-get update - - name: Build architecture-specific Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net @@ -219,7 +237,6 @@ jobs: run: | echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT echo "arch=$(dpkg --print-architecture)" >> $GITHUB_OUTPUT - - name: Upload build artifacts uses: actions/upload-artifact@v4 with: @@ -243,7 +260,6 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Install pre-dependencies env: DEBIAN_FRONTEND: noninteractive @@ -280,7 +296,6 @@ jobs: DIST=$(echo ${{matrix.image}} | cut -d : -f 2) add-apt-repository "deb http://linuxcnc.org $DIST base" apt-get update - - name: Build architecture-independent Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net @@ -320,7 +335,6 @@ jobs: run: | echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT echo "arch=all" >> $GITHUB_OUTPUT - - name: Upload build artifacts uses: actions/upload-artifact@v4 with: @@ -328,27 +342,6 @@ jobs: path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} if-no-files-found: error - - cppcheck: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - name: Perform Source Code checks that were successful in the past - continue-on-error: true - run: | - set -x - git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* - sudo apt-get --yes install cppcheck shellcheck - scripts/cppcheck.sh - - name: Shellcheck - continue-on-error: true - run: | - scripts/shellcheck.sh - - release: name: Release packages needs: From 5abed1689b2a3c1adf42a7fe49300243756b7653 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 17:34:40 +0200 Subject: [PATCH 05/13] ci: DEBIAN_FRONTEND globally / No set -e / No linuxcnc repo DEBIAN_FRONTEND: noninteractive can be defined once on top. set -e is not needed in CI, it stops anyway on any error. Linuxcnc repo is added for everything except sid / bookworm / trixie which is all what we build, so it can be removed. --- .github/workflows/ci.yml | 62 +++------------------------------------- 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 631f6b74006..9ccbce9b125 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,9 @@ on: permissions: contents: read # to fetch code (actions/checkout) +env: + DEBIAN_FRONTEND: noninteractive + jobs: rip-and-test: @@ -157,10 +160,7 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - name: Install pre-dependencies - env: - DEBIAN_FRONTEND: noninteractive run: | - set -e set -x apt-get update apt --yes upgrade @@ -173,32 +173,11 @@ jobs: # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 - - - name: Add linuxcnc.org deb archive - env: - DEBIAN_FRONTEND: noninteractive - run: | - case "${{matrix.image}}" in - debian:sid|debian:bookworm|debian:trixie) - exit 0 - ;; - *) - ;; - esac - set -e - set -x - apt-get --yes install --no-install-recommends gpg software-properties-common - gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF - DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - add-apt-repository "deb http://linuxcnc.org $DIST base" - apt-get update - name: Build architecture-specific Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot - DEBIAN_FRONTEND: noninteractive run: | - set -e set -x git config --global --add safe.directory "${PWD}" debian/configure @@ -208,10 +187,7 @@ jobs: apt-get --yes build-dep --arch-only . debuild -us -uc --build=any - name: Test debian packages - env: - DEBIAN_FRONTEND: noninteractive run: | - set -e set -x apt-get --yes install ../*.deb apt-get --yes install sudo # some tests run sudo... @@ -222,7 +198,6 @@ jobs: su -c "./scripts/runtests -p ./tests" testrunner - name: Gather build artifacts run: | - set -e set -x ARCH=$(dpkg --print-architecture) DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) @@ -244,7 +219,6 @@ jobs: path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} if-no-files-found: error - package-indep: runs-on: ubuntu-24.04 strategy: @@ -261,10 +235,7 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - name: Install pre-dependencies - env: - DEBIAN_FRONTEND: noninteractive run: | - set -e set -x apt-get update apt --yes upgrade @@ -277,32 +248,11 @@ jobs: # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 - - - name: Add linuxcnc.org deb archive - env: - DEBIAN_FRONTEND: noninteractive - run: | - case "${{matrix.image}}" in - debian:sid|debian:bookworm|debian:trixie) - exit 0 - ;; - *) - ;; - esac - set -e - set -x - apt-get --yes install gpg software-properties-common - gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF - DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - add-apt-repository "deb http://linuxcnc.org $DIST base" - apt-get update - name: Build architecture-independent Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot - DEBIAN_FRONTEND: noninteractive run: | - set -e set -x git config --global --add safe.directory "${PWD}" debian/configure @@ -312,15 +262,11 @@ jobs: apt-get --yes build-dep --indep-only . debuild -us -uc --build=all - name: Test install debian packages - env: - DEBIAN_FRONTEND: noninteractive run: | - set -e set -x apt-get --yes install ../*.deb - name: Gather build artifacts run: | - set -e set -x DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) ARCH=all @@ -358,7 +304,7 @@ jobs: path: release_artifacts - name: Prepare upload assets run: | - set -e + set -x mkdir -p upload echo "Downloaded artifacts layout:" && find release_artifacts -maxdepth 3 -print | sed 's/^/ /' for d in release_artifacts/*; do From 3b3f6efb9bd3704a414714e67c2ed53cf4ca0cb2 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 17:48:45 +0200 Subject: [PATCH 06/13] ci: Update all actions / Split steps / No fetch All actions updated to latest release. Checkout: Submodules not needed / fetch-depth 1 is fine for all targets not needing history. More steps help debugging and tuning ci. Fetch not needed, checkout fetches already. --- .github/workflows/ci.yml | 142 +++++++++++++++++++++++++-------------- 1 file changed, 93 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ccbce9b125..f6ed34996e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,22 +24,30 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Build RIP & test + submodules: false + fetch-depth: 1 + - name: Install dependencies run: | set -x ./scripts/travis-install-build-deps.sh + - name: Build RIP GCC + run: | + set -x cd src ./autogen.sh ./configure --disable-check-runtime-deps make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs - ../scripts/rip-environment runtests -p + - name: Test + run: | + set -x + ./scripts/rip-environment runtests -p rip-rtai: runs-on: ubuntu-24.04 @@ -47,13 +55,15 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Build RIP RTAI + submodules: false + fetch-depth: 1 + - name: Install dependencies run: | set -x #To install the RTAI deb's from linuxcnc base @@ -71,6 +81,9 @@ jobs: sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb #----- ./scripts/travis-install-build-deps.sh + - name: Build RIP RTAI + run: | + set -x cd src ./autogen.sh #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps @@ -83,37 +96,49 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Clang build RIP & test + submodules: false + fetch-depth: 1 + - name: Install dependencies run: | set -x ./scripts/travis-install-build-deps.sh sudo apt-get -y install clang + - name: Build RIP Clang + run: | + set -x cd src ./autogen.sh CC=clang CXX=clang++ ./configure --disable-check-runtime-deps make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs - ../scripts/rip-environment runtests -p + - name: Test + run: | + set -x + ./scripts/rip-environment runtests -p cppcheck: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - name: Perform Source Code checks that were successful in the past - continue-on-error: true + submodules: false + fetch-depth: 1 + - name: Install dependencies run: | set -x - git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* + sudo apt-get -q update sudo apt-get --yes install cppcheck shellcheck + - name: Cppcheck + continue-on-error: true + run: | + set -x scripts/cppcheck.sh - name: Shellcheck continue-on-error: true @@ -126,15 +151,20 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Build HTML docmentation + submodules: false + fetch-depth: 1 + - name: Install dependencies run: | + set -x ./scripts/travis-install-build-deps.sh + - name: Build HTML docmentation + run: | cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-build-documentation=html @@ -158,7 +188,9 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - name: Install pre-dependencies run: | set -x @@ -166,31 +198,37 @@ jobs: apt --yes upgrade apt-get --yes install curl # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes install --no-install-suggests git lsb-release python3 devscripts - - - uses: actions/checkout@v3 + apt-get --yes install --no-install-suggests git lsb-release python3 devscripts sudo + - 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: Git config + run: | + set -x + git config --global --add safe.directory ${PWD} - name: Build architecture-specific Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot run: | set -x - git config --global --add safe.directory "${PWD}" debian/configure debian/update-dch-from-git scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION git diff apt-get --yes build-dep --arch-only . debuild -us -uc --build=any - - name: Test debian packages + - name: Install debian packages run: | set -x apt-get --yes install ../*.deb - apt-get --yes install sudo # some tests run sudo... + - name: Test debian packages + run: | + set -x adduser --disabled-password --gecos "" testrunner passwd -d testrunner adduser testrunner sudo @@ -213,7 +251,7 @@ jobs: echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT echo "arch=$(dpkg --print-architecture)" >> $GITHUB_OUTPUT - name: Upload build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linuxcnc-${{ steps.meta.outputs.dist }}-${{ steps.meta.outputs.arch }} path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} @@ -233,7 +271,9 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - name: Install pre-dependencies run: | set -x @@ -242,34 +282,38 @@ jobs: apt-get --yes install curl # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes install --no-install-suggests git lsb-release python3 devscripts - - - uses: actions/checkout@v3 + - 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: Git config + run: | + set -x + git config --global --add safe.directory ${PWD} - name: Build architecture-independent Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot run: | set -x - git config --global --add safe.directory "${PWD}" debian/configure debian/update-dch-from-git scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION git diff apt-get --yes build-dep --indep-only . debuild -us -uc --build=all - - name: Test install debian packages + - name: Install debian packages run: | set -x apt-get --yes install ../*.deb - name: Gather build artifacts run: | set -x - DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) ARCH=all + DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) OUTDIR="artifacts/${DIST}/${ARCH}" mkdir -p "$OUTDIR" cp -v $(find .. -maxdepth 1 -type f | LC_ALL=C sort) "$OUTDIR" || true @@ -282,7 +326,7 @@ jobs: echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT echo "arch=all" >> $GITHUB_OUTPUT - name: Upload build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linuxcnc-${{ steps.meta.outputs.dist }}-${{ steps.meta.outputs.arch }} path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} @@ -299,7 +343,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: release_artifacts - name: Prepare upload assets @@ -340,7 +384,7 @@ jobs: ) fi - name: Create GitHub Release and upload assets - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: files: | upload/* From 6069618accf0fc621122e3e081ef588d3ac260d8 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 18:09:04 +0200 Subject: [PATCH 07/13] ci: Remove --cpu 2 This argument limited the amount of CPU's to 2. Without, we have all 4 CPU's reducing build time. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6ed34996e1..d41b6befaae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,7 @@ jobs: image: ${{ matrix.image }} # IPC_OWNER is needed for shmget IPC_CREAT # SYS_ADMIN is needed for shmctl IPC_SET - options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN + options: --cap-add=IPC_OWNER --cap-add=SYS_ADMIN steps: - name: Dump GitHub context env: @@ -266,7 +266,7 @@ jobs: image: ${{ matrix.image }} # IPC_OWNER is needed for shmget IPC_CREAT # SYS_ADMIN is needed for shmctl IPC_SET - options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN + options: --cap-add=IPC_OWNER --cap-add=SYS_ADMIN steps: - name: Dump GitHub context env: From 6760d1f8cd088d9c3b040148e5b742ef22cc6b54 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 18:25:02 +0200 Subject: [PATCH 08/13] ci: Do not install recommends Less packages -> faster build. Recommends should not be needed. --- .github/workflows/ci.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d41b6befaae..0811a2f49d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -194,11 +194,10 @@ jobs: - name: Install pre-dependencies run: | set -x - apt-get update + apt-get -q update apt --yes upgrade - apt-get --yes install curl - # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes install --no-install-suggests git lsb-release python3 devscripts sudo + # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package and run tests. + apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts sudo adduser xauth - name: Checkout repository uses: actions/checkout@v6 with: @@ -225,7 +224,7 @@ jobs: - name: Install debian packages run: | set -x - apt-get --yes install ../*.deb + apt-get --yes --no-install-recommends install ../*.deb - name: Test debian packages run: | set -x @@ -277,11 +276,10 @@ jobs: - name: Install pre-dependencies run: | set -x - apt-get update + apt-get -q update apt --yes upgrade - apt-get --yes install curl # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts - name: Checkout repository uses: actions/checkout@v6 with: @@ -308,7 +306,7 @@ jobs: - name: Install debian packages run: | set -x - apt-get --yes install ../*.deb + apt-get --yes --no-install-recommends install ../*.deb - name: Gather build artifacts run: | set -x From 1cd4057c156e276dc6ca2d98f4e2f2f364dbe3de Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 18:43:53 +0200 Subject: [PATCH 09/13] ci: Verify clean / Script to add linuxcnc repo --- .github/scripts/add-linuxcnc-repository.sh | 19 ++++++++++ .github/scripts/install-rtai.sh | 26 +++++++++++++ .github/scripts/verify-clean-repo.sh | 37 ++++++++++++++++++ .github/workflows/ci.yml | 44 +++++++++++++++------- 4 files changed, 112 insertions(+), 14 deletions(-) create mode 100755 .github/scripts/add-linuxcnc-repository.sh create mode 100755 .github/scripts/install-rtai.sh create mode 100755 .github/scripts/verify-clean-repo.sh diff --git a/.github/scripts/add-linuxcnc-repository.sh b/.github/scripts/add-linuxcnc-repository.sh new file mode 100755 index 00000000000..2130927e1c1 --- /dev/null +++ b/.github/scripts/add-linuxcnc-repository.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +DIST=$1 + +echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ $DIST base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null +case $DIST in + 'buster' | 'bullseye' | 'bookworm') + gpg --homedir "${PWD}/gnupg" --export 3CB9FD148F374FEF | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null + ;; + *) + GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) + gpg --homedir "$GPGTMP" --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 + gpg --homedir "$GPGTMP" --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null + ;; +esac +sudo apt-get --quiet update diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh new file mode 100755 index 00000000000..7a9f37329a6 --- /dev/null +++ b/.github/scripts/install-rtai.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +DIST=$1 + +if false; then + #To install the RTAI deb's from linuxcnc base + .github/scripts/add-linuxcnc-repository.sh "$DIST" + sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 +else + #To install the RTAI deb's from NTULINUX git + TMPDIR=$(mktemp -d) + ( + cd "$TMPDIR" + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb + ) + sudo dpkg -i \ + "$TMPDIR/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb" \ + "$TMPDIR/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb" \ + "$TMPDIR/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb" + rm -rf "$TMPDIR" +fi \ No newline at end of file diff --git a/.github/scripts/verify-clean-repo.sh b/.github/scripts/verify-clean-repo.sh new file mode 100755 index 00000000000..54b23aa9c06 --- /dev/null +++ b/.github/scripts/verify-clean-repo.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong + +#To let the script fail if git status has any issues +#If a command in $() fails, the script just continues +git status -u --porcelain -- "$@" > /dev/null + +if [ $# -gt 0 ]; then + #Arguments are pathspecs for git status, used to exclude files for this test + if [ -n "$(git status -u --porcelain -- "$@")" ]; then + echo "Build produced untracked or modified files:----------------------------------------" + git status -u --porcelain -- "$@" + echo "-----------------------------------------------------------------------------------" + echo "Pathspec is: \"$*\", withouth pathspec:--------------------------------------------" + git status -u --porcelain + echo "-----------------------------------------------------------------------------------" + exit 1 + else + echo Repo is clean + echo "Pathspec is: \"$*\", withouth pathspec:--------------------------------------------" + git status -u --porcelain + echo "-----------------------------------------------------------------------------------" + exit 0 + fi +else + #No arguments: Test all files + if [ -n "$(git status -u --porcelain)" ]; then + echo "Build produced untracked or modified files:----------------------------------------" + git status -u --porcelain + echo "-----------------------------------------------------------------------------------" + exit 1 + else + echo Repo is clean + exit 0 + fi +fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0811a2f49d5..2da10b40a74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,10 +44,16 @@ jobs: ./configure --disable-check-runtime-deps make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs + - name: Verify no untracked or modified files after build + run: | + .github/scripts/verify-clean-repo.sh - name: Test run: | set -x ./scripts/rip-environment runtests -p + - name: Verify no untracked or modified files after test + run: | + .github/scripts/verify-clean-repo.sh rip-rtai: runs-on: ubuntu-24.04 @@ -66,20 +72,7 @@ jobs: - name: Install dependencies run: | set -x - #To install the RTAI deb's from linuxcnc base - #echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ trixie base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null - #GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) - #gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 - #gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null - #sudo apt-get update - #sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 - #----- - #To install the RTAI deb's from NTULINUX git - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb - sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb - #----- + .github/scripts/install-rtai.sh trixie ./scripts/travis-install-build-deps.sh - name: Build RIP RTAI run: | @@ -89,6 +82,9 @@ jobs: #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps ./configure --with-realtime=/usr/realtime-5.4.302-rtai-amd64 --disable-check-runtime-deps make -O -j$((1+$(nproc))) default pycheck V=1 + - name: Verify no untracked or modified files after build + run: | + .github/scripts/verify-clean-repo.sh rip-and-test-clang: runs-on: ubuntu-24.04 @@ -117,10 +113,16 @@ jobs: CC=clang CXX=clang++ ./configure --disable-check-runtime-deps make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs + - name: Verify no untracked or modified files after build + run: | + .github/scripts/verify-clean-repo.sh - name: Test run: | set -x ./scripts/rip-environment runtests -p + - name: Verify no untracked or modified files after test + run: | + .github/scripts/verify-clean-repo.sh cppcheck: runs-on: ubuntu-24.04 @@ -172,6 +174,10 @@ jobs: make -O -j$((1+$(nproc))) translateddocs make -O -j$((1+$(nproc))) docs # Note that the package build covers html docs + - name: Verify no untracked or modified files after build + run: | + #*.po and documentation.pot are modifyed by build. Ignore them for now. + .github/scripts/verify-clean-repo.sh ':(exclude)docs/po/*.po' ':(exclude)docs/po/documentation.pot' package-arch: runs-on: ${{ matrix.runner }} @@ -221,6 +227,9 @@ jobs: git diff apt-get --yes build-dep --arch-only . debuild -us -uc --build=any + - name: Verify no untracked or modified files after build + run: | + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' - name: Install debian packages run: | set -x @@ -233,6 +242,9 @@ jobs: adduser testrunner sudo chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner su -c "./scripts/runtests -p ./tests" testrunner + - name: Verify no untracked or modified files after test + run: | + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' - name: Gather build artifacts run: | set -x @@ -303,6 +315,10 @@ jobs: git diff apt-get --yes build-dep --indep-only . debuild -us -uc --build=all + - name: Verify no untracked or modified files after build + run: | + #*.po and documentation.pot are modifyed by build. Ignore them for now. + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' ':(exclude)docs/po/*.po' ':(exclude)docs/po/documentation.pot' - name: Install debian packages run: | set -x From dac678a1447579b4a233cceb60770370873b4366 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 10 May 2026 19:32:10 +0200 Subject: [PATCH 10/13] ci: Move build steps to scripts / new ci build dep Scripts are easier to test locally than if the shell code is in the ci.yml. They are also reusable. travis-install-build-deps.sh replaced by one script, only used in CI. --- .github/scripts/build-doc.sh | 12 ++++++ .github/scripts/build-package-arch.sh | 11 ++++++ .github/scripts/build-package-indep.sh | 11 ++++++ .github/scripts/build-rip.sh | 11 ++++++ .github/scripts/install-deps.sh | 9 +++++ .github/workflows/ci.yml | 54 +++++++------------------- 6 files changed, 67 insertions(+), 41 deletions(-) create mode 100755 .github/scripts/build-doc.sh create mode 100755 .github/scripts/build-package-arch.sh create mode 100755 .github/scripts/build-package-indep.sh create mode 100755 .github/scripts/build-rip.sh create mode 100755 .github/scripts/install-deps.sh diff --git a/.github/scripts/build-doc.sh b/.github/scripts/build-doc.sh new file mode 100755 index 00000000000..12dea6b7650 --- /dev/null +++ b/.github/scripts/build-doc.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +cd src +./autogen.sh +./configure --disable-check-runtime-deps --enable-build-documentation=html +make -O -j$((1+$(nproc))) manpages +make -O -j$((1+$(nproc))) translateddocs +make -O -j$((1+$(nproc))) docs +# Note that the package build covers html docs diff --git a/.github/scripts/build-package-arch.sh b/.github/scripts/build-package-arch.sh new file mode 100755 index 00000000000..1b6ba870fc4 --- /dev/null +++ b/.github/scripts/build-package-arch.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +debian/configure +debian/update-dch-from-git +scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION +git diff +apt-get --yes build-dep --arch-only . +debuild -us -uc --build=any diff --git a/.github/scripts/build-package-indep.sh b/.github/scripts/build-package-indep.sh new file mode 100755 index 00000000000..f5f1712c61a --- /dev/null +++ b/.github/scripts/build-package-indep.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +debian/configure +debian/update-dch-from-git +scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION +git diff +apt-get --yes build-dep --indep-only . +debuild -us -uc --build=all diff --git a/.github/scripts/build-rip.sh b/.github/scripts/build-rip.sh new file mode 100755 index 00000000000..17b5cae8485 --- /dev/null +++ b/.github/scripts/build-rip.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +#Any arguments are passed to configure + +cd src +./autogen.sh +./configure "$@" --disable-check-runtime-deps --enable-werror +make -O -j$((1+$(nproc))) default pycheck V=1 diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh new file mode 100755 index 00000000000..dee1d5084b3 --- /dev/null +++ b/.github/scripts/install-deps.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +sudo apt-get --quiet update +sudo apt-get install --yes --no-install-recommends devscripts equivs build-essential lintian clang +debian/configure +sudo apt-get --yes build-dep . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2da10b40a74..391feaa7116 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,22 +35,18 @@ jobs: - name: Install dependencies run: | set -x - ./scripts/travis-install-build-deps.sh + .github/scripts/install-deps.sh - name: Build RIP GCC run: | set -x - cd src - ./autogen.sh - ./configure --disable-check-runtime-deps - make -O -j$((1+$(nproc))) default pycheck V=1 - # Note that the package build covers html docs + .github/scripts/build-rip.sh --with-realtime=uspace - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh - name: Test run: | set -x - ./scripts/rip-environment runtests -p + scripts/rip-environment runtests -p - name: Verify no untracked or modified files after test run: | .github/scripts/verify-clean-repo.sh @@ -73,15 +69,11 @@ jobs: run: | set -x .github/scripts/install-rtai.sh trixie - ./scripts/travis-install-build-deps.sh + .github/scripts/install-deps.sh - name: Build RIP RTAI run: | set -x - cd src - ./autogen.sh - #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps - ./configure --with-realtime=/usr/realtime-5.4.302-rtai-amd64 --disable-check-runtime-deps - make -O -j$((1+$(nproc))) default pycheck V=1 + .github/scripts/build-rip.sh --with-realtime=/usr/realtime-* - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh @@ -103,23 +95,18 @@ jobs: - name: Install dependencies run: | set -x - ./scripts/travis-install-build-deps.sh - sudo apt-get -y install clang + .github/scripts/install-deps.sh - name: Build RIP Clang run: | set -x - cd src - ./autogen.sh - CC=clang CXX=clang++ ./configure --disable-check-runtime-deps - make -O -j$((1+$(nproc))) default pycheck V=1 - # Note that the package build covers html docs + CC=clang CXX=clang++ .github/scripts/build-rip.sh --with-realtime=uspace - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh - name: Test run: | set -x - ./scripts/rip-environment runtests -p + scripts/rip-environment runtests -p - name: Verify no untracked or modified files after test run: | .github/scripts/verify-clean-repo.sh @@ -164,16 +151,11 @@ jobs: - name: Install dependencies run: | set -x - ./scripts/travis-install-build-deps.sh + .github/scripts/install-deps.sh - name: Build HTML docmentation run: | - cd src - ./autogen.sh - ./configure --disable-check-runtime-deps --enable-build-documentation=html - make -O -j$((1+$(nproc))) manpages - make -O -j$((1+$(nproc))) translateddocs - make -O -j$((1+$(nproc))) docs - # Note that the package build covers html docs + set -x + .github/scripts/build-doc.sh - name: Verify no untracked or modified files after build run: | #*.po and documentation.pot are modifyed by build. Ignore them for now. @@ -221,12 +203,7 @@ jobs: DEBFULLNAME: LinuxCNC Github CI Robot run: | set -x - debian/configure - debian/update-dch-from-git - scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - git diff - apt-get --yes build-dep --arch-only . - debuild -us -uc --build=any + .github/scripts/build-package-arch.sh - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' @@ -309,12 +286,7 @@ jobs: DEBFULLNAME: LinuxCNC Github CI Robot run: | set -x - debian/configure - debian/update-dch-from-git - scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - git diff - apt-get --yes build-dep --indep-only . - debuild -us -uc --build=all + .github/scripts/build-package-indep.sh - name: Verify no untracked or modified files after build run: | #*.po and documentation.pot are modifyed by build. Ignore them for now. From 5d143561d2208737c435f0bbcda61d026320416c Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 14 May 2026 19:16:36 +0200 Subject: [PATCH 11/13] ci 2.9: Fix gitignores --- debian/.gitignore | 8 ++++++++ docs/man/.gitignore | 1 + 2 files changed, 9 insertions(+) diff --git a/debian/.gitignore b/debian/.gitignore index 30986dbd344..7654817ba0d 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -12,7 +12,15 @@ linuxcnc-doc-*/ # generated from `.in` by debian/configure linuxcnc-uspace.install +linuxcnc-uspace.manpages *.debhelper shlibs.local linuxcnc-uspace.lintian-overrides + +autoreconf.after +autoreconf.before +debhelper-build-stamp + +# from debian/tests +*.out diff --git a/docs/man/.gitignore b/docs/man/.gitignore index cd10c95b6dc..c61f9accb94 100644 --- a/docs/man/.gitignore +++ b/docs/man/.gitignore @@ -158,6 +158,7 @@ man9/pcl720.9 man9/plasmac.9 man9/pluto_servo.9 man9/pluto_step.9 +man9/radiobutton.9 man9/raster.9 man9/reset.9 man9/safety_latch.9 From 5a77718acf06e2f26d76e9e52b495e293b1893b2 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Fri, 15 May 2026 14:42:58 +0200 Subject: [PATCH 12/13] ci 2.9: Needs linuxcnc repo for newer po4a in bullseye --- .github/scripts/add-linuxcnc-repository.sh | 1 + .github/workflows/ci.yml | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/scripts/add-linuxcnc-repository.sh b/.github/scripts/add-linuxcnc-repository.sh index 2130927e1c1..43f3e16dcaf 100755 --- a/.github/scripts/add-linuxcnc-repository.sh +++ b/.github/scripts/add-linuxcnc-repository.sh @@ -5,6 +5,7 @@ set -x DIST=$1 +mkdir -p /etc/apt/keyrings echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ $DIST base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null case $DIST in 'buster' | 'bullseye' | 'bookworm') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 391feaa7116..1b6366580bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -268,7 +268,7 @@ jobs: apt-get -q update apt --yes upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts + apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts sudo - name: Checkout repository uses: actions/checkout@v6 with: @@ -276,6 +276,16 @@ jobs: # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 + - name: Add linuxcnc.org deb archive + env: + DEBIAN_FRONTEND: noninteractive + run: | + set -x + if [ "${{matrix.image}}" = debian:bullseye ] ; then + #For "debian:bullseye", po4a from linuxcnc repo is needed for sucessfull build + DIST=$(echo ${{matrix.image}} | cut -d : -f 2) + .github/scripts/add-linuxcnc-repository.sh $DIST + fi - name: Git config run: | set -x From 395e9ad813c8dc6792767c122ecb9b7b844c9ecb Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Fri, 15 May 2026 14:47:41 +0200 Subject: [PATCH 13/13] ci 2.9: cppcheck not supported on 2.9 --- .github/workflows/ci.yml | 45 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b6366580bd..f24d4ed7f4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,28 +111,29 @@ jobs: run: | .github/scripts/verify-clean-repo.sh - cppcheck: - runs-on: ubuntu-24.04 - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - submodules: false - fetch-depth: 1 - - name: Install dependencies - run: | - set -x - sudo apt-get -q update - sudo apt-get --yes install cppcheck shellcheck - - name: Cppcheck - continue-on-error: true - run: | - set -x - scripts/cppcheck.sh - - name: Shellcheck - continue-on-error: true - run: | - scripts/shellcheck.sh +# Not supported on 2.9 +# cppcheck: +# runs-on: ubuntu-24.04 +# steps: +# - name: Checkout repository +# uses: actions/checkout@v6 +# with: +# submodules: false +# fetch-depth: 1 +# - name: Install dependencies +# run: | +# set -x +# sudo apt-get -q update +# sudo apt-get --yes install cppcheck shellcheck +# - name: Cppcheck +# continue-on-error: true +# run: | +# set -x +# scripts/cppcheck.sh +# - name: Shellcheck +# continue-on-error: true +# run: | +# scripts/shellcheck.sh htmldocs: runs-on: ubuntu-24.04