Skip to content

Commit

Permalink
Fix: use the -static ldflag only for the 'build-ci' target (cs3org#1718)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuAlfageme authored and thmour committed May 20, 2021
1 parent 3483785 commit d86ccfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"`
VERSION=`git describe --always`
GO_VERSION=`go version | awk '{print $$3}'`
BUILD_FLAGS="-w -extldflags "-dynamic" -X main.gitCommit=${GIT_COMMIT} -X main.version=${VERSION} -X main.goVersion=${GO_VERSION} -X main.buildDate=${BUILD_DATE}"
BUILD_FLAGS="-X main.gitCommit=${GIT_COMMIT} -X main.version=${VERSION} -X main.goVersion=${GO_VERSION} -X main.buildDate=${BUILD_DATE}"
CI_BUILD_FLAGS="-w -extldflags "-static" -X main.gitCommit=${GIT_COMMIT} -X main.version=${VERSION} -X main.goVersion=${GO_VERSION} -X main.buildDate=${BUILD_DATE}"
LITMUS_URL_OLD="http://localhost:20080/remote.php/webdav"
LITMUS_URL_NEW="http://localhost:20080/remote.php/dav/files/4c510ada-c86b-4815-8820-42cdf82c3d51"
LITMUS_USERNAME="einstein"
Expand Down Expand Up @@ -76,8 +77,8 @@ deps:
cd /tmp && go get golang.org/x/tools/cmd/goimports

build-ci: off
go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva
go build -ldflags ${CI_BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
go build -ldflags ${CI_BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva

lint-ci:
go run tools/check-license/check-license.go
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/fix-static-ldflag-build-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Use the -static ldflag only for the 'build-ci' target

It is not intended to statically link the generated binaries
for local development workflows. This resulted on segmentation
faults and compiller warnings.

https://github.com/cs3org/reva/pull/1718

0 comments on commit d86ccfa

Please sign in to comment.