Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Keep clang13 #8930

Merged
merged 5 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .toolchain.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 13 additions & 5 deletions dbms/src/Storages/KVStore/tests/gtest_kvstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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");
}

Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions release-centos7-llvm/dockerfiles/misc/bake_llvm_base_amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions release-centos7-llvm/dockerfiles/misc/bootstrap_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down