From cfc01eab6854a8400dfb0e300b5421d5b3b9eeef Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 13 Feb 2026 09:19:02 -0800 Subject: [PATCH 1/5] Fixed CI runner failure when executing tests --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 10 ++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09ecb68..2b68240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,40 @@ env: RUST_TOOLCHAIN: "1.92" jobs: + linux-x64: + name: Linux x64 + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + # Free up disk space on Ubuntu runners + - name: Free Disk Space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force + df -h + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + profile: minimal + override: true + + - uses: swatinem/rust-cache@v2 + with: + shared-key: kingfisher-${{ runner.os }}-${{ runner.arch }} + cache-on-failure: true + + - name: Build (Makefile linux-x64) + run: make ubuntu-x64 + - name: Run tests + run: make tests + env: + CARGO_BUILD_JOBS: 1 + linux-arm64: name: Linux arm64 runs-on: ubuntu-24.04-arm diff --git a/Makefile b/Makefile index 748518a..b208654 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ SHELL := /usr/bin/env bash .SHELLFLAGS := -eu -o pipefail -c PROJECT_NAME := kingfisher +ZIG_VERSION ?= 0.15.1 # Determine OS and whether to use gtar on darwin OS := $(shell uname) @@ -74,7 +75,7 @@ create-dockerignore: .PHONY: setup-zig setup-zig: @command -v zig >/dev/null 2>&1 || { \ - echo "⬇️ Installing Zig 0.14.0 …"; \ + echo "⬇️ Installing Zig $(ZIG_VERSION) …"; \ if $(SUDO_CMD) apt-get update -qq && \ $(SUDO_CMD) apt-get install -y --no-install-recommends zig 2>/dev/null ; then \ echo "✓ Zig installed via apt"; \ @@ -82,11 +83,11 @@ setup-zig: echo "⚠️ Package 'zig' not in apt repos – falling back to manual install"; \ arch=$$(uname -m); \ case "$$arch" in \ - x86_64) pkg=zig-linux-x86_64-0.14.0 ;; \ - aarch64|arm64) pkg=zig-linux-aarch64-0.14.0 ;; \ + x86_64) pkg=zig-linux-x86_64-$(ZIG_VERSION) ;; \ + aarch64|arm64) pkg=zig-linux-aarch64-$(ZIG_VERSION) ;; \ *) echo "Unsupported architecture: $$arch"; exit 1 ;; \ esac; \ - curl -L -o /tmp/zig.tar.xz https://ziglang.org/download/0.14.0/$${pkg}.tar.xz; \ + curl -L -o /tmp/zig.tar.xz https://ziglang.org/download/$(ZIG_VERSION)/$${pkg}.tar.xz; \ tar -C /tmp -xf /tmp/zig.tar.xz; \ $(SUDO_CMD) mv /tmp/$${pkg} /opt/zig; \ $(SUDO_CMD) ln -sf /opt/zig/zig /usr/local/bin/zig; \ @@ -128,6 +129,7 @@ ubuntu-x64: setup-zig # ensures Zig & cargo-zigbuild exist @. $$HOME/.cargo/env && \ rustup target add x86_64-unknown-linux-musl && \ export PKG_CONFIG_ALLOW_CROSS=1 && \ + export CMAKE_ARGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \ cargo zigbuild --release --target x86_64-unknown-linux-musl @echo "🗜️ Packaging archive …" From 409e1557dea778447af7312bb60d0f6eb987c389 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 13 Feb 2026 09:35:04 -0800 Subject: [PATCH 2/5] Fixed CI runner failure when executing tests --- Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b208654..8e65ee4 100644 --- a/Makefile +++ b/Makefile @@ -83,13 +83,26 @@ setup-zig: echo "⚠️ Package 'zig' not in apt repos – falling back to manual install"; \ arch=$$(uname -m); \ case "$$arch" in \ - x86_64) pkg=zig-linux-x86_64-$(ZIG_VERSION) ;; \ - aarch64|arm64) pkg=zig-linux-aarch64-$(ZIG_VERSION) ;; \ + x86_64) arch_tag=x86_64 ;; \ + aarch64|arm64) arch_tag=aarch64 ;; \ *) echo "Unsupported architecture: $$arch"; exit 1 ;; \ esac; \ - curl -L -o /tmp/zig.tar.xz https://ziglang.org/download/$(ZIG_VERSION)/$${pkg}.tar.xz; \ + url_new="https://ziglang.org/download/$(ZIG_VERSION)/zig-$${arch_tag}-linux-$(ZIG_VERSION).tar.xz"; \ + url_old="https://ziglang.org/download/$(ZIG_VERSION)/zig-linux-$${arch_tag}-$(ZIG_VERSION).tar.xz"; \ + if ! curl -fL --retry 3 --retry-delay 2 -o /tmp/zig.tar.xz "$$url_new"; then \ + echo "↩️ New Zig filename pattern failed, trying legacy pattern"; \ + curl -fL --retry 3 --retry-delay 2 -o /tmp/zig.tar.xz "$$url_old"; \ + fi; \ + xz -t /tmp/zig.tar.xz >/dev/null 2>&1 || { \ + echo "Downloaded Zig archive is invalid (not a tar.xz)."; \ + ls -lh /tmp/zig.tar.xz || true; \ + exit 1; \ + }; \ tar -C /tmp -xf /tmp/zig.tar.xz; \ - $(SUDO_CMD) mv /tmp/$${pkg} /opt/zig; \ + zig_dir=$$(tar -tf /tmp/zig.tar.xz | head -n1 | cut -d/ -f1); \ + [ -n "$$zig_dir" ] || { echo "Could not determine Zig extract directory"; exit 1; }; \ + $(SUDO_CMD) rm -rf /opt/zig; \ + $(SUDO_CMD) mv "/tmp/$${zig_dir}" /opt/zig; \ $(SUDO_CMD) ln -sf /opt/zig/zig /usr/local/bin/zig; \ echo "✓ Zig installed to /usr/local/bin/zig"; \ fi; \ From 56827ae342ad8a13b023bacc05daa92021c3a7e2 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 13 Feb 2026 09:39:41 -0800 Subject: [PATCH 3/5] Fixed CI runner failure when executing tests --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8e65ee4..7487576 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,8 @@ setup-zig: exit 1; \ }; \ tar -C /tmp -xf /tmp/zig.tar.xz; \ - zig_dir=$$(tar -tf /tmp/zig.tar.xz | head -n1 | cut -d/ -f1); \ + tar -tf /tmp/zig.tar.xz > /tmp/zig-contents.txt; \ + IFS=/ read -r zig_dir _ < /tmp/zig-contents.txt; \ [ -n "$$zig_dir" ] || { echo "Could not determine Zig extract directory"; exit 1; }; \ $(SUDO_CMD) rm -rf /opt/zig; \ $(SUDO_CMD) mv "/tmp/$${zig_dir}" /opt/zig; \ From 09ed89eec20830ffc9ec1f4724df52ad409eb621 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 13 Feb 2026 09:57:44 -0800 Subject: [PATCH 4/5] Fixed CI runner failure when executing tests --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7487576..005f7d7 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,8 @@ ubuntu-x64: setup-zig # ensures Zig & cargo-zigbuild exist @. $$HOME/.cargo/env && \ rustup target add x86_64-unknown-linux-musl && \ export PKG_CONFIG_ALLOW_CROSS=1 && \ - export CMAKE_ARGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \ + export CFLAGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \ + export CXXFLAGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \ cargo zigbuild --release --target x86_64-unknown-linux-musl @echo "🗜️ Packaging archive …" From a36634c4b447d843bbb27126fda912d801e54d84 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 13 Feb 2026 10:04:18 -0800 Subject: [PATCH 5/5] Fixed CI runner failure when executing tests --- Makefile | 2 -- vendor/vectorscan-rs/vectorscan-rs-sys/build.rs | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 005f7d7..3067d5c 100644 --- a/Makefile +++ b/Makefile @@ -143,8 +143,6 @@ ubuntu-x64: setup-zig # ensures Zig & cargo-zigbuild exist @. $$HOME/.cargo/env && \ rustup target add x86_64-unknown-linux-musl && \ export PKG_CONFIG_ALLOW_CROSS=1 && \ - export CFLAGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \ - export CXXFLAGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \ cargo zigbuild --release --target x86_64-unknown-linux-musl @echo "🗜️ Packaging archive …" diff --git a/vendor/vectorscan-rs/vectorscan-rs-sys/build.rs b/vendor/vectorscan-rs/vectorscan-rs-sys/build.rs index 9708caf..24efe33 100644 --- a/vendor/vectorscan-rs/vectorscan-rs-sys/build.rs +++ b/vendor/vectorscan-rs/vectorscan-rs-sys/build.rs @@ -262,6 +262,16 @@ fn main() { .define("BUILD_SVE2_BITPERM", "OFF"); } + // Under cargo-zigbuild for x86_64-unknown-linux-musl, Vectorscan's + // configure-time probes can incorrectly miss posix_memalign/unistd. + // Scope this workaround to musl targets only to avoid impacting + // unrelated native dependencies. + let target = env("TARGET"); + if target.ends_with("-musl") { + cfg.define("HAVE_UNISTD_H", "1") + .define("HAVE_POSIX_MEMALIGN", "1"); + } + let dst = cfg.build(); println!("cargo:rustc-link-lib=static=hs"); println!("cargo:rustc-link-search={}", dst.join("lib").display());