mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge remote-tracking branch 'origin/aku/ccache-contrib' into HEAD
This commit is contained in:
commit
5145c6303d
@ -66,7 +66,16 @@ endif ()
|
|||||||
|
|
||||||
include (cmake/find/ccache.cmake)
|
include (cmake/find/ccache.cmake)
|
||||||
|
|
||||||
option(ENABLE_CHECK_HEAVY_BUILDS "Don't allow C++ translation units to compile too long or to take too much memory while compiling" OFF)
|
# Take care to add prlimit in command line before ccache, or else ccache thinks that
|
||||||
|
# prlimit is compiler, and clang++ is its input file, and refuses to work with
|
||||||
|
# multiple inputs, e.g in ccache log:
|
||||||
|
# [2021-03-31T18:06:32.655327 36900] Command line: /usr/bin/ccache prlimit --as=10000000000 --data=5000000000 --cpu=600 /usr/bin/clang++-11 - ...... std=gnu++2a -MD -MT src/CMakeFiles/dbms.dir/Storages/MergeTree/IMergeTreeDataPart.cpp.o -MF src/CMakeFiles/dbms.dir/Storages/MergeTree/IMergeTreeDataPart.cpp.o.d -o src/CMakeFiles/dbms.dir/Storages/MergeTree/IMergeTreeDataPart.cpp.o -c ../src/Storages/MergeTree/IMergeTreeDataPart.cpp
|
||||||
|
#
|
||||||
|
# [2021-03-31T18:06:32.656704 36900] Multiple input files: /usr/bin/clang++-11 and ../src/Storages/MergeTree/IMergeTreeDataPart.cpp
|
||||||
|
#
|
||||||
|
# Another way would be to use --ccache-skip option before clang++-11 to make
|
||||||
|
# ccache ignore it.
|
||||||
|
option(ENABLE_CHECK_HEAVY_BUILDS "Don't allow C++ translation units to compile too long or to take too much memory while compiling." OFF)
|
||||||
if (ENABLE_CHECK_HEAVY_BUILDS)
|
if (ENABLE_CHECK_HEAVY_BUILDS)
|
||||||
# set DATA (since RSS does not work since 2.6.x+) to 2G
|
# set DATA (since RSS does not work since 2.6.x+) to 2G
|
||||||
set (RLIMIT_DATA 5000000000)
|
set (RLIMIT_DATA 5000000000)
|
||||||
@ -76,7 +85,7 @@ if (ENABLE_CHECK_HEAVY_BUILDS)
|
|||||||
if (SANITIZE STREQUAL "memory" OR COMPILER_GCC)
|
if (SANITIZE STREQUAL "memory" OR COMPILER_GCC)
|
||||||
set (RLIMIT_DATA 10000000000)
|
set (RLIMIT_DATA 10000000000)
|
||||||
endif()
|
endif()
|
||||||
set (CMAKE_CXX_COMPILER_LAUNCHER prlimit --as=${RLIMIT_AS} --data=${RLIMIT_DATA} --cpu=600)
|
set (CMAKE_CXX_COMPILER_LAUNCHER prlimit --as=${RLIMIT_AS} --data=${RLIMIT_DATA} --cpu=600 ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "None")
|
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "None")
|
||||||
|
@ -32,7 +32,9 @@ if (CCACHE_FOUND AND NOT COMPILER_MATCHES_CCACHE)
|
|||||||
if (CCACHE_VERSION VERSION_GREATER "3.2.0" OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if (CCACHE_VERSION VERSION_GREATER "3.2.0" OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
message(STATUS "Using ${CCACHE_FOUND} ${CCACHE_VERSION}")
|
message(STATUS "Using ${CCACHE_FOUND} ${CCACHE_VERSION}")
|
||||||
|
|
||||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND})
|
set (CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_FOUND} ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||||
|
set (CMAKE_C_COMPILER_LAUNCHER ${CCACHE_FOUND} ${CMAKE_C_COMPILER_LAUNCHER})
|
||||||
|
|
||||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND})
|
set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND})
|
||||||
|
|
||||||
# debian (debhelpers) set SOURCE_DATE_EPOCH environment variable, that is
|
# debian (debhelpers) set SOURCE_DATE_EPOCH environment variable, that is
|
||||||
|
2
debian/rules
vendored
2
debian/rules
vendored
@ -62,7 +62,7 @@ ifndef DISABLE_NINJA
|
|||||||
NINJA=$(shell which ninja)
|
NINJA=$(shell which ninja)
|
||||||
ifneq ($(NINJA),)
|
ifneq ($(NINJA),)
|
||||||
CMAKE_FLAGS += -GNinja
|
CMAKE_FLAGS += -GNinja
|
||||||
export MAKE=$(NINJA) $(NINJA_FLAGS)
|
export MAKE=$(NINJA) $(NINJA_FLAGS) --verbose
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -35,35 +35,38 @@ RUN apt-get update \
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install \
|
&& apt-get install \
|
||||||
bash \
|
bash \
|
||||||
cmake \
|
build-essential \
|
||||||
ccache \
|
ccache \
|
||||||
curl \
|
|
||||||
gcc-9 \
|
|
||||||
g++-9 \
|
|
||||||
clang-10 \
|
clang-10 \
|
||||||
clang-tidy-10 \
|
|
||||||
lld-10 \
|
|
||||||
llvm-10 \
|
|
||||||
llvm-10-dev \
|
|
||||||
clang-11 \
|
clang-11 \
|
||||||
|
clang-tidy-10 \
|
||||||
clang-tidy-11 \
|
clang-tidy-11 \
|
||||||
lld-11 \
|
cmake \
|
||||||
llvm-11 \
|
cmake \
|
||||||
llvm-11-dev \
|
curl \
|
||||||
|
g++-9 \
|
||||||
|
gcc-9 \
|
||||||
|
gdb \
|
||||||
|
git \
|
||||||
|
gperf \
|
||||||
|
gperf \
|
||||||
|
intel-opencl-icd \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
libreadline-dev \
|
libreadline-dev \
|
||||||
|
lld-10 \
|
||||||
|
lld-11 \
|
||||||
|
llvm-10 \
|
||||||
|
llvm-10-dev \
|
||||||
|
llvm-11 \
|
||||||
|
llvm-11-dev \
|
||||||
|
moreutils \
|
||||||
ninja-build \
|
ninja-build \
|
||||||
gperf \
|
|
||||||
git \
|
|
||||||
opencl-headers \
|
|
||||||
ocl-icd-libopencl1 \
|
ocl-icd-libopencl1 \
|
||||||
intel-opencl-icd \
|
opencl-headers \
|
||||||
tzdata \
|
pigz \
|
||||||
gperf \
|
pixz \
|
||||||
cmake \
|
|
||||||
gdb \
|
|
||||||
rename \
|
rename \
|
||||||
build-essential \
|
tzdata \
|
||||||
--yes --no-install-recommends
|
--yes --no-install-recommends
|
||||||
|
|
||||||
# This symlink required by gcc to find lld compiler
|
# This symlink required by gcc to find lld compiler
|
||||||
@ -111,4 +114,4 @@ RUN rm /etc/apt/sources.list.d/proposed-repositories.list && apt-get update
|
|||||||
|
|
||||||
|
|
||||||
COPY build.sh /
|
COPY build.sh /
|
||||||
CMD ["/bin/bash", "/build.sh"]
|
CMD ["bash", "-c", "/build.sh 2>&1 | ts"]
|
||||||
|
@ -11,6 +11,11 @@ tar xJf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz -C build/cmake/toolc
|
|||||||
mkdir -p build/cmake/toolchain/freebsd-x86_64
|
mkdir -p build/cmake/toolchain/freebsd-x86_64
|
||||||
tar xJf freebsd-11.3-toolchain.tar.xz -C build/cmake/toolchain/freebsd-x86_64 --strip-components=1
|
tar xJf freebsd-11.3-toolchain.tar.xz -C build/cmake/toolchain/freebsd-x86_64 --strip-components=1
|
||||||
|
|
||||||
|
# Uncomment to debug ccache. Don't put ccache log in /output right away, or it
|
||||||
|
# will be confusingly packed into the "performance" package.
|
||||||
|
export CCACHE_LOGFILE=/build/ccache.log
|
||||||
|
export CCACHE_DEBUG=1
|
||||||
|
|
||||||
mkdir -p build/build_docker
|
mkdir -p build/build_docker
|
||||||
cd build/build_docker
|
cd build/build_docker
|
||||||
ccache --show-stats ||:
|
ccache --show-stats ||:
|
||||||
@ -20,8 +25,12 @@ rm -f CMakeCache.txt
|
|||||||
# Read cmake arguments into array (possibly empty)
|
# Read cmake arguments into array (possibly empty)
|
||||||
read -ra CMAKE_FLAGS <<< "${CMAKE_FLAGS:-}"
|
read -ra CMAKE_FLAGS <<< "${CMAKE_FLAGS:-}"
|
||||||
cmake --debug-trycompile --verbose=1 -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
|
cmake --debug-trycompile --verbose=1 -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
|
||||||
|
|
||||||
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
|
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
|
||||||
ninja $NINJA_FLAGS clickhouse-bundle
|
ninja $NINJA_FLAGS --verbose clickhouse-bundle
|
||||||
|
|
||||||
|
ccache --show-stats ||:
|
||||||
|
|
||||||
mv ./programs/clickhouse* /output
|
mv ./programs/clickhouse* /output
|
||||||
mv ./src/unit_tests_dbms /output ||: # may not exist for some binary builds
|
mv ./src/unit_tests_dbms /output ||: # may not exist for some binary builds
|
||||||
find . -name '*.so' -print -exec mv '{}' /output \;
|
find . -name '*.so' -print -exec mv '{}' /output \;
|
||||||
@ -65,8 +74,21 @@ then
|
|||||||
cp ../programs/server/config.xml /output/config
|
cp ../programs/server/config.xml /output/config
|
||||||
cp ../programs/server/users.xml /output/config
|
cp ../programs/server/users.xml /output/config
|
||||||
cp -r --dereference ../programs/server/config.d /output/config
|
cp -r --dereference ../programs/server/config.d /output/config
|
||||||
tar -czvf "$COMBINED_OUTPUT.tgz" /output
|
tar -czvf -I pixz "$COMBINED_OUTPUT.tgz" /output
|
||||||
rm -r /output/*
|
rm -r /output/*
|
||||||
mv "$COMBINED_OUTPUT.tgz" /output
|
mv "$COMBINED_OUTPUT.tgz" /output
|
||||||
fi
|
fi
|
||||||
ccache --show-stats ||:
|
|
||||||
|
if [ "${CCACHE_DEBUG:-}" == "1" ]
|
||||||
|
then
|
||||||
|
find . -name '*.ccache-*' -print0
|
||||||
|
| tar -czf -I pixz /output/ccache-debug.tgz -null -T -
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$CCACHE_LOGFILE" ]
|
||||||
|
then
|
||||||
|
# Compress the log as well, or else the CI will try to compress all log
|
||||||
|
# files in place, and will fail because this directory is not writable.
|
||||||
|
tar -czvf -I pixz /output/ccache.log.tgz "$CCACHE_LOGFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user