[GH-ISSUE #2517] parser/parser.go:9:2: package log/slog is not in GOROOT (/usr/local/go120/src/log/slog) #1471

Closed
opened 2026-04-12 11:22:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @yurivict on GitHub (Feb 15, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2517

Build fails:

===>  Building for ollama-0.1.25
(cd /usr/ports/misc/ollama/work/github.com/ollama/ollama@v0.1.25;  for t in ./cmd; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/ollama/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^ollama$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/ports/misc/ollama/work  XDG_CONFIG_HOME=/usr/ports/misc/ollama/work  XDG_CACHE_HOME=/usr/ports/misc/ollama/work/.cache  HOME=/usr/ports/misc/ollama/work PATH=/usr/local/libexec/ccache:/usr/ports/misc/ollama/work/.bin:/home/yuri/.cargo/bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/misc/ollama/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOAMD64=  GOARM=  GOTMPDIR="/usr/ports/misc/ollama/work" GOPATH="/usr/ports/distfiles/go/misc_ollama"  GOBIN="/usr/ports/misc/ollama/work/bin"  GO111MODULE=on  GOFLAGS=-modcacherw  GOSUMDB=sum.golang.org GOMAXPROCS=7 GOPROXY=off /usr/local/bin/go120 build -buildmode=exe -v -trimpath -ldflags=-s -buildvcs=false -mod=vendor  -o /usr/ports/misc/ollama/work/bin/${out}  ${pkg};  done)
===>  Building cmd from ./cmd
package github.com/jmorganca/ollama/cmd
        imports github.com/jmorganca/ollama/server
        imports github.com/jmorganca/ollama/gpu: C source files not allowed when not using cgo or SWIG: gpu_info_cpu.c gpu_info_cuda.c gpu_info_rocm.c
parser/parser.go:9:2: package log/slog is not in GOROOT (/usr/local/go120/src/log/slog)
note: imported by a module that requires go 1.21
parser/parser.go:10:2: package slices is not in GOROOT (/usr/local/go120/src/slices)
note: imported by a module that requires go 1.21
*** Error code 1

Aren't all Go dependencies supposed to be fetched from Golang servers? Virtually all other Go projects require no dependencies other than the ones downloaded from Golang servers.

I build in the FreeBSD ports framework in an attempt to create the port.

Version: 0.1.25

Originally created by @yurivict on GitHub (Feb 15, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2517 Build fails: ``` ===> Building for ollama-0.1.25 (cd /usr/ports/misc/ollama/work/github.com/ollama/ollama@v0.1.25; for t in ./cmd; do out=$(/usr/bin/basename $(echo ${t} | /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/ollama/')); pkg=$(echo ${t} | /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^ollama$/./'); echo "===> Building ${out} from ${pkg}"; /usr/bin/env XDG_DATA_HOME=/usr/ports/misc/ollama/work XDG_CONFIG_HOME=/usr/ports/misc/ollama/work XDG_CACHE_HOME=/usr/ports/misc/ollama/work/.cache HOME=/usr/ports/misc/ollama/work PATH=/usr/local/libexec/ccache:/usr/ports/misc/ollama/work/.bin:/home/yuri/.cargo/bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/misc/ollama/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CPP="cpp" CPPFLAGS="" LDFLAGS=" -fstack-protector-strong " LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" CGO_ENABLED=1 CGO_CFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib" GOAMD64= GOARM= GOTMPDIR="/usr/ports/misc/ollama/work" GOPATH="/usr/ports/distfiles/go/misc_ollama" GOBIN="/usr/ports/misc/ollama/work/bin" GO111MODULE=on GOFLAGS=-modcacherw GOSUMDB=sum.golang.org GOMAXPROCS=7 GOPROXY=off /usr/local/bin/go120 build -buildmode=exe -v -trimpath -ldflags=-s -buildvcs=false -mod=vendor -o /usr/ports/misc/ollama/work/bin/${out} ${pkg}; done) ===> Building cmd from ./cmd package github.com/jmorganca/ollama/cmd imports github.com/jmorganca/ollama/server imports github.com/jmorganca/ollama/gpu: C source files not allowed when not using cgo or SWIG: gpu_info_cpu.c gpu_info_cuda.c gpu_info_rocm.c parser/parser.go:9:2: package log/slog is not in GOROOT (/usr/local/go120/src/log/slog) note: imported by a module that requires go 1.21 parser/parser.go:10:2: package slices is not in GOROOT (/usr/local/go120/src/slices) note: imported by a module that requires go 1.21 *** Error code 1 ``` Aren't all Go dependencies supposed to be fetched from Golang servers? Virtually all other Go projects require no dependencies other than the ones downloaded from Golang servers. I build in the FreeBSD ports framework in an attempt to create the port. Version: 0.1.25
Author
Owner

@mxyng commented on GitHub (Feb 15, 2024):

building from sources requires go1.21+. see development.md for more details

<!-- gh-comment-id:1947158625 --> @mxyng commented on GitHub (Feb 15, 2024): building from sources requires go1.21+. see [development.md](https://github.com/ollama/ollama/blob/main/docs/development.md) for more details
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1471