|
|
|
@ -1,18 +1,18 @@
|
|
|
|
|
Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
--- src/github.com/pingcap/tidb/Makefile.orig 2019-01-19 10:25:21.000000000 +0100
|
|
|
|
|
+++ src/github.com/pingcap/tidb/Makefile 2019-01-19 10:34:32.014985000 +0100
|
|
|
|
|
--- src/github.com/pingcap/tidb/Makefile.orig 2019-11-24 17:00:06.000000000 +0100
|
|
|
|
|
+++ src/github.com/pingcap/tidb/Makefile 2019-11-24 17:07:31.987438000 +0100
|
|
|
|
|
@@ -11,7 +11,7 @@
|
|
|
|
|
path_to_add := $(addsuffix /bin,$(subst :,/bin:,$(GOPATH)))
|
|
|
|
|
path_to_add := $(addsuffix /bin,$(subst :,/bin:,$(GOPATH))):$(PWD)/tools/bin
|
|
|
|
|
export PATH := $(path_to_add):$(PATH)
|
|
|
|
|
|
|
|
|
|
-GO := GO111MODULE=on go
|
|
|
|
|
+GO := go
|
|
|
|
|
GOBUILD := CGO_ENABLED=1 $(GO) build $(BUILD_FLAG)
|
|
|
|
|
GOTEST := CGO_ENABLED=1 $(GO) test -p 3
|
|
|
|
|
OVERALLS := CGO_ENABLED=1 GO111MODULE=on overalls
|
|
|
|
|
@@ -29,8 +29,8 @@
|
|
|
|
|
-GO := GO111MODULE=on go
|
|
|
|
|
+GO := go
|
|
|
|
|
GOBUILD := $(GO) build $(BUILD_FLAG) -tags codes
|
|
|
|
|
GOBUILDCOVERAGE := GOPATH=$(GOPATH) cd tidb-server; $(GO) test -coverpkg="../..." -c .
|
|
|
|
|
GOTEST := $(GO) test -p 8
|
|
|
|
|
@@ -30,8 +30,8 @@
|
|
|
|
|
|
|
|
|
|
LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty)"
|
|
|
|
|
LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty --always)"
|
|
|
|
|
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
|
|
|
|
|
-LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=$(shell git rev-parse HEAD)"
|
|
|
|
|
-LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
|
|
|
|
@ -21,7 +21,7 @@ Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.GoVersion=$(shell go version)"
|
|
|
|
|
|
|
|
|
|
TEST_LDFLAGS = -X "github.com/pingcap/tidb/config.checkBeforeDropLDFlag=1"
|
|
|
|
|
@@ -71,7 +71,6 @@
|
|
|
|
|
@@ -78,7 +78,6 @@
|
|
|
|
|
@gofmt -s -l -w $(FILES) 2>&1 | $(FAIL_ON_STDOUT)
|
|
|
|
|
|
|
|
|
|
goword:tools/bin/goword
|
|
|
|
@ -29,8 +29,8 @@ Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
|
|
|
|
|
gosec:tools/bin/gosec
|
|
|
|
|
tools/bin/gosec $$($(PACKAGE_DIRECTORIES))
|
|
|
|
|
@@ -94,12 +93,8 @@
|
|
|
|
|
@GO111MODULE=on tools/bin/errcheck -exclude ./tools/check/errcheck_excludes.txt -blank $(PACKAGES) | grep -v "_test\.go" | awk '{print} END{if(NR>0) {exit 1}}'
|
|
|
|
|
@@ -106,12 +105,8 @@
|
|
|
|
|
./tools/check/check-gogenerate.sh
|
|
|
|
|
|
|
|
|
|
lint:tools/bin/revive
|
|
|
|
|
- @echo "linting"
|
|
|
|
@ -38,39 +38,44 @@ Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
|
|
|
|
|
vet:
|
|
|
|
|
- @echo "vet"
|
|
|
|
|
- $(GO) vet -all -shadow $(PACKAGES) 2>&1 | $(FAIL_ON_STDOUT)
|
|
|
|
|
- $(GO) vet -all $(PACKAGES) 2>&1 | $(FAIL_ON_STDOUT)
|
|
|
|
|
|
|
|
|
|
tidy:
|
|
|
|
|
@echo "go mod tidy"
|
|
|
|
|
@@ -123,31 +118,12 @@
|
|
|
|
|
@@ -142,36 +137,12 @@
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
gotest: gofail-enable
|
|
|
|
|
gotest: failpoint-enable
|
|
|
|
|
-ifeq ("$(TRAVIS_COVERAGE)", "1")
|
|
|
|
|
- @echo "Running in TRAVIS_COVERAGE mode."
|
|
|
|
|
- @export log_level=error; \
|
|
|
|
|
- $(GO) get github.com/go-playground/overalls
|
|
|
|
|
- $(OVERALLS) -project=github.com/pingcap/tidb -covermode=count -ignore='.git,vendor,cmd,docs,LICENSES' -concurrency=1 || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @export log_level=error; \
|
|
|
|
|
- $(OVERALLS) -project=github.com/pingcap/tidb \
|
|
|
|
|
- -covermode=count \
|
|
|
|
|
- -ignore='.git,vendor,cmd,docs,LICENSES' \
|
|
|
|
|
- -concurrency=4 \
|
|
|
|
|
- -- -coverpkg=./... \
|
|
|
|
|
- || { $(FAILPOINT_DISABLE); exit 1; }
|
|
|
|
|
-else
|
|
|
|
|
- @echo "Running in native mode."
|
|
|
|
|
- @export log_level=error; \
|
|
|
|
|
- $(GOTEST) -ldflags '$(TEST_LDFLAGS)' -cover $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @export log_level=error; export TZ='Asia/Shanghai'; \
|
|
|
|
|
- $(GOTEST) -ldflags '$(TEST_LDFLAGS)' -cover $(PACKAGES) -check.timeout 4s || { $(FAILPOINT_DISABLE); exit 1; }
|
|
|
|
|
-endif
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
- @$(FAILPOINT_DISABLE)
|
|
|
|
|
|
|
|
|
|
race: gofail-enable
|
|
|
|
|
race: failpoint-enable
|
|
|
|
|
- @export log_level=debug; \
|
|
|
|
|
- $(GOTEST) -timeout 20m -race $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
- $(GOTEST) -timeout 20m -race $(PACKAGES) || { $(FAILPOINT_DISABLE); exit 1; }
|
|
|
|
|
- @$(FAILPOINT_DISABLE)
|
|
|
|
|
|
|
|
|
|
leak: gofail-enable
|
|
|
|
|
leak: failpoint-enable
|
|
|
|
|
- @export log_level=debug; \
|
|
|
|
|
- $(GOTEST) -tags leak $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
- $(GOTEST) -tags leak $(PACKAGES) || { $(FAILPOINT_DISABLE); exit 1; }
|
|
|
|
|
- @$(FAILPOINT_DISABLE)
|
|
|
|
|
|
|
|
|
|
tikv_integration_test: gofail-enable
|
|
|
|
|
- $(GOTEST) ./store/tikv/. -with-tikv=true || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
tikv_integration_test: failpoint-enable
|
|
|
|
|
- $(GOTEST) ./store/tikv/. -with-tikv=true || { $(FAILPOINT_DISABLE); exit 1; }
|
|
|
|
|
- @$(FAILPOINT_DISABLE)
|
|
|
|
|
|
|
|
|
|
RACE_FLAG =
|
|
|
|
|
ifeq ("$(WITH_RACE)", "1")
|
|
|
|
|