下载tidb代码
选择VCS添加github地址
配置 GOPATH GOPROXY
从环境变量配置
# ~/.profile
export GOPATH=/data1/mycode/gopath
export GOPROXY=https://goproxy.cn
从Gland 配置
gopath
goproxy
使用go mod 下载依赖包
#在terminel执行
go mod download
编译tidb-server
/usr/bin/make -f /data1/mycode/tidb_debug/Makefile server
image.png
makefile
debug 执行tidb-server
CGO_ENABLED=1 GO111MODULE=on go build -tags codes -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v4.0.0-beta.2-2463-g82bfdcab3" -X "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS=2021-03-26 08:49:46" -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitHash=82bfdcab376e5c974700f0b6cae4f835c57a193a" -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitBranch=master" -X "github.com/pingcap/tidb/util/versioninfo.TiDBEdition=Community" ' -o bin/tidb-server tidb-server/main.go
image.png
image.png
网友评论