summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-29 10:24:03 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-29 10:24:03 +0000
commitd22b5471e6f096f6c0d5af2626f6201b42c8850f (patch)
tree4f4df4889f49ffc856855adfd4bba19a02fac98f
parent174e1bd24bd8d97f163df1b03ae93f27d64a038d (diff)
automatic import of ollama
-rw-r--r--ollama.spec27
1 files changed, 20 insertions, 7 deletions
diff --git a/ollama.spec b/ollama.spec
index a0a5f4f..9467ae4 100644
--- a/ollama.spec
+++ b/ollama.spec
@@ -4,7 +4,7 @@
Name: ollama
Version: 0.40.13
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Lightweight framework for running large language models locally
License: MIT
@@ -36,6 +36,19 @@ This package builds the CPU-only inference backend based on llama.cpp.
# 解压 Go vendor 依赖(离线 -mod=vendor 构建必需)
tar xf %{SOURCE1}
+# 适配 chroot golang(构建日志显示 running go 1.24.2):上游 go.mod 声明 go 1.26.10,
+# 且 vendor/modules.txt 中多个依赖(gin-contrib/cors、gin-gonic/gin 等 16 个模块)
+# 声明 go >= 1.25/1.26。GOTOOLCHAIN=local 下 go 工具链会逐模块校验
+# vendor/modules.txt 的 go 版本要求(-mod=vendor 不豁免该校验),running go
+# 1.24.2 < 1.25 → 构建 ollama-go 失败:
+# go: github.com/gin-contrib/cors in vendor/modules.txt requires go >= 1.26.0
+# (running go 1.24.2; GOTOOLCHAIN=local)
+# 修复:1) 主模块 go.mod 降级 go 1.26.10 -> go 1.21(通过 go 1.24.2 版本检查);
+# 2) vendor/modules.txt 中所有 go >= 1.25 的逐模块声明降级为 go 1.21
+# (go 1.24.x 声明保留,1.24.2 >= 1.24.x 通过校验)。
+sed -i 's/^go 1\.26\.10$/go 1.21/' go.mod
+sed -i -E 's/## explicit; go 1\.2[5-9](\.[0-9]+)?/## explicit; go 1.21/' vendor/modules.txt
+
# 解压 llama.cpp 源码到 llama_cpp/ 子目录
# CMake ExternalProject 通过 OLLAMA_LLAMA_CPP_SOURCE 环境变量引用此目录,
# 避免 COPR 离线构建时尝试 git clone github.com/ggml-org/llama.cpp
@@ -43,12 +56,6 @@ tar xf %{SOURCE1}
mkdir llama_cpp
tar xf %{SOURCE2} -C llama_cpp --strip-components=1
-# 适配 chroot golang 1.21.4:上游 go.mod 声明 go 1.26.10
-# vendor 模式(-mod=vendor)下 go build 不检查 vendor 中各依赖模块的
-# go 版本要求,仅校验主模块 go.mod 的 go 版本声明。降级主模块 go 版本
-# 声明以通过 go 1.21.4 工具链的版本检查。
-sed -i 's/^go 1\.26\.10$/go 1.21/' go.mod
-
%build
# Go 离线构建环境配置
# GOTOOLCHAIN=local:禁止 go 自动下载更高版本工具链
@@ -86,6 +93,12 @@ DESTDIR=%{buildroot} cmake --install build
%{_libdir}/ollama/
%changelog
+* Thu Oct 29 2026 AI Importer <ai-importer@openeuler.org> - 0.40.13-3
+- Fix go vendor/modules.txt per-module go version check: downgrade all
+ go >= 1.25 declarations to go 1.21 so the chroot go toolchain (1.24.2,
+ GOTOOLCHAIN=local) passes the vendor version check. -mod=vendor does
+ not exempt per-module go version requirements in vendor/modules.txt.
+
* Thu Oct 29 2026 AI Importer <ai-importer@openeuler.org> - 0.40.13-2
- Fix CMake ExternalProject install failure: use relative OLLAMA_LIB_DIR
(%{_lib}/ollama) instead of absolute path (%{_libdir}/ollama) to prevent