Skip to content

Commit 6b9f1bd

Browse files
localai-botmudler
andauthored
chore: ⬆️ Update antirez/ds4 to e34a8086693ba7ca5cfabd2b9028ee52f0bfac2e (#10350)
* ⬆️ Update antirez/ds4 Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(ds4): add Homebrew include/lib prefix for Darwin grpc-proto build The darwin/metal ds4 backend job runs for the first time on this bump (it was skipped on prior ds4 PRs) and fails compiling backend.pb.cc with 'google/protobuf/runtime_version.h' file not found. hw_grpc_proto links neither protobuf::libprotobuf nor gRPC::grpc++, so the generated proto sources rely on default system include paths. That works on Linux (/usr/include) but not on macOS, where Homebrew installs under /opt/homebrew. Add the Homebrew prefix to include/link dirs on Darwin, mirroring the llama-cpp backend that already builds on Darwin CI. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:claude-opus-4-8 [Claude Code] * fix(ds4): install nlohmann-json on Darwin CI for ds4 backend After the protobuf include-path fix the ds4 darwin build advances to compiling dsml_renderer.cpp, which includes <nlohmann/json.hpp> and #errors when absent. On Linux the header comes from apt nlohmann-json3-dev in the build image; the macOS runner had no equivalent. Add the header-only nlohmann-json formula to the shared Darwin backend brew install/link list and Homebrew cache, alongside the existing deps. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:claude-opus-4-8 [Claude Code] * fix(ds4): build proper OCI image tar for Darwin backend The darwin packaging referenced scripts/build/oci-pack.sh, which was never added to the tree, so it fell back to a plain 'tar' that omits manifest.json. 'local-ai backends install' then rejects the tarball with 'file manifest.json not found in tar'. Use './local-ai util create-oci-image' (already built by the 'build' prerequisite of the backends/ds4-darwin target), mirroring llama-cpp-darwin.sh, to emit a real OCI image the installer accepts. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:claude-opus-4-8 [Claude Code] --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 416f871 commit 6b9f1bd

4 files changed

Lines changed: 39 additions & 13 deletions

File tree

.github/workflows/backend_build_darwin.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
/opt/homebrew/Cellar/hiredis
9999
/opt/homebrew/Cellar/xxhash
100100
/opt/homebrew/Cellar/zstd
101+
/opt/homebrew/Cellar/nlohmann-json
101102
key: brew-${{ runner.os }}-${{ runner.arch }}-v1-${{ hashFiles('.github/workflows/backend_build_darwin.yml') }}
102103

103104
- name: Dependencies
@@ -109,7 +110,10 @@ jobs:
109110
# Without explicitly installing them, a brew cache-hit run restores
110111
# ccache's Cellar dir but skips installing those transitive deps,
111112
# and ccache fails at runtime with `dyld: Library not loaded`.
112-
brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache blake3 fmt hiredis xxhash zstd
113+
# nlohmann-json is header-only and required by the ds4 backend
114+
# (dsml_renderer.cpp includes <nlohmann/json.hpp>); on Linux it comes
115+
# from the apt-installed nlohmann-json3-dev in the build image.
116+
brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache blake3 fmt hiredis xxhash zstd nlohmann-json
113117
# Force-reinstall ccache so brew re-validates its full runtime-dep
114118
# closure on every run. This is the durable fix: when the upstream
115119
# ccache formula gains a new transitive dep (as it has multiple times
@@ -128,7 +132,7 @@ jobs:
128132
# and decides "already installed" without re-linking, so on a cache-
129133
# hit run the formulas aren't on PATH. Force-link them; --overwrite
130134
# tolerates pre-existing symlinks from earlier installs.
131-
brew link --overwrite protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache blake3 fmt hiredis xxhash zstd 2>/dev/null || true
135+
brew link --overwrite protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache blake3 fmt hiredis xxhash zstd nlohmann-json 2>/dev/null || true
132136
133137
- name: Save Homebrew cache
134138
if: github.event_name != 'pull_request' && steps.brew-cache.outputs.cache-hit != 'true'
@@ -148,6 +152,7 @@ jobs:
148152
/opt/homebrew/Cellar/hiredis
149153
/opt/homebrew/Cellar/xxhash
150154
/opt/homebrew/Cellar/zstd
155+
/opt/homebrew/Cellar/nlohmann-json
151156
key: brew-${{ runner.os }}-${{ runner.arch }}-v1-${{ hashFiles('.github/workflows/backend_build_darwin.yml') }}
152157

153158
# ---- ccache for llama.cpp CMake builds ----

backend/cpp/ds4/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ option(DS4_NATIVE "Compile with -march=native / -mcpu=native" ON)
99
set(DS4_GPU "cpu" CACHE STRING "GPU backend: cpu, cuda, or metal")
1010
set(DS4_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ds4" CACHE PATH "Path to cloned ds4 source")
1111

12+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
13+
# Homebrew installs protobuf/grpc under a non-default prefix. The generated
14+
# backend.pb.cc / backend.grpc.pb.cc pull in google/protobuf and grpcpp
15+
# headers, but the hw_grpc_proto library links neither target, so on macOS
16+
# the headers (e.g. google/protobuf/runtime_version.h) are never on the
17+
# compiler's include path. Add the Homebrew prefix globally, matching the
18+
# llama-cpp backend which builds on Darwin CI.
19+
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")
20+
set(HOMEBREW_DEFAULT_PREFIX "/opt/homebrew")
21+
else()
22+
set(HOMEBREW_DEFAULT_PREFIX "/usr/local")
23+
endif()
24+
link_directories("${HOMEBREW_DEFAULT_PREFIX}/lib")
25+
include_directories("${HOMEBREW_DEFAULT_PREFIX}/include")
26+
endif()
27+
1228
find_package(Threads REQUIRED)
1329
find_package(Protobuf CONFIG QUIET)
1430
if(NOT Protobuf_FOUND)

backend/cpp/ds4/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# ds4 backend Makefile.
22
#
3-
# Upstream pin lives below as DS4_VERSION?=d881f2a05e8ff6bec001315a36b794b4aa310173
3+
# Upstream pin lives below as DS4_VERSION?=e34a8086693ba7ca5cfabd2b9028ee52f0bfac2e
44
# (.github/bump_deps.sh) can find and update it - matches the
55
# llama-cpp / ik-llama-cpp / turboquant convention.
66

7-
DS4_VERSION?=d881f2a05e8ff6bec001315a36b794b4aa310173
7+
DS4_VERSION?=e34a8086693ba7ca5cfabd2b9028ee52f0bfac2e
88
DS4_REPO?=https://github.com/antirez/ds4
99

1010
CURRENT_MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

scripts/build/ds4-darwin.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ done
4141
echo "Bundled libraries:"
4242
ls -la build/darwin/lib
4343

44-
# Build an OCI tar that local-ai backends install can consume.
45-
# scripts/build/oci-pack.sh is the existing helper used by llama-cpp-darwin
46-
# - if your tree doesn't have it, write one (5 lines: tar + manifest.json).
47-
if [ -f scripts/build/oci-pack.sh ]; then
48-
bash scripts/build/oci-pack.sh build/darwin backend-images/ds4.tar "$IMAGE_NAME"
49-
else
50-
# Fallback: simple tar - local-ai accepts a flat tar in dev environments.
51-
tar -C build/darwin -cvf backend-images/ds4.tar .
52-
fi
44+
# Build an OCI image tar (with manifest.json) that `local-ai backends install`
45+
# can consume - mirrors llama-cpp-darwin.sh. The previously referenced
46+
# scripts/build/oci-pack.sh helper was never added to the tree, so the
47+
# plain-tar fallback produced a manifest-less tarball the installer rejects
48+
# with "file manifest.json not found in tar".
49+
PLATFORMARCH="${PLATFORMARCH:-darwin/arm64}"
50+
51+
./local-ai util create-oci-image \
52+
build/darwin/. \
53+
--output ./backend-images/ds4.tar \
54+
--image-name "$IMAGE_NAME" \
55+
--platform "$PLATFORMARCH"
56+
57+
rm -rf build/darwin

0 commit comments

Comments
 (0)