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

After you install the RocksDB shared library, you can build TiKV directly without ROCKSDB_SYS_STATIC.

  • Get the TiKV source code.

    git clone https://github.com/pingcap/tikv.git 
    
  • Enter the source directory to build and install the binary in the bin directory.

    make
    
  • Run unit test.

    make test
    

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