ClickHouse/utils/check-style/check-large-objects.sh

21 lines
502 B
Bash
Raw Normal View History

2023-11-10 05:13:55 +00:00
#!/usr/bin/env bash
# Check that there are no new translation units compiled to an object file larger than a certain size.
TU_EXCLUDES=(
CastOverloadResolver
AggregateFunctionUniq
FunctionsConversion
RangeHashedDictionary
Aggregator
)
2023-11-10 05:13:55 +00:00
if find $1 -name '*.o' | xargs wc -c | grep -v total | sort -rn | awk '{ if ($1 > 50000000) print }' \
| grep -v -f <(printf "%s\n" "${TU_EXCLUDES[@]}")
2023-11-10 05:13:55 +00:00
then
echo "^ It's not allowed to have so large translation units."
exit 1
fi