Files
LocalAI/scripts/build/package-gpu-libs-darwin_test.sh
T
localai-org-maint-botandlocalai-org-maint-bot def5a0085e fix(packaging): skip Linux GPU libraries on Darwin (#12466)
Return before initializing Linux library helpers on macOS. The system
Bash lacks associative arrays, and Metal uses system frameworks.

Assisted-by: Codex:gpt-6

Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
2026-10-04 08:47:32 +02:00

20 lines
563 B
Bash

#!/bin/bash
# Darwin uses system GPU frameworks and ships Bash 3.2 without associative arrays.
set -euo pipefail
SCRIPT="$(dirname "$(realpath "$0")")/package-gpu-libs.sh"
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
uname() { echo Darwin; }
declare() {
if [[ "${1:-}" == -A ]]; then
echo 'Bash 3.2 does not support declare -A' >&2
return 2
fi
builtin declare "$@"
}
export BUILD_TYPE=metal
source "$SCRIPT" "$WORK/lib"
package_gpu_libs
test -z "$(find "$WORK" -type f -print)"
echo 'PASS: Darwin does not load the Linux GPU packager'