|
|
|
|
@ -1,16 +1,16 @@
|
|
|
|
|
Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
--- src/github.com/pingcap/tidb/Makefile.orig 2018-12-21 20:28:18.000000000 +0100
|
|
|
|
|
+++ src/github.com/pingcap/tidb/Makefile 2018-12-21 20:50:55.199269000 +0100
|
|
|
|
|
--- 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
|
|
|
|
|
@@ -11,7 +11,7 @@
|
|
|
|
|
path_to_add := $(addsuffix /bin,$(subst :,/bin:,$(GOPATH)))
|
|
|
|
|
export PATH := $(path_to_add):$(PATH)
|
|
|
|
|
|
|
|
|
|
-GO := GO111MODULE=on go
|
|
|
|
|
+GO := go
|
|
|
|
|
GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
|
|
|
|
|
GOBUILD := CGO_ENABLED=1 $(GO) build $(BUILD_FLAG)
|
|
|
|
|
GOTEST := CGO_ENABLED=1 $(GO) test -p 3
|
|
|
|
|
OVERALLS := CGO_ENABLED=1 overalls
|
|
|
|
|
@@ -30,8 +30,8 @@
|
|
|
|
|
OVERALLS := CGO_ENABLED=1 GO111MODULE=on overalls
|
|
|
|
|
@@ -29,8 +29,8 @@
|
|
|
|
|
|
|
|
|
|
LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty)"
|
|
|
|
|
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
|
|
|
|
|
@ -21,21 +21,20 @@ 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"
|
|
|
|
|
@@ -74,7 +74,6 @@
|
|
|
|
|
@@ -71,7 +71,6 @@
|
|
|
|
|
@gofmt -s -l -w $(FILES) 2>&1 | $(FAIL_ON_STDOUT)
|
|
|
|
|
|
|
|
|
|
goword:
|
|
|
|
|
- retool do goword $(FILES) 2>&1 | $(FAIL_ON_STDOUT)
|
|
|
|
|
goword:tools/bin/goword
|
|
|
|
|
- tools/bin/goword $(FILES) 2>&1 | $(FAIL_ON_STDOUT)
|
|
|
|
|
|
|
|
|
|
check-static:
|
|
|
|
|
@ # vet and fmt have problems with vendor when ran through metalinter
|
|
|
|
|
@@ -91,13 +90,8 @@
|
|
|
|
|
CGO_ENABLED=0 retool do gosec $$($(PACKAGE_DIRECTORIES))
|
|
|
|
|
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}}'
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
lint:tools/bin/revive
|
|
|
|
|
- @echo "linting"
|
|
|
|
|
- @$(GO) install github.com/mgechev/revive
|
|
|
|
|
- @CGO_ENABLED=0 revive -formatter friendly -config revive.toml $(FILES)
|
|
|
|
|
- @tools/bin/revive -formatter friendly -config tools/check/revive.toml $(FILES)
|
|
|
|
|
|
|
|
|
|
vet:
|
|
|
|
|
- @echo "vet"
|
|
|
|
|
@ -43,21 +42,15 @@ Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
|
|
|
|
|
tidy:
|
|
|
|
|
@echo "go mod tidy"
|
|
|
|
|
@@ -114,43 +108,12 @@
|
|
|
|
|
@cd cmd/explaintest && ./run-tests.sh -s ../../bin/tidb-server
|
|
|
|
|
@@ -123,31 +118,12 @@
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
gotest:
|
|
|
|
|
- @rm -rf $GOPATH/bin/gofail
|
|
|
|
|
- $(GO) get github.com/pingcap/gofail
|
|
|
|
|
- @which gofail
|
|
|
|
|
- @$(GOFAIL_ENABLE)
|
|
|
|
|
gotest: gofail-enable
|
|
|
|
|
-ifeq ("$(TRAVIS_COVERAGE)", "1")
|
|
|
|
|
- @echo "Running in TRAVIS_COVERAGE mode."
|
|
|
|
|
- @export log_level=error; \
|
|
|
|
|
- go get github.com/go-playground/overalls
|
|
|
|
|
- go get github.com/mattn/goveralls
|
|
|
|
|
- $(OVERALLS) -project=github.com/pingcap/tidb -covermode=count -ignore='.git,vendor,cmd,docs,LICENSES' || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- $(GOVERALLS) -service=travis-ci -coverprofile=overalls.coverprofile || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- $(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; }
|
|
|
|
|
-else
|
|
|
|
|
- @echo "Running in native mode."
|
|
|
|
|
- @export log_level=error; \
|
|
|
|
|
@ -65,23 +58,17 @@ Index: src/github.com/pingcap/tidb/Makefile
|
|
|
|
|
-endif
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
|
|
|
|
|
race:
|
|
|
|
|
- $(GO) get github.com/pingcap/gofail
|
|
|
|
|
- @$(GOFAIL_ENABLE)
|
|
|
|
|
race: gofail-enable
|
|
|
|
|
- @export log_level=debug; \
|
|
|
|
|
- $(GOTEST) -timeout 20m -race $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
|
|
|
|
|
leak:
|
|
|
|
|
- $(GO) get github.com/pingcap/gofail
|
|
|
|
|
- @$(GOFAIL_ENABLE)
|
|
|
|
|
leak: gofail-enable
|
|
|
|
|
- @export log_level=debug; \
|
|
|
|
|
- $(GOTEST) -tags leak $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
|
|
|
|
|
tikv_integration_test:
|
|
|
|
|
- $(GO) get github.com/pingcap/gofail
|
|
|
|
|
- @$(GOFAIL_ENABLE)
|
|
|
|
|
tikv_integration_test: gofail-enable
|
|
|
|
|
- $(GOTEST) ./store/tikv/. -with-tikv=true || { $(GOFAIL_DISABLE); exit 1; }
|
|
|
|
|
- @$(GOFAIL_DISABLE)
|
|
|
|
|
|
|
|
|
|
|