This commit is contained in:
Nikita Mikhaylov 2021-08-23 14:36:26 +00:00
parent 1c956481a1
commit 77430a1baa
2 changed files with 32 additions and 24 deletions

View File

@ -35,22 +35,24 @@ ninja $NINJA_FLAGS clickhouse-bundle
ccache --show-config ||:
ccache --show-stats ||:
# Also build fuzzers if any
FUZZER_TARGETS=$(find ../src -name '*_fuzzer.cpp' -execdir basename {} .cpp ';' | tr '\n' ' ')
# Also build fuzzers if any
if [[ "${CMAKE_FLAGS[@]}" == "*ENABLE_FUZZING*" ]]; 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
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
tar -zcvf /output/fuzzers.tar.gz /output/fuzzers
rm -rf /output/fuzzers
fi
mv ./programs/clickhouse* /output
mv ./src/unit_tests_dbms /output ||: # may not exist for some binary builds

View File

@ -24,18 +24,24 @@ then
mkdir /output/binary ||: # if exists
mv /build/obj-*/programs/clickhouse* /output/binary
# Copy all fuzzers
# Copy all fuzzers if any
FUZZER_TARGETS=$(find /build/obj-*/src -name '*_fuzzer' -execdir basename {} ';' | tr '\n' ' ')
mkdir -p /output/fuzzers ||: # if exists
for FUZZER_TARGET in $FUZZER_TARGETS
do
FUZZER_PATH=$(find /build/obj-*/src -name "$FUZZER_TARGET")
strip --strip-unneeded "$FUZZER_PATH"
mv "$FUZZER_PATH" /output/fuzzers ||: # if exists
done
tar -zcvf /output/fuzzers.tar.gz /output/fuzzers
rm -rf /output/fuzzers
if [[ $FUZZER_TARGETS != "" ]]; then
mkdir -p /output/fuzzers ||: # if exists
for FUZZER_TARGET in $FUZZER_TARGETS
do
FUZZER_PATH=$(find /build/obj-*/src -name "$FUZZER_TARGET")
strip --strip-unneeded "$FUZZER_PATH"
mv "$FUZZER_PATH" /output/fuzzers ||: # if exists
done
tar -zcvf /output/fuzzers.tar.gz /output/fuzzers
rm -rf /output/fuzzers
fi
if [ "$BINARY_OUTPUT" = "tests" ]
then