From 94f15d141fc0b288d18d06b4193771638e174343 Mon Sep 17 00:00:00 2001 From: JaySon Date: Thu, 11 Apr 2024 15:22:52 +0800 Subject: [PATCH] *: Keep clang13 (#8930) ref pingcap/tiflash#7193 --- .toolchain.yml | 18 ------------------ README.md | 10 +++++----- .../Storages/KVStore/tests/gtest_kvstore.cpp | 18 +++++++++++++----- .../dockerfiles/misc/bake_llvm_base_aarch64.sh | 6 +++--- .../dockerfiles/misc/bake_llvm_base_amd64.sh | 6 +++--- .../dockerfiles/misc/bootstrap_llvm.sh | 6 ++---- 6 files changed, 26 insertions(+), 38 deletions(-) delete mode 100644 .toolchain.yml diff --git a/.toolchain.yml b/.toolchain.yml deleted file mode 100644 index 762bde74122..00000000000 --- a/.toolchain.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2022 PingCAP, Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Hi, there! -# This is passed via jenkins podTemplate argument. -# Instead of trying injections, take a look at https://en.pingcap.com/careers/. -image_tag_suffix: -llvm-17.0.6 diff --git a/README.md b/README.md index dda2fbc84e3..a6c14035d23 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ And the following operating systems: The following packages are required: - CMake 3.21.0+ -- Clang 17.0.0+ under Linux or AppleClang 15.0.0+ under MacOS +- Clang 13.0.6+ - Rust - Python 3.0+ - Ninja-Build or GNU Make @@ -56,10 +56,10 @@ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none source $HOME/.cargo/env # Install LLVM, see https://apt.llvm.org for details -# Clang will be available as /usr/bin/clang++-17 +# Clang will be available as /usr/bin/clang++-13 wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh -sudo ./llvm.sh 17 all +sudo ./llvm.sh 13 all # Install other dependencies sudo apt install -y cmake ninja-build zlib1g-dev libcurl4-openssl-dev ccache @@ -162,8 +162,8 @@ Note: In Linux, usually you need to explicitly specify to use LLVM. ```shell # In cmake-build-debug directory: cmake .. -GNinja -DCMAKE_BUILD_TYPE=DEBUG \ - -DCMAKE_C_COMPILER=/usr/bin/clang-17 \ - -DCMAKE_CXX_COMPILER=/usr/bin/clang++-17 + -DCMAKE_C_COMPILER=/usr/bin/clang-13 \ + -DCMAKE_CXX_COMPILER=/usr/bin/clang++-13 ``` In MacOS, if you install llvm clang, you need to explicitly specify to use llvm clang. diff --git a/dbms/src/Storages/KVStore/tests/gtest_kvstore.cpp b/dbms/src/Storages/KVStore/tests/gtest_kvstore.cpp index c39589485b6..6ac875198b4 100644 --- a/dbms/src/Storages/KVStore/tests/gtest_kvstore.cpp +++ b/dbms/src/Storages/KVStore/tests/gtest_kvstore.cpp @@ -1542,7 +1542,9 @@ TEST_F(RegionKVStoreOldTest, RegionRange) catch (Exception & e) { const auto & res = e.message(); - ASSERT_EQ(res, "void DB::RegionsRangeIndex::remove(const RegionRange &, RegionID): not found region_id=1"); + ASSERT_EQ( + res, + "void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found region_id=1"); } region_index.add(makeRegion(2, RecordKVFormat::genKey(1, 3), RecordKVFormat::genKey(1, 5))); @@ -1556,7 +1558,9 @@ TEST_F(RegionKVStoreOldTest, RegionRange) catch (Exception & e) { const auto & res = e.message(); - ASSERT_EQ(res, "void DB::RegionsRangeIndex::remove(const RegionRange &, RegionID): not found start key"); + ASSERT_EQ( + res, + "void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found start key"); } try @@ -1569,7 +1573,9 @@ TEST_F(RegionKVStoreOldTest, RegionRange) catch (Exception & e) { const auto & res = e.message(); - ASSERT_EQ(res, "void DB::RegionsRangeIndex::remove(const RegionRange &, RegionID): not found end key"); + ASSERT_EQ( + res, + "void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found end key"); } try @@ -1584,7 +1590,7 @@ TEST_F(RegionKVStoreOldTest, RegionRange) const auto & res = e.message(); ASSERT_EQ( res, - "void DB::RegionsRangeIndex::remove(const RegionRange &, RegionID): range of region_id=2 is " + "void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): range of region_id=2 is " "empty"); } @@ -1596,7 +1602,9 @@ TEST_F(RegionKVStoreOldTest, RegionRange) catch (Exception & e) { const auto & res = e.message(); - ASSERT_EQ(res, "void DB::RegionsRangeIndex::remove(const RegionRange &, RegionID): not found region_id=2"); + ASSERT_EQ( + res, + "void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found region_id=2"); } region_index.clear(); diff --git a/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_aarch64.sh b/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_aarch64.sh index 106b1f8384e..374136afb1c 100644 --- a/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_aarch64.sh +++ b/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_aarch64.sh @@ -30,18 +30,18 @@ function bake_llvm_base_aarch64() { # CMake source $SCRIPTPATH/install_cmake.sh - install_cmake "3.24.2" "aarch64" + install_cmake "3.22.1" "aarch64" # LLVM source $SCRIPTPATH/bootstrap_llvm.sh - bootstrap_llvm "17.0.6" + bootstrap_llvm "13.0.0" export CC=clang export CXX=clang++ export LD=ld.lld # OpenSSL source $SCRIPTPATH/install_openssl.sh - install_openssl "1_1_1w" + install_openssl "1_1_1t" export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" # Git diff --git a/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_amd64.sh b/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_amd64.sh index 1afda38ce7f..050c34b6287 100644 --- a/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_amd64.sh +++ b/release-centos7-llvm/dockerfiles/misc/bake_llvm_base_amd64.sh @@ -29,18 +29,18 @@ function bake_llvm_base_amd64() { # CMake source $SCRIPTPATH/install_cmake.sh - install_cmake "3.24.2" "x86_64" + install_cmake "3.22.1" "x86_64" # LLVM source $SCRIPTPATH/bootstrap_llvm.sh - bootstrap_llvm "17.0.6" + bootstrap_llvm "13.0.0" export CC=clang export CXX=clang++ export LD=ld.lld # OpenSSL source $SCRIPTPATH/install_openssl.sh - install_openssl "1_1_1w" + install_openssl "1_1_1t" export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" # Git diff --git a/release-centos7-llvm/dockerfiles/misc/bootstrap_llvm.sh b/release-centos7-llvm/dockerfiles/misc/bootstrap_llvm.sh index d6d38afdbaa..7b9304fbba7 100644 --- a/release-centos7-llvm/dockerfiles/misc/bootstrap_llvm.sh +++ b/release-centos7-llvm/dockerfiles/misc/bootstrap_llvm.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"} + # Boostrap LLVM envriroment for CI/CD. # Require: git, ninja, cmake, compiler(devtoolset-10) @@ -29,7 +29,6 @@ function bootstrap_llvm() { cmake -DCMAKE_BUILD_TYPE=Release \ -GNinja \ - -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ -DLLVM_TARGETS_TO_BUILD=Native \ @@ -45,8 +44,7 @@ function bootstrap_llvm() { cmake -DCMAKE_BUILD_TYPE=Release \ -GNinja \ - -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ - -DLLVM_ENABLE_PROJECTS="clang;lld;polly;clang-tools-extra;bolt" \ + -DLLVM_ENABLE_PROJECTS="clang;lld;polly;clang-tools-extra" \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;openmp;compiler-rt" \ -DLLVM_TARGETS_TO_BUILD=Native \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \