From 642bd944d164e9f4ad64de7e864a33753749a20b Mon Sep 17 00:00:00 2001 From: MrDavid5465 Date: Mon, 7 Sep 2026 19:51:04 -0400 Subject: [PATCH 1/3] fix(rpm): always start from a fresh clone unless a tree is staged My packaging change made the clone in %prep conditional on $RPM_SOURCE_DIR/simapi being absent, and dropped the `rm -rf` that used to remove it. On a GitHub-hosted runner that is harmless -- the directory never exists -- but the fedora-43 job runs on a self-hosted runner where ~/rpmbuild/SOURCES persists between builds, so the clone was skipped and whatever tree was left over from the previous release got built instead. Staging is now opt-in via --define "staged 1". Without it the behaviour is exactly what it was before: remove any previous checkout, clone fresh. Co-Authored-By: Claude Opus 5 --- tools/distro/fedora/rpm/simapi.spec | 7 ++++++- tools/distro/fedora/rpm/simd.spec | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/distro/fedora/rpm/simapi.spec b/tools/distro/fedora/rpm/simapi.spec index 3fdaeed..fd605b0 100644 --- a/tools/distro/fedora/rpm/simapi.spec +++ b/tools/distro/fedora/rpm/simapi.spec @@ -21,7 +21,12 @@ Racing Simulator Telemetry Libraries # CI stages the checked-out tree; a bare `rpmbuild -ba` still works as before. %prep rm -rf $RPM_BUILD_DIR/simapi -if [ ! -d $RPM_SOURCE_DIR/simapi ]; then +# Staging a tree is opt-in, via --define "staged 1". Without it this always +# starts from a fresh clone, including removing any previous $RPM_SOURCE_DIR +# checkout: on a self-hosted runner that directory persists between builds, so +# reusing whatever happens to be there silently builds a stale tree. +if [ "%{?staged}" != "1" ]; then + rm -rf $RPM_SOURCE_DIR/simapi cd $RPM_SOURCE_DIR git clone https://github.com/spacefreak18/simapi fi diff --git a/tools/distro/fedora/rpm/simd.spec b/tools/distro/fedora/rpm/simd.spec index 62c9a8a..db269d3 100644 --- a/tools/distro/fedora/rpm/simd.spec +++ b/tools/distro/fedora/rpm/simd.spec @@ -23,7 +23,12 @@ Racing Simulator Telemetry Libraries # CI stages the checked-out tree; a bare `rpmbuild -ba` still works as before. %prep rm -rf $RPM_BUILD_DIR/simapi -if [ ! -d $RPM_SOURCE_DIR/simapi ]; then +# Staging a tree is opt-in, via --define "staged 1". Without it this always +# starts from a fresh clone, including removing any previous $RPM_SOURCE_DIR +# checkout: on a self-hosted runner that directory persists between builds, so +# reusing whatever happens to be there silently builds a stale tree. +if [ "%{?staged}" != "1" ]; then + rm -rf $RPM_SOURCE_DIR/simapi cd $RPM_SOURCE_DIR git clone https://github.com/spacefreak18/simapi fi From a24f36e4aebdd9634ff95e03b852b89dca34c6e1 Mon Sep 17 00:00:00 2001 From: MrDavid5465 Date: Mon, 7 Sep 2026 19:51:21 -0400 Subject: [PATCH 2/3] ci: opt in to the staged tree when building rpms %prep now clones unless --define "staged 1" is passed, so the job that stages the checkout has to say so. Without this the rpm would be built from a fresh clone of the default branch rather than the commit being released. Co-Authored-By: Claude Opus 5 --- .github/workflows/packages.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index d6401b0..eaa4756 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -200,7 +200,12 @@ jobs: # The specs' hardcoded `Version: 0.0.5` is stale; stamped from the # tag here so the file stays a working default for a local rpmbuild. for spec in simapi simd; do - rpmbuild -ba --define "_version ${{ steps.pkgver.outputs.version }}" \ + # staged=1 tells %prep to use the tree copied into SOURCES above + # rather than cloning. Without it the spec clones the default + # branch, and the rpm's contents would track master rather than + # the tag being built. + rpmbuild -ba --define "staged 1" \ + --define "_version ${{ steps.pkgver.outputs.version }}" \ --define "version ${{ steps.pkgver.outputs.version }}" \ tools/distro/fedora/rpm/$spec.spec done From 037790648331ad18b74bde8f592723cf764eb047 Mon Sep 17 00:00:00 2001 From: MrDavid5465 Date: Mon, 7 Sep 2026 19:52:09 -0400 Subject: [PATCH 3/3] ci: drop the package jobs that packages.yml already builds These two jobs and the ones in packages.yml build the same artifacts and upload them to the same release under the same filenames -- libsimapi- fedora-43.rpm, simd-debian-stable.deb and the rest. On a tag they race. That is my fault: I added packages.yml without noticing this workflow already released those names. They are also the last self-hosted jobs here. build-simapi-rpms is what failed on 0.1.21, with simd.c:12 unable to find yder.h: the job installs no dependencies at all, relying on whatever was hand-installed on that machine, and Fedora packages neither yder nor orcania. Three months after the last release the runner no longer had them. packages.yml builds fedora-43 and 44 in containers and vendors both as static libraries, so the same rpm is produced on an ordinary GitHub-hosted runner with nothing to maintain by hand. It also adds fedora-44, which was never covered here. The deb matrix is the same story: ubuntu-latest, debian-latest and debian-stable are runner labels resolving to self-hosted machines, and packages.yml builds all three in containers. The nix jobs stay -- they run on ubuntu-latest and nothing else covers them. Co-Authored-By: Claude Opus 5 --- .github/workflows/ci.yaml | 105 -------------------------------------- 1 file changed, 105 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a48fa12..ef7596d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,111 +6,6 @@ on: jobs: - build-simapi: - - strategy: - matrix: - os: [ubuntu-latest, debian-latest, debian-stable] - runs-on: ${{ matrix.os }} - - permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - - name: Set build dir - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - github_sha_hash=${{ github.sha }} - echo "github-sha-short=${github_sha_hash:0:7}" >> $GITHUB_OUTPUT - - - name: Update apt - run: sudo apt update - - name: Install Dependencies - run: sudo apt install -y libuv1-dev libargtable2-dev libconfig-dev libyder-dev libproc2-dev - - - name: Configure CMake - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=g++ - -DCMAKE_C_COMPILER=gcc - -DCMAKE_BUILD_TYPE=Release - -DBUILD_SIMD=ON - -S ${{ github.workspace }} - - - name: Build - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release - - - name: Build simapi debian package - run: | - rm -rf SIMAPI_PKG_SOURCE - mkdir SIMAPI_PKG_SOURCE - mkdir -p SIMAPI_PKG_SOURCE/DEBIAN - mkdir -p SIMAPI_PKG_SOURCE/usr/lib/x86_64-linux-gnu/ - cp ./tools/distro/debian/dpkg/${{ matrix.os }}/simapi_control ./SIMAPI_PKG_SOURCE/DEBIAN/control - cp -r \ - build/libsimapi.so \ - build/libsimapi.so.1 \ - build/libsimapi.so.1.0.1 \ - SIMAPI_PKG_SOURCE/usr/lib/x86_64-linux-gnu/ - dpkg-deb --build SIMAPI_PKG_SOURCE simapi-${{ matrix.os }}.deb - - - name: Build simd debian package - run: | - rm -rf SIMD_PKG_SOURCE - mkdir SIMD_PKG_SOURCE - mkdir -p SIMD_PKG_SOURCE/DEBIAN - mkdir -p SIMD_PKG_SOURCE/usr/bin/ - cp ./tools/distro/debian/dpkg/${{ matrix.os }}/simd_control ./SIMD_PKG_SOURCE/DEBIAN/control - cp build/simd/simd ./SIMD_PKG_SOURCE/usr/bin/simd - dpkg-deb --build SIMD_PKG_SOURCE simd-${{ matrix.os }}.deb - - - name: Release the Package - uses: softprops/action-gh-release@v1 - with: - files: simapi-${{ matrix.os }}.deb - - - name: Release the Package - uses: softprops/action-gh-release@v1 - with: - files: simd-${{ matrix.os }}.deb - - build-simapi-rpms: - strategy: - matrix: - os: [fedora-43] - runs-on: ${{ matrix.os }} - permissions: - contents: write - steps: - - - name: create rpmbuild dirs - run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - - name: get spec file - run: curl -o ~/simapi.spec https://raw.githubusercontent.com/Spacefreak18/simapi/refs/heads/master/tools/distro/fedora/rpm/simapi.spec - - name: run spec file - run: rpmbuild -ba ~/simapi.spec - - name: rename file - run: cp ~/rpmbuild/RPMS/x86_64/libsimapi-0.0.5-1.x86_64.rpm $GITHUB_WORKSPACE/libsimapi-${{ matrix.os }}.rpm - - name: get spec file - run: curl -o ~/simd.spec https://raw.githubusercontent.com/Spacefreak18/simapi/refs/heads/master/tools/distro/fedora/rpm/simd.spec - - name: run spec file - run: rpmbuild -ba ~/simd.spec - - name: rename file - run: cp ~/rpmbuild/RPMS/x86_64/simd-0.0.5-1.x86_64.rpm $GITHUB_WORKSPACE/simd-${{ matrix.os }}.rpm - - name: Release libsimapi Package - uses: softprops/action-gh-release@v1 - with: - files: libsimapi-${{ matrix.os }}.rpm - - name: Release simd Package - uses: softprops/action-gh-release@v1 - with: - files: simd-${{ matrix.os }}.rpm - - build-simapi-nix: runs-on: ubuntu-latest