From 3b124df151424e4f327280b4f7a9fd07291545ec Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Fri, 10 Nov 2023 20:07:25 +0800 Subject: [PATCH] instead of introducing server-fips target, use ENABLE_FIPS=1 --- Makefile | 8 -------- Makefile.common | 8 +++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8a9c498e5d2b3..46428dce14de2 100644 --- a/Makefile +++ b/Makefile @@ -163,14 +163,6 @@ else CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' ./cmd/tidb-server endif -server_fips: -ifeq ($(TARGET), "") - GOEXPERIMENT=boringcrypto CGO_ENABLED=1 $(GOBUILD) -tags boringcrypto $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o bin/tidb-server ./cmd/tidb-server -else - GOEXPERIMENT=boringcrypto CGO_ENABLED=1 $(GOBUILD) -tags boringcrypto $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' ./cmd/tidb-server -endif - - server_debug: ifeq ($(TARGET), "") CGO_ENABLED=1 $(GOBUILD) -gcflags="all=-N -l" $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o bin/tidb-server-debug ./cmd/tidb-server diff --git a/Makefile.common b/Makefile.common index b3139c8e4a6ad..a2ba71009105f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -27,7 +27,13 @@ path_to_add := $(addsuffix /bin,$(subst :,/bin:,$(GOPATH))):$(PWD)/tools/bin export PATH := $(path_to_add):$(PATH) GO := GO111MODULE=on go -GOBUILD := $(GO) build $(BUILD_FLAG) -tags codes +BUILD_FLAG := -tags codes +GOEXPERIMENT= +ifeq ("${ENABLE_FIPS}", "1") + BUILD_FLAG = -tags codes,boringcrypto + GOEXPERIMENT = GOEXPERIMENT=boringcrypto +endif +GOBUILD := $(GOEXPERIMENT) $(GO) build $(BUILD_FLAG) GOBUILDCOVERAGE := GOPATH=$(GOPATH) cd tidb-server; $(GO) test -coverpkg="../..." -c . GOTEST := $(GO) test -p $(P) OVERALLS := GO111MODULE=on overalls