Make CI binaries slightly smaller

Disables symbol table and DWARF generation. Stack traces and other runtime
debugging features should still work, only external tools like gdb won't.
This commit is contained in:
Tulir Asokan 2021-08-15 22:53:06 +03:00
parent 9b889e7de8
commit ed5f530d54

View file

@ -12,7 +12,7 @@ stages:
- mkdir -p .cache - mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache" - export GOPATH="$CI_PROJECT_DIR/.cache"
- export GOCACHE="$CI_PROJECT_DIR/.cache/build" - export GOCACHE="$CI_PROJECT_DIR/.cache/build"
- export GO_LDFLAGS="-linkmode external -extldflags -static -X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'" - export GO_LDFLAGS="-s -w -linkmode external -extldflags -static -X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
script: script:
- go build -ldflags "$GO_LDFLAGS" -o mautrix-whatsapp - go build -ldflags "$GO_LDFLAGS" -o mautrix-whatsapp
artifacts: artifacts: