How to Compile tidb-server Source Code into an Executable File

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb-server 源码怎么编译成可执行文件

| username: Raymond

I would like to ask the teachers for advice. Recently, I wanted to study the code of the TiDB components. I downloaded the source code and then entered the tidb-6.1.2/tidb-server directory in the source code directory. I executed go build -o tidb-server main.go, but I found that the compiled tidb-server file had issues. Its MD5 checksum was different from the one in the normal installation package, and executing ./tidb-server -V did not display the version information. How can I compile the TiDB component code into an executable file?

My own compiled version:

Official tidb-server binary file:

| username: 孤君888 | Original post link

You might need to refer to Get the code, build and run - TiDB Development Guide (pingcap.github.io)

| username: Raymond | Original post link

Is there any way to pull a specific version of TiDB?