TiKV 编译失败

【 TiDB 使用环境】 测试
【 TiDB 版本】tikv: origin/release-8.2
【复现路径】

  1. git clone xx
  2. git checkout -b release-8.2 origin/release-8.2
  3. cargo check --workspace

error: failed to run custom build command for librocksdb_sys v0.1.0 (https://github.com/tikv/rust-rocksdb.git#224bed6f)

/home/andy/.cargo/git/checkouts/rust-rocksdb-a9a28e74c6ead8ef/224bed6/librocksdb_sys/rocksdb/encryption/encryption.cc:90:39: error: use of undeclared identifier ‘block_index’; did you mean ‘block_size’?
90 | uint64_t iv_low = initial_iv_low_ + block_index;
| ^~~~~~~~~~~
| block_size
/home/andy/.cargo/git/checkouts/rust-rocksdb-a9a28e74c6ead8ef/224bed6/librocksdb_sys/rocksdb/encryption/encryption.cc:81:16: note: ‘block_size’ declared here
81 | const size_t block_size = BlockSize();
| ^
/home/andy/.cargo/git/checkouts/rust-rocksdb-a9a28e74c6ead8ef/224bed6/librocksdb_sys/rocksdb/encryption/encryption.cc:91:46: error: use of undeclared identifier ‘block_index’; did you mean ‘block_size’?
91 | if (std::numeric_limits<uint64_t>::max() - block_index < initial_iv_low_) {
| ^~~~~~~~~~~
| block_size
/home/andy/.cargo/git/checkouts/rust-rocksdb-a9a28e74c6ead8ef/224bed6/librocksdb_sys/rocksdb/encryption/encryption.cc:81:16: note: ‘block_size’ declared here
81 | const size_t block_size = BlockSize();

还有一些其他的错误, 比如 no matching function for call to ‘bit_cast’ 294 | return bit_cast<int64_t>(ToHost64(bit_cast<uint64_t>(x))); |

我的编译环境:

clang --version
clang version 18.1.6 (Gitee 极速下载/llvm-project 1118c2e05e67a36ed8ca250524525cdb66a55256)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

clang++ --version
clang version 18.1.6 (Gitee 极速下载/llvm-project 1118c2e05e67a36ed8ca250524525cdb66a55256)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin