Fix build

This commit is contained in:
Nikita Mikhaylov 2021-08-23 21:45:48 +00:00
parent afae867060
commit ac4a516152
2 changed files with 27 additions and 24 deletions

View File

@ -35,26 +35,6 @@ ninja $NINJA_FLAGS clickhouse-bundle
ccache --show-config ||: ccache --show-config ||:
ccache --show-stats ||: ccache --show-stats ||:
# Also build fuzzers if any
if [ -n "$FUZZER" ]
then
FUZZER_TARGETS=$(find ../src -name '*_fuzzer.cpp' -execdir basename {} .cpp ';' | tr '\n' ' ')
mkdir -p /output/fuzzers
for FUZZER_TARGET in $FUZZER_TARGETS
do
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
ninja $NINJA_FLAGS $FUZZER_TARGET
# Find this binary in build directory and strip it
FUZZER_PATH=$(find ./src -name "$FUZZER_TARGET")
strip --strip-unneeded "$FUZZER_PATH"
mv "$FUZZER_PATH" /output/fuzzers
done
tar -zcvf /output/fuzzers.tar.gz /output/fuzzers
rm -rf /output/fuzzers
fi
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 \;
@ -115,3 +95,30 @@ then
# files in place, and will fail because this directory is not writable. # files in place, and will fail because this directory is not writable.
tar -cv -I pixz -f /output/ccache.log.txz "$CCACHE_LOGFILE" tar -cv -I pixz -f /output/ccache.log.txz "$CCACHE_LOGFILE"
fi fi
# Also build fuzzers if any sanitizer specified
if [ -n "$SANITIZER" ]
then
# Delete previous cache, because we add a new flag -DENABLE_FUZZING=1
rm -rf CMakeCache.txt CMakeFiles/
# Hope, that the most part of files will be in cache, so we just link new executables
cmake --debug-trycompile --verbose=1 -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" \
"-DSANITIZE=$SANITIZER" -DENABLE_FUZZING=1 -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
FUZZER_TARGETS=$(find ../src -name '*_fuzzer.cpp' -execdir basename {} .cpp ';' | tr '\n' ' ')
mkdir -p /output/fuzzers
for FUZZER_TARGET in $FUZZER_TARGETS
do
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
ninja $NINJA_FLAGS $FUZZER_TARGET
# Find this binary in build directory and strip it
FUZZER_PATH=$(find ./src -name "$FUZZER_TARGET")
strip --strip-unneeded "$FUZZER_PATH"
mv "$FUZZER_PATH" /output/fuzzers
done
tar -zcvf /output/fuzzers.tar.gz /output/fuzzers
rm -rf /output/fuzzers
fi

View File

@ -120,10 +120,6 @@ def parse_env_variables(build_type, compiler, sanitizer, package_type, image_typ
if sanitizer: if sanitizer:
result.append("SANITIZER={}".format(sanitizer)) result.append("SANITIZER={}".format(sanitizer))
# Build fuzzers only with sanitizers
# This is needed to check necessity particularly in build script
result.append("FUZZER=TRUE")
cmake_flags.append('-DENABLE_FUZZING=1')
if build_type: if build_type:
result.append("BUILD_TYPE={}".format(build_type)) result.append("BUILD_TYPE={}".format(build_type))