From 0e1071782cca9508b318ec71e9836bf46acc2e1e Mon Sep 17 00:00:00 2001 From: phibkro <71797726+phibkro@users.noreply.github.com> Date: Fri, 5 Jun 2026 00:00:00 +0200 Subject: [PATCH 1/2] ollama: 0.30.4 -> 0.30.5 Upstream patch release; notably fixes a divide-by-zero crash in gemma3:12b. Bumps the vendored llama.cpp pin b9493 -> b9509 to match upstream's LLAMA_CPP_VERSION. Verified ollama-cuda + ollama-vulkan build on x86_64-linux. https://github.com/ollama/ollama/releases/tag/v0.30.5 Assisted-by: Claude Opus 4.7 --- pkgs/by-name/ol/ollama/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index ff7f72b6883c..3239f81dd1f9 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -110,13 +110,13 @@ let # Since v0.30, llama.cpp is consumed via CMake FetchContent rather than # vendored in-tree. Pre-stage the pinned commit (read from upstream's - # `LLAMA_CPP_VERSION` file — currently `b9493`) so the FetchContent step + # `LLAMA_CPP_VERSION` file — currently `b9509`) so the FetchContent step # uses our copy instead of trying to clone over the network in the sandbox. llamaCppSrc = fetchFromGitHub { owner = "ggml-org"; repo = "llama.cpp"; - rev = "a731805cedc83c0514cbd808a2e38ec46c759cc2"; # tag b9493 - hash = "sha256-DO9J1mx9Jlp6qtCiJp2ZEi6R7H2YX1/sD7DGgBCtt0U="; + rev = "6f3a9f3dee3c27545371044a3a38005721ac8a8e"; # tag b9509 + hash = "sha256-bO1ucb/+vidj/EYzNCssotjte9NlVLdjC794jToNNeM="; }; wrapperOptions = [ @@ -152,13 +152,13 @@ let in goBuild (finalAttrs: { pname = "ollama"; - version = "0.30.4"; + version = "0.30.5"; src = fetchFromGitHub { owner = "ollama"; repo = "ollama"; tag = "v${finalAttrs.version}"; - hash = "sha256-IHX8o1Ty4Sdht5YeUYLnNPjOV7O95WeNng/coO+MHS8="; + hash = "sha256-jh/B/FkmAliCVzqc8DGCPYa5+XejE3cFZTzSuRxjPvw="; }; vendorHash = "sha256-lZdGzGb9xRjTm1Rm7/wHjqM490gLznLEndmb4mNbCX0="; From bba51cb2479b7a23134f69b932811df999b892e1 Mon Sep 17 00:00:00 2001 From: phibkro <71797726+phibkro@users.noreply.github.com> Date: Fri, 5 Jun 2026 01:19:37 +0200 Subject: [PATCH 2/2] ollama: fix darwin build for 0.30.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two darwin-only issues surfaced when building on x86_64-darwin: 1. The conditional postPatch removed three test files (ml/backend/ggml/ggml_test.go, ml/nn/pooling/pooling_test.go, model/models/nemotronh/model_omni_test.go) that no longer exist in v0.30.5 upstream. The `rm` failed with "No such file or directory" and aborted patchPhase. Tests in the new paths (e.g. fs/ggml/ggml_test.go) pass on darwin without removal — verified via the test phase in this commit's local build. 2. preFixup ran `patchelf --shrink-rpath` unconditionally; patchelf is ELF-only and darwin's Mach-O dylibs don't carry the build-dir RPATH problem in the first place. Gated on stdenv.hostPlatform.isLinux. Verified: nix-build -A ollama on x86_64-darwin (macOS 15.6.1, Sequoia) lands /nix/store/.../ollama-0.30.5; checkPhase green for all listed packages including x/models/gemma4; ollama --version reports 0.30.5. Assisted-by: Claude Opus 4.7 --- pkgs/by-name/ol/ollama/package.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index 3239f81dd1f9..dc4acb7722d8 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -230,12 +230,6 @@ goBuild (finalAttrs: { ( cd $TMPDIR/llama-cpp-src && \ cmake -DPATCH_DIR=$NIX_BUILD_TOP/source/llama/compat \ -P $NIX_BUILD_TOP/source/llama/compat/apply-patch.cmake ) - '' - # disable tests that fail in sandbox due to Metal init failure - + lib.optionalString stdenv.hostPlatform.isDarwin '' - rm ml/backend/ggml/ggml_test.go - rm ml/nn/pooling/pooling_test.go - rm model/models/nemotronh/model_omni_test.go ''; overrideModAttrs = _: _: { @@ -319,7 +313,9 @@ goBuild (finalAttrs: { # `.so` payloads end up with build-dir entries in RPATH. Drop them # before the forbidden-references check. $ORIGIN is preserved # unconditionally; only absolute /nix/store entries are kept. - preFixup = '' + # ELF-only (patchelf doesn't know Mach-O); darwin builds Mach-O dylibs + # that don't carry the build-dir RPATH problem in the first place. + preFixup = lib.optionalString stdenv.hostPlatform.isLinux '' find $out/lib/ollama -type f \( -name '*.so' -o -name '*.so.*' \) \ -exec patchelf --shrink-rpath --allowed-rpath-prefixes /nix/store {} + '';