Try to switch to llvm-12/clang-12

This commit is contained in:
Yatsishin Ilya 2021-02-15 09:31:35 +03:00
parent f967fa574c
commit 7e6cd00cee
8 changed files with 76 additions and 65 deletions

View File

@ -4,7 +4,7 @@ set -e
#ccache -s # uncomment to display CCache statistics
mkdir -p /server/build_docker
cd /server/build_docker
cmake -G Ninja /server "-DCMAKE_C_COMPILER=$(command -v clang-11)" "-DCMAKE_CXX_COMPILER=$(command -v clang++-11)"
cmake -G Ninja /server "-DCMAKE_C_COMPILER=$(command -v clang-12)" "-DCMAKE_CXX_COMPILER=$(command -v clang++-12)"
# Set the number of build jobs to the half of number of virtual CPU cores (rounded up).
# By default, ninja use all virtual CPU cores, that leads to very high memory consumption without much improvement in build time.

View File

@ -1,7 +1,7 @@
# docker build -t yandex/clickhouse-binary-builder .
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=12
RUN apt-get update \
&& apt-get install \
@ -57,6 +57,11 @@ RUN cat /etc/resolv.conf \
lld-11 \
llvm-11 \
llvm-11-dev \
clang-12 \
clang-tidy-12 \
lld-12 \
llvm-12 \
llvm-12-dev \
libicu-dev \
libreadline-dev \
ninja-build \

View File

@ -1,7 +1,7 @@
# docker build -t yandex/clickhouse-deb-builder .
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=12
RUN apt-get update \
&& apt-get install ca-certificates lsb-release wget gnupg apt-transport-https \
@ -36,6 +36,11 @@ RUN apt-get update \
&& apt-get install \
gcc-9 \
g++-9 \
clang-12 \
clang-tidy-12 \
lld-12 \
llvm-12 \
llvm-12-dev \
clang-11 \
clang-tidy-11 \
lld-11 \

View File

@ -184,6 +184,7 @@ if __name__ == "__main__":
parser.add_argument("--build-type", choices=("debug", ""), default="")
parser.add_argument("--compiler", choices=("clang-10", "clang-10-darwin", "clang-10-aarch64", "clang-10-freebsd",
"clang-11", "clang-11-darwin", "clang-11-aarch64", "clang-11-freebsd",
"clang-12", "clang-12-darwin", "clang-12-aarch64", "clang-12-freebsd",
"gcc-9", "gcc-10"), default="gcc-9")
parser.add_argument("--sanitizer", choices=("address", "thread", "memory", "undefined", ""), default="")
parser.add_argument("--unbundled", action="store_true")

View File

@ -22,7 +22,7 @@ ENV SHA=nosha
ENV DATA="data"
CMD mkdir -p $BUILD_DIRECTORY && cd $BUILD_DIRECTORY && \
cmake $SOURCE_DIRECTORY -DCMAKE_CXX_COMPILER=/usr/bin/clang\+\+-11 -DCMAKE_C_COMPILER=/usr/bin/clang-11 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && \
cmake $SOURCE_DIRECTORY -DCMAKE_CXX_COMPILER=/usr/bin/clang\+\+-12 -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && \
mkdir -p $HTML_RESULT_DIRECTORY && \
$CODEGEN -b $BUILD_DIRECTORY -a -o $HTML_RESULT_DIRECTORY -p ClickHouse:$SOURCE_DIRECTORY:$SHA -d $DATA && \
cp -r $STATIC_DATA $HTML_RESULT_DIRECTORY/ &&\

View File

@ -12,7 +12,7 @@ stage=${stage:-}
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "$script_dir"
repo_dir=ch
BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-11_debug_none_bundled_unsplitted_disable_False_binary"}
BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-12_debug_none_bundled_unsplitted_disable_False_binary"}
function clone
{

View File

@ -23,7 +23,7 @@ $ sudo apt-get install git cmake python ninja-build
Or cmake3 instead of cmake on older systems.
### Install clang-11 (recommended) {#install-clang-11}
### Install clang-12 (recommended) {#install-clang-12}
On Ubuntu/Debian you can use the automatic installation script (check [official webpage](https://apt.llvm.org/))
@ -33,16 +33,16 @@ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
For other Linux distribution - check the availability of the [prebuild packages](https://releases.llvm.org/download.html) or build clang [from sources](https://clang.llvm.org/get_started.html).
#### Use clang-11 for Builds {#use-gcc-10-for-builds}
#### Use clang-12 for Builds {#use-clang-12-for-builds}
``` bash
$ export CC=clang-11
$ export CXX=clang++-11
$ export CC=clang-12
$ export CXX=clang++-12
```
### Install GCC 10 {#install-gcc-10}
We recommend building ClickHouse with clang-11, GCC-10 also supported, but it is not used for production builds.
We recommend building ClickHouse with clang-12, GCC-10 also supported, but it is not used for production builds.
If you want to use GCC-10 there are several ways to install it.

View File

@ -1,7 +1,7 @@
{
"build_config": [
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "",
"package-type": "deb",
@ -12,7 +12,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "",
"package-type": "performance",
@ -32,7 +32,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "address",
"package-type": "deb",
@ -42,7 +42,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "undefined",
"package-type": "deb",
@ -52,7 +52,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "thread",
"package-type": "deb",
@ -62,7 +62,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "memory",
"package-type": "deb",
@ -82,7 +82,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "debug",
"sanitizer": "",
"package-type": "deb",
@ -102,7 +102,7 @@
"with_coverage": false
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "",
"package-type": "binary",
@ -114,7 +114,7 @@
],
"special_build_config": [
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "debug",
"sanitizer": "",
"package-type": "deb",
@ -124,7 +124,7 @@
"with_coverage": true
},
{
"compiler": "clang-11",
"compiler": "clang-12",
"build-type": "",
"sanitizer": "",
"package-type": "binary",
@ -134,7 +134,7 @@
"with_coverage": false
},
{
"compiler": "clang-11-darwin",
"compiler": "clang-12-darwin",
"build-type": "",
"sanitizer": "",
"package-type": "binary",
@ -144,7 +144,7 @@
"with_coverage": false
},
{
"compiler": "clang-11-aarch64",
"compiler": "clang-12-aarch64",
"build-type": "",
"sanitizer": "",
"package-type": "binary",
@ -154,7 +154,7 @@
"with_coverage": false
},
{
"compiler": "clang-11-freebsd",
"compiler": "clang-12-freebsd",
"build-type": "",
"sanitizer": "",
"package-type": "binary",
@ -167,7 +167,7 @@
"tests_config": {
"Functional stateful tests (address)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -179,7 +179,7 @@
},
"Functional stateful tests (thread)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -191,7 +191,7 @@
},
"Functional stateful tests (memory)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "memory",
@ -203,7 +203,7 @@
},
"Functional stateful tests (ubsan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "undefined",
@ -215,7 +215,7 @@
},
"Functional stateful tests (debug)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "debug",
"sanitizer": "none",
@ -227,7 +227,7 @@
},
"Functional stateless tests (ANTLR debug)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "debug",
"sanitizer": "none",
@ -239,7 +239,7 @@
},
"Functional stateful tests (release)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -251,7 +251,7 @@
},
"Functional stateful tests (release, DatabaseOrdinary)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -275,7 +275,7 @@
},
"Functional stateless tests (address)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -287,7 +287,7 @@
},
"Functional stateless tests (thread)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -299,7 +299,7 @@
},
"Functional stateless tests (memory)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "memory",
@ -311,7 +311,7 @@
},
"Functional stateless tests (ubsan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "undefined",
@ -323,7 +323,7 @@
},
"Functional stateless tests (debug)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "debug",
"sanitizer": "none",
@ -335,7 +335,7 @@
},
"Functional stateless tests (release)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -347,7 +347,7 @@
},
"Functional stateless tests (pytest)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -371,7 +371,7 @@
},
"Functional stateless tests (release, wide parts enabled)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -383,7 +383,7 @@
},
"Functional stateless tests (release, DatabaseOrdinary)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -407,7 +407,7 @@
},
"Stress test (address)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -419,7 +419,7 @@
},
"Stress test (thread)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -431,7 +431,7 @@
},
"Stress test (undefined)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "undefined",
@ -443,7 +443,7 @@
},
"Stress test (memory)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "memory",
@ -455,7 +455,7 @@
},
"Stress test (debug)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "debug",
"sanitizer": "none",
@ -467,7 +467,7 @@
},
"Integration tests (asan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -479,7 +479,7 @@
},
"Integration tests (thread)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -491,7 +491,7 @@
},
"Integration tests (release)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -503,7 +503,7 @@
},
"Integration tests (memory)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "memory",
@ -515,7 +515,7 @@
},
"Integration tests flaky check (asan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -527,7 +527,7 @@
},
"Compatibility check": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -539,7 +539,7 @@
},
"Split build smoke test": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -551,7 +551,7 @@
},
"Testflows check": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -575,7 +575,7 @@
},
"Unit tests release clang": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -587,7 +587,7 @@
},
"Unit tests ASAN": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -599,7 +599,7 @@
},
"Unit tests MSAN": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "memory",
@ -611,7 +611,7 @@
},
"Unit tests TSAN": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -623,7 +623,7 @@
},
"Unit tests UBSAN": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -635,7 +635,7 @@
},
"AST fuzzer (debug)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "debug",
"sanitizer": "none",
@ -647,7 +647,7 @@
},
"AST fuzzer (ASan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "address",
@ -659,7 +659,7 @@
},
"AST fuzzer (MSan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "memory",
@ -671,7 +671,7 @@
},
"AST fuzzer (TSan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "thread",
@ -683,7 +683,7 @@
},
"AST fuzzer (UBSan)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "binary",
"build_type": "relwithdebuginfo",
"sanitizer": "undefined",
@ -695,7 +695,7 @@
},
"Release": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "none",
@ -707,7 +707,7 @@
},
"Functional stateless tests flaky check (address)": {
"required_build_properties": {
"compiler": "clang-11",
"compiler": "clang-12",
"package_type": "deb",
"build_type": "relwithdebuginfo",
"sanitizer": "address",