Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
b5fcd9d3
Unverified
Commit
b5fcd9d3
authored
Mar 11, 2024
by
Jeffrey Morgan
Committed by
GitHub
Mar 11, 2024
Browse files
use `-trimpath` when building releases (#3069)
parent
b80661e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Dockerfile
Dockerfile
+2
-2
scripts/build_darwin.sh
scripts/build_darwin.sh
+2
-2
scripts/build_windows.ps1
scripts/build_windows.ps1
+2
-2
No files found.
Dockerfile
View file @
b5fcd9d3
...
...
@@ -92,7 +92,7 @@ COPY --from=rocm-build-amd64 /go/src/github.com/jmorganca/ollama/llm/llama.cpp/b
COPY
--from=rocm-build-amd64 /go/src/github.com/jmorganca/ollama/dist/deps/ ./dist/deps/
ARG
GOFLAGS
ARG
CGO_CFLAGS
RUN
go build .
RUN
go build
-trimpath
.
# Intermediate stage used for ./scripts/build_linux.sh
FROM
--platform=linux/arm64 cpu-build-arm64 AS build-arm64
...
...
@@ -103,7 +103,7 @@ COPY . .
COPY
--from=cuda-build-arm64 /go/src/github.com/jmorganca/ollama/llm/llama.cpp/build/linux/ llm/llama.cpp/build/linux/
ARG
GOFLAGS
ARG
CGO_CFLAGS
RUN
go build .
RUN
go build
-trimpath
.
# Runtime stages
FROM
--platform=linux/amd64 ubuntu:22.04 as runtime-amd64
...
...
scripts/build_darwin.sh
View file @
b5fcd9d3
...
...
@@ -10,8 +10,8 @@ mkdir -p dist
for
TARGETARCH
in
arm64 amd64
;
do
rm
-rf
llm/llama.cpp/build
GOOS
=
darwin
GOARCH
=
$TARGETARCH
go generate ./...
CGO_ENABLED
=
1
GOOS
=
darwin
GOARCH
=
$TARGETARCH
go build
-o
dist/ollama-darwin-
$TARGETARCH
CGO_ENABLED
=
1
GOOS
=
darwin
GOARCH
=
$TARGETARCH
go build
-cover
-o
dist/ollama-darwin-
$TARGETARCH
-cov
CGO_ENABLED
=
1
GOOS
=
darwin
GOARCH
=
$TARGETARCH
go build
-trimpath
-o
dist/ollama-darwin-
$TARGETARCH
CGO_ENABLED
=
1
GOOS
=
darwin
GOARCH
=
$TARGETARCH
go build
-trimpath
-cover
-o
dist/ollama-darwin-
$TARGETARCH
-cov
done
lipo
-create
-output
dist/ollama dist/ollama-darwin-arm64 dist/ollama-darwin-amd64
...
...
scripts/build_windows.ps1
View file @
b5fcd9d3
...
...
@@ -53,7 +53,7 @@ function buildOllama() {
write-host
"Building ollama CLI"
&
go
generate
.
/...
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
&
go
build
-ldflags
"-s -w -X=github.com/jmorganca/ollama/version.Version=
$
script
:
VERSION
-X=github.com/jmorganca/ollama/server.mode=release"
.
&
go
build
-trimpath
-ldflags
"-s -w -X=github.com/jmorganca/ollama/version.Version=
$
script
:
VERSION
-X=github.com/jmorganca/ollama/server.mode=release"
.
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
"
${env:KEY_CONTAINER}
"
)
{
&
"
${script:SignTool}
"
sign
/v
/fd
sha256
/t
http://timestamp.digicert.com
/f
"
${script:OLLAMA_CERT}
"
`
...
...
@@ -68,7 +68,7 @@ function buildApp() {
write-host
"Building Ollama App"
cd
"
${script:SRC_DIR}
\app"
&
windres
-l
0
-o
ollama.syso
ollama.rc
&
go
build
-ldflags
"-s -w -H windowsgui -X=github.com/jmorganca/ollama/version.Version=
$
script
:
VERSION
-X=github.com/jmorganca/ollama/server.mode=release"
.
&
go
build
-trimpath
-ldflags
"-s -w -H windowsgui -X=github.com/jmorganca/ollama/version.Version=
$
script
:
VERSION
-X=github.com/jmorganca/ollama/server.mode=release"
.
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
"
${env:KEY_CONTAINER}
"
)
{
&
"
${script:SignTool}
"
sign
/v
/fd
sha256
/t
http://timestamp.digicert.com
/f
"
${script:OLLAMA_CERT}
"
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment