Skip to content

Commit

Permalink
build: bring back the go mod and sum files (#718)
Browse files Browse the repository at this point in the history
close #661
  • Loading branch information
wuhuizuo authored Apr 13, 2023
1 parent 0bbe5f0 commit a3f5218
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 130 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
.DS_Store
*/.idea
deps.sh
/go.sum
/go.mod
.idea/
sync_diff_inspector/config/output/*
29 changes: 8 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,25 @@ define run_unit_test
@make failpoint-enable
@export log_level=error; \
$(GOTEST) -cover $(1) \
|| { @make failpoint-disable; exit 1; }
|| { make failpoint-disable; exit 1; }
@make failpoint-disable
endef

build: prepare version check importer sync_diff_inspector ddl_checker finish
build: version check importer sync_diff_inspector ddl_checker


failpoint-enable: tools
tools/bin/failpoint-ctl enable
bin/failpoint-ctl enable

failpoint-disable: tools
tools/bin/failpoint-ctl disable
bin/failpoint-ctl disable

tools:
@echo "install tools..."
@cd tools && make
@ls bin/failpoint-ctl || { echo "failpoint-ctl not found, installing..."; GOBIN=$$(pwd)/bin go install github.com/pingcap/failpoint/[email protected]; }

version:
$(GO) version

prepare:
cp go.mod1 go.mod
cp go.sum1 go.sum

importer:
$(GO) build -ldflags '$(LDFLAGS)' -o bin/importer ./importer

Expand All @@ -71,7 +66,7 @@ test: version
rm -rf /tmp/output
$(call run_unit_test,$(PACKAGES))

integration_test: prepare failpoint-enable importer sync_diff_inspector ddl_checker failpoint-disable finish
integration_test: failpoint-enable importer sync_diff_inspector ddl_checker failpoint-disable
@which bin/tidb-server
@which bin/tikv-server
@which bin/pd-server
Expand All @@ -93,15 +88,7 @@ check: fmt
#@echo "golint"
#@ golint ./... 2>&1 | grep -vE '\.pb\.go' | grep -vE 'vendor' | awk '{print} END{if(NR>0) {exit 1}}'

tidy:
cp go.mod1 go.mod
cp go.sum1 go.sum
tidy:
@$(GO) mod tidy
cp go.mod go.mod1
cp go.sum go.sum1

clean: prepare tidy finish

finish:
cp go.mod go.mod1
cp go.sum go.sum1
clean: tidy
9 changes: 2 additions & 7 deletions go.mod1 → go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/pingcap/tidb-tools

go 1.19

require (
github.com/BurntSushi/toml v1.2.1
github.com/DATA-DOG/go-sqlmock v1.5.0
Expand Down Expand Up @@ -244,10 +246,3 @@ require (
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 // indirect
sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67 // indirect
)

replace github.com/golang/lint => golang.org/x/lint v0.0.0-20190930215403-16217165b5de

// Suppress 'ambiguous imports' error caused by that old tikv/pd also provides `tikv/pd/client`
replace github.com/tikv/pd => github.com/tikv/pd v1.1.0-beta.0.20230203015356-248b3f0be132

go 1.19
File renamed without changes.
1 change: 0 additions & 1 deletion tools/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions tools/Makefile

This file was deleted.

11 changes: 0 additions & 11 deletions tools/go.mod

This file was deleted.

76 changes: 0 additions & 76 deletions tools/go.sum

This file was deleted.

8 changes: 0 additions & 8 deletions tools/go_mod_guard.go

This file was deleted.

0 comments on commit a3f5218

Please sign in to comment.