Skip to content

Commit

Permalink
Makefile,cmd/tidb-server: add tidb-server FIPS build target (#47949)
Browse files Browse the repository at this point in the history
close #47948
  • Loading branch information
tiancaiamao authored Nov 15, 2023
1 parent 159d8eb commit 1bb8b6f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions cmd/tidb-server/fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build boringcrypto
// +build boringcrypto

package main

import _ "crypto/tls/fipsonly"

import "github.com/pingcap/tidb/pkg/parser/mysql"

func init() {
mysql.TiDBReleaseVersion += "-fips"
}

0 comments on commit 1bb8b6f

Please sign in to comment.