From a5b8f0ed1004d4d88b765867fede1fdf72150fdc Mon Sep 17 00:00:00 2001 From: Malcolm Fell Date: Tue, 28 Jul 2026 10:37:28 +1200 Subject: [PATCH] install/build: require macOS 26 with a clear early error install.sh checked Darwin + arm64 but not the OS version. maic needs FoundationModels (macOS 26+), so on older macOS the install succeeded and the binary then failed to launch with a cryptic dyld version error. Add a sw_vers guard to both install.sh and build.sh so they fail fast with 'requires macOS 26 or later (detected )' instead. Closes #8 --- build.sh | 5 +++++ install.sh | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/build.sh b/build.sh index a8e776a..5e05703 100755 --- a/build.sh +++ b/build.sh @@ -6,6 +6,11 @@ cd "$(dirname "$0")" PREFIX="${PREFIX:-$HOME/.local/bin}" +# maic needs FoundationModels, which only exists on macOS 26+. Fail early with a +# clear message rather than letting `swift build` emit an opaque SDK error. +os_ver="$(sw_vers -productVersion)" +[ "${os_ver%%.*}" -ge 26 ] 2>/dev/null || { echo "build: maic requires macOS 26 or later (detected $os_ver)." >&2; exit 1; } + echo "Building (release)…" swift build -c release diff --git a/install.sh b/install.sh index 83c9e7e..49048f6 100755 --- a/install.sh +++ b/install.sh @@ -28,6 +28,12 @@ esac arch="$(uname -m)" [ "$arch" = "arm64" ] || err "maic ships arm64-only (Apple silicon); detected '$arch'." +# maic needs FoundationModels, which only exists on macOS 26+. Without this the +# install succeeds but the binary can't launch (a cryptic dyld version error) — +# so fail here with a clear message instead. +os_ver="$(sw_vers -productVersion)" +[ "${os_ver%%.*}" -ge 26 ] 2>/dev/null || err "maic requires macOS 26 or later (detected $os_ver)." + for tool in curl tar shasum; do command -v "$tool" >/dev/null 2>&1 || err "required tool not found: $tool" done