summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-29 11:17:20 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-29 11:17:20 +0000
commite4e7c6d5778653440c3a0c8a8752cb854bfcfac8 (patch)
treea699b09a34804cee3d5858c30d0b444bccf82214
parentab2246e2f27b3d4ab71e8bae1e25babb405f8f9c (diff)
automatic import of ollamaopeneuler24.03_LTS_SP4
-rw-r--r--ollama.spec24
1 files changed, 19 insertions, 5 deletions
diff --git a/ollama.spec b/ollama.spec
index 2a34750..2ca8e47 100644
--- a/ollama.spec
+++ b/ollama.spec
@@ -4,7 +4,7 @@
Name: ollama
Version: 0.40.13
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Lightweight framework for running large language models locally
License: MIT
@@ -50,11 +50,14 @@ tar xf %{SOURCE1}
#
# 修复:1) 主模块 go.mod 降级 go 1.26.10 -> go 1.24(通过 go 1.24.2 版本检查,
# 且 -lang=go1.24 启用 range-over-int 与 range-over-func 语法支持);
-# 2) vendor/modules.txt 中所有 go >= 1.25 的逐模块声明降级为 go 1.21
-# (仅影响版本校验,不影响编译器 -lang;go 1.24.x 声明保留,
-# 1.24.2 >= 1.24.x 通过校验)。
+# 2) vendor/modules.txt 中所有 go >= 1.25 的逐模块声明降级为 go 1.24
+# (NOT go 1.21:vendor/modules.txt 中每个模块的 go 版本同时决定该模块
+# 编译器的 -lang 语言版本。降级到 go 1.21 会导致 -lang=go1.21,
+# range-over-int (go1.22+) 和 range-over-func (go1.23+) 语法编译失败。
+# 降级到 go 1.24 既通过 1.24.2 版本校验 (1.24 <= 1.24.2),又保留
+# -lang=go1.24 启用 vendored 依赖所需的 range-over-int/func 语法)。
sed -i 's/^go 1\.26\.10$/go 1.24/' go.mod
-sed -i -E 's/## explicit; go 1\.2[5-9](\.[0-9]+)?/## explicit; go 1.21/' vendor/modules.txt
+sed -i -E 's/## explicit; go 1\.2[5-9](\.[0-9]+)?/## explicit; go 1.24/' vendor/modules.txt
# 解压 llama.cpp 源码到 llama_cpp/ 子目录
# CMake ExternalProject 通过 OLLAMA_LLAMA_CPP_SOURCE 环境变量引用此目录,
@@ -100,6 +103,17 @@ DESTDIR=%{buildroot} cmake --install build
%{_libdir}/ollama/
%changelog
+* Thu Oct 29 2026 AI Importer <ai-importer@openeuler.org> - 0.40.13-5
+- Fix vendored module -lang: change vendor/modules.txt sed replacement from
+ go 1.21 to go 1.24. In Go 1.21+, each vendored module's go version in
+ vendor/modules.txt determines the compiler -lang for that module's files
+ (not just the main module's go.mod go directive). Downgrading to go 1.21
+ set -lang=go1.21 for 16 vendored modules (golang.org/x/sys, klauspost/
+ compress, go-playground/validator, quic-go, etc.), rejecting their
+ range-over-int (go1.22+) and range-over-func (go1.23+) syntax. Downgrading
+ to go 1.24 passes the 1.24.2 toolchain version check AND preserves
+ -lang=go1.24 enabling the required language features.
+
* Thu Oct 29 2026 AI Importer <ai-importer@openeuler.org> - 0.40.13-4
- Fix Go compilation: go.mod go directive downgraded to go 1.24 (not 1.21)
because ollama source and vendored deps use range-over-integer (go 1.22+)