2019-04-25 12:29:28 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -x -e
|
|
|
|
|
2019-10-29 17:33:31 +00:00
|
|
|
mkdir -p build/cmake/toolchain/darwin-x86_64
|
2021-01-11 09:04:34 +00:00
|
|
|
tar xJf MacOSX10.15.sdk.tar.xz -C build/cmake/toolchain/darwin-x86_64 --strip-components=1
|
2019-10-29 17:33:31 +00:00
|
|
|
|
|
|
|
mkdir -p build/cmake/toolchain/linux-aarch64
|
|
|
|
tar xJf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz -C build/cmake/toolchain/linux-aarch64 --strip-components=1
|
|
|
|
|
2020-04-07 08:33:49 +00:00
|
|
|
mkdir -p build/cmake/toolchain/freebsd-x86_64
|
2020-05-07 12:32:17 +00:00
|
|
|
tar xJf freebsd-11.3-toolchain.tar.xz -C build/cmake/toolchain/freebsd-x86_64 --strip-components=1
|
2020-04-07 08:33:49 +00:00
|
|
|
|
2019-04-25 12:29:28 +00:00
|
|
|
mkdir -p build/build_docker
|
|
|
|
cd build/build_docker
|
2019-05-15 17:19:39 +00:00
|
|
|
ccache --show-stats ||:
|
|
|
|
ccache --zero-stats ||:
|
2020-05-14 09:45:22 +00:00
|
|
|
ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0 /usr/lib/libOpenCL.so ||:
|
2019-04-25 23:21:59 +00:00
|
|
|
rm -f CMakeCache.txt
|
2020-10-05 07:06:38 +00:00
|
|
|
# Read cmake arguments into array (possibly empty)
|
2020-10-04 10:23:25 +00:00
|
|
|
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[@]}" ..
|
2020-10-01 09:27:05 +00:00
|
|
|
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
|
|
|
|
ninja $NINJA_FLAGS clickhouse-bundle
|
2020-04-01 23:51:21 +00:00
|
|
|
mv ./programs/clickhouse* /output
|
2020-09-17 14:01:48 +00:00
|
|
|
mv ./src/unit_tests_dbms /output ||: # may not exist for some binary builds
|
2019-09-20 16:29:06 +00:00
|
|
|
find . -name '*.so' -print -exec mv '{}' /output \;
|
|
|
|
find . -name '*.so.*' -print -exec mv '{}' /output \;
|
2019-09-20 20:15:42 +00:00
|
|
|
|
2019-12-25 16:08:44 +00:00
|
|
|
# Different files for performance test.
|
|
|
|
if [ "performance" == "$COMBINED_OUTPUT" ]
|
|
|
|
then
|
2020-04-01 23:51:21 +00:00
|
|
|
cp -r ../tests/performance /output
|
2021-01-02 14:09:20 +00:00
|
|
|
cp -r ../tests/config/top_level_domains /output
|
2020-02-25 13:12:12 +00:00
|
|
|
cp -r ../docker/test/performance-comparison/config /output ||:
|
2019-12-25 16:08:44 +00:00
|
|
|
rm /output/unit_tests_dbms ||:
|
|
|
|
rm /output/clickhouse-odbc-bridge ||:
|
2020-03-11 14:29:34 +00:00
|
|
|
|
|
|
|
cp -r ../docker/test/performance-comparison /output/scripts ||:
|
2020-07-14 15:11:49 +00:00
|
|
|
|
|
|
|
# We have to know the revision that corresponds to this binary build.
|
|
|
|
# It is not the nominal SHA from pull/*/head, but the pull/*/merge, which is
|
|
|
|
# head merged to master by github, at some point after the PR is updated.
|
|
|
|
# There are some quirks to consider:
|
|
|
|
# - apparently the real SHA is not recorded in system.build_options;
|
|
|
|
# - it can change at any time as github pleases, so we can't just record
|
|
|
|
# the SHA and use it later, it might become inaccessible;
|
|
|
|
# - CI has an immutable snapshot of repository that it uses for all checks
|
|
|
|
# for a given nominal SHA, but it is not accessible outside Yandex.
|
|
|
|
# This is why we add this repository snapshot from CI to the performance test
|
|
|
|
# package.
|
|
|
|
mkdir /output/ch
|
|
|
|
git -C /output/ch init --bare
|
2020-07-14 21:56:35 +00:00
|
|
|
git -C /output/ch remote add origin /build
|
2020-07-23 12:50:34 +00:00
|
|
|
git -C /output/ch fetch --no-tags --depth 50 origin HEAD:pr
|
|
|
|
git -C /output/ch fetch --no-tags --depth 50 origin master:master
|
|
|
|
git -C /output/ch reset --soft pr
|
2020-07-14 15:11:49 +00:00
|
|
|
git -C /output/ch log -5
|
2019-12-25 16:08:44 +00:00
|
|
|
fi
|
|
|
|
|
2019-12-23 18:24:33 +00:00
|
|
|
# May be set for split build or for performance test.
|
|
|
|
if [ "" != "$COMBINED_OUTPUT" ]
|
2019-09-20 20:15:42 +00:00
|
|
|
then
|
2019-09-23 12:20:08 +00:00
|
|
|
mkdir -p /output/config
|
2020-04-01 23:51:21 +00:00
|
|
|
cp ../programs/server/config.xml /output/config
|
|
|
|
cp ../programs/server/users.xml /output/config
|
2020-11-04 20:45:06 +00:00
|
|
|
cp -r --dereference ../programs/server/config.d /output/config
|
2019-12-23 18:24:33 +00:00
|
|
|
tar -czvf "$COMBINED_OUTPUT.tgz" /output
|
2019-09-20 20:15:42 +00:00
|
|
|
rm -r /output/*
|
2019-12-23 18:24:33 +00:00
|
|
|
mv "$COMBINED_OUTPUT.tgz" /output
|
2019-09-20 20:15:42 +00:00
|
|
|
fi
|
2020-06-04 19:48:48 +00:00
|
|
|
ccache --show-stats ||:
|