TiKV Compilation Issues

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

Original topic: tikv编译问题

| username: liul

When compiling the release-7.2 version of TiKV, the above issue occurred. Has anyone encountered this before?

| username: liul | Original post link

Currently, compiling separately under the downloaded rocksdb also results in errors. Could it be that there is an issue with rocksdb?

| username: 有猫万事足 | Original post link

When compiling, I encountered an issue with the date format. It looks like the Git version is a bit old. Check if there is a hardcoded date format in your build files and see where this date format is being referenced.

| username: liul | Original post link

Encountered another problem.

| username: 有猫万事足 | Original post link

:joy: :joy:

Setting up the compilation environment is really exhausting.
I strongly suggest you write a document about it once you’re done, and I’ll definitely support it.

| username: liul | Original post link

This seems to be an issue with the C++ standard, but I’m not sure how to handle it.
Initially, I directly modified the code for RocksDB and it compiled successfully. This one is not easy to modify.
/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/grpcio-sys-0.10.3+1.44.0-patched/grpc/third_party/abseil-cpp

| username: liul | Original post link

What is the reason for this TiKV compilation issue?

| username: liul | Original post link

There are also related issues when compiling small test cases on Rust’s wiki. This is really something I can’t figure out at the moment.

| username: 有猫万事足 | Original post link

I guess a specific version of Rust is needed to compile successfully.

[root@tikv1 bin]# ./tikv-server --version
TiKV 
Release Version:   7.1.0
Edition:           Community
Git Commit Hash:   0c34464e386940a60f2a2ce279a4ef18c9c6c45b
Git Commit Branch: heads/refs/tags/v7.1.0
UTC Build Time:    2023-05-25 01:58:10
Rust Version:      rustc 1.67.0-nightly (96ddd32c4 2022-11-14)
Enable Features:   pprof-fp jemalloc mem-profiling portable sse test-engine-kv-rocksdb test-engine-raft-raft-engine cloud-aws cloud-gcp cloud-azure
Profile:           dist_release

The version parameters of the running TiKV are like this.

The Rust version is 1.67.0

I also found a similar bug under rust-lang on GitHub. It was closed and then reopened.
The reopen date is exactly 2023.1.30, which is right after this

Rust Version: rustc 1.67.0-nightly (96ddd32c4 2022-11-14)

Consider trying again with a specific Rust version.

| username: liul | Original post link

Currently, this can be compiled using Rust 2022.

| username: liul | Original post link

However, currently, there are errors when compiling the last two modules tikv-ctl(bin) and tikv-server(bin). According to online sources, the issue is caused by cross-compilation problems.


I am still looking for the cause.

| username: liul | Original post link

I compiled the release 7.2 version.

| username: 有猫万事足 | Original post link

I think you are very close to success.

The documentation says to use rustup to manage the toolchain, and the toolchain only installed two tools: rustfmt and clippy.

If convenient, please provide a complete screenshot to see which specific third-party dependency is missing.

| username: onlyacat | Original post link

Nowadays, everything is done in containers. I suggest you take a look at the official Dockerfile and follow it.

| username: liul | Original post link

The compilation has been completed, and it is currently in the code debugging stage.

| username: redgame | Original post link

Awesome, I want to compile one too…

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.