本文主要是介绍TiDB - 如何在国内编译,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
0:
由于天朝的特殊,在国内很不好编译(主要是依赖库下载不了)。
所以记录下编译过程
需要的工具:
-
debian 或者其他linux其他版本。
-
make,git,golang(最好1.11版本以上)
编译过程
-
export GOPATH=/data/tidb
-
mkdir -p /data/tidb/src/github.com/pingcap
-
cd $GOPATH/src/github.com/pingcap
-
git clone https://github.com/pingcap/tidb
-
go.mod 在后面添加
replace (cloud.google.com/go => github.com/google/go-cloud v0.4.1-0.20181112030950-0b43d4400e53go.uber.org/atomic => github.com/uber-go/atomic v1.3.3-0.20181018215023-8dc6146f7569go.uber.org/multierr => github.com/uber-go/multierr v1.1.1-0.20180122172545-ddea229ff1dfgo.uber.org/zap => github.com/uber-go/zap v1.9.2-0.20180814183419-67bc79d13d15golang.org/x/crypto => github.com/golang/crypto v0.0.0-20181106171534-e4dc69e5b2fdgolang.org/x/lint => github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3golang.org/x/net => github.com/golang/net v0.0.0-20181108082009-03003ca0c849golang.org/x/oauth2 => github.com/golang/oauth2 v0.0.0-20181106182150-f42d05182288golang.org/x/sync => github.com/golang/sync v0.0.0-20181108010431-42b317875d0fgolang.org/x/sys => github.com/golang/sys v0.0.0-20181107165924-66b7b1311ac8golang.org/x/text => github.com/golang/text v0.3.1-0.20181030141323-6f44c5a2ea40golang.org/x/time => github.com/golang/time v0.0.0-20181108054448-85acf8d2951cgolang.org/x/tools => github.com/golang/tools v0.0.0-20181111003725-6d71ab8aade0google.golang.org/api => github.com/google/google-api-go-client v0.0.0-20181108001712-cfbc873f6b93google.golang.org/appengine => github.com/golang/appengine v1.3.1-0.20181031002003-4a4468ece617google.golang.org/genproto => github.com/google/go-genproto v0.0.0-20181109154231-b5d43981345bgoogle.golang.org/grpc => github.com/grpc/grpc-go v1.2.1-0.20181109233107-eb55fa50e6c9honnef.co/go/tools => github.com/dominikh/go-tools v0.0.0-20180920025451-e3ad64cb4ed3
)
6. make // 不行就把后面的版本全部改成master
这篇关于TiDB - 如何在国内编译的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!