Build For Development

Overview

If you want to develop the TiDB project, you can follow this guide.

Before you begin, check the supported platforms and prerequisites first.

Build TiKV

  • Get TiKV source code from GitHub

    git clone https://github.com/pingcap/tikv.git 
    cd tikv
    
  • Run all unit tests:

    make test
    
  • Build in release mode:

    make release
    

Build TiDB

  • Make sure the GOPATH environment is set correctly.

  • Get the TiDB source code.

    git clone https://github.com/pingcap/tidb.git $GOPATH/src/github.com/pingcap/tidb
    
  • Enter $GOPATH/src/github.com/pingcap/tidb to build and install the binary in the bin directory.

    make
    
  • Run unit test.

    make test
    

Build PD

  • Get the PD source code.

    git clone https://github.com/pingcap/pd.git $GOPATH/src/github.com/pingcap/pd
    
  • Enter $GOPATH/src/github.com/pingcap/pd to build and install the binary in the bin directory.

    make
    
  • Run unit test.

    make test