Skip to content

Commit

Permalink
*: add fips build support (#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
mornyx authored Nov 21, 2023
1 parent 6d4edea commit 7cf9941
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ DOCKERFILE ?= ./dockerfiles/alpine316.Dockerfile
# If you want to build with no cache (after update go module, npm module, etc.), set "NO_CACHE=--pull --no-cache".
NO_CACHE ?=

BUILD_GOEXPERIMENT ?=
BUILD_CGO_ENABLED ?=
ifeq ("${ENABLE_FIPS}", "1")
RELEASE_VERSION := $(RELEASE_VERSION)-fips
BUILD_TAGS += boringcrypto
BUILD_GOEXPERIMENT = GOEXPERIMENT=boringcrypto
BUILD_CGO_ENABLED = CGO_ENABLED=1
endif

default: server

.PHONY: clean
Expand Down Expand Up @@ -125,7 +134,7 @@ server: install_tools go_generate
ifeq ($(UI),1)
scripts/embed_ui_assets.sh
endif
go build -o bin/tidb-dashboard -ldflags '$(LDFLAGS)' -tags "${BUILD_TAGS}" cmd/tidb-dashboard/main.go
$(BUILD_GOEXPERIMENT) $(BUILD_CGO_ENABLED) go build -o bin/tidb-dashboard -ldflags '$(LDFLAGS)' -tags "${BUILD_TAGS}" cmd/tidb-dashboard/main.go

.PHONY: embed_ui_assets
embed_ui_assets: ui
Expand Down
8 changes: 8 additions & 0 deletions pkg/utils/version/fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2023 PingCAP, Inc. Licensed under Apache-2.0.

//go:build boringcrypto
// +build boringcrypto

package version

import _ "crypto/tls/fipsonly"

0 comments on commit 7cf9941

Please sign in to comment.