use proper flags to ensure an actual static binary when building a static release
This commit is contained in:
parent
c4652d60a7
commit
17ad908748
8 changed files with 8 additions and 8 deletions
2
Makefile
2
Makefile
|
@ -59,7 +59,7 @@ LD_OPTS_VARS= \
|
|||
-X 'github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultDataDir=$(DEFAULT_DATADIR)'
|
||||
|
||||
export LD_OPTS=-ldflags "-s -w $(LD_OPTS_VARS)"
|
||||
export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'"
|
||||
export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'" -tags netgo,osusergo,sqlite_omit_load_extension
|
||||
|
||||
GOCMD=go
|
||||
GOTEST=$(GOCMD) test
|
||||
|
|
|
@ -27,7 +27,7 @@ build-bincover: clean
|
|||
$(GOTEST) . -tags testrunmain -coverpkg=$(go list github.com/crowdsecurity/crowdsec/... | grep -v -e 'pkg/database' -e 'plugins/notifications' -e 'pkg/protobufs' -e 'pkg/cwversions' -e 'pkg/cstest' -e 'pkg/models') -covermode=atomic $(LD_OPTS) -c -o $(BINARY_NAME_COVER)
|
||||
|
||||
static: clean
|
||||
@$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a -tags netgo
|
||||
@$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a
|
||||
|
||||
.PHONY: install
|
||||
install: install-conf install-bin
|
||||
|
|
|
@ -32,7 +32,7 @@ build-bincover: clean
|
|||
$(GOTEST) . -tags testrunmain -coverpkg=$(go list github.com/crowdsecurity/crowdsec/... | grep -v -e 'pkg/database' -e 'plugins/notifications' -e 'pkg/protobufs' -e 'pkg/cwversions' -e 'pkg/cstest' -e 'pkg/models') -covermode=atomic $(LD_OPTS) -c -o $(CROWDSEC_BIN_COVER)
|
||||
|
||||
static: clean
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(CROWDSEC_BIN) -a -tags netgo
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(CROWDSEC_BIN) -a
|
||||
|
||||
test:
|
||||
$(GOTEST) $(LD_OPTS) -v ./...
|
||||
|
|
|
@ -20,4 +20,4 @@ build: clean
|
|||
@$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME)
|
||||
|
||||
static: clean
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a -tags netgo
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a
|
||||
|
|
|
@ -20,4 +20,4 @@ build: clean
|
|||
@$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME)
|
||||
|
||||
static: clean
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a -tags netgo
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a
|
||||
|
|
|
@ -20,4 +20,4 @@ build: clean
|
|||
$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME)
|
||||
|
||||
static: clean
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a -tags netgo
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a
|
||||
|
|
|
@ -20,4 +20,4 @@ clean:
|
|||
|
||||
|
||||
static: clean
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a -tags netgo
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a
|
||||
|
|
|
@ -21,4 +21,4 @@ clean:
|
|||
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
||||
|
||||
static: clean
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a -tags netgo
|
||||
$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -a
|
||||
|
|
Loading…
Reference in a new issue