Disable optimizations and symbol stripping on debug builds (#6147)

Signed-off-by: Silvio Moioli <silvio@moioli.net>
Co-authored-by: Brad Davidson <brad@oatmail.org>
This commit is contained in:
Silvio Moioli
2022-10-28 18:17:49 +02:00
committed by GitHub
parent 6156059136
commit dbc7c72416
3 changed files with 17 additions and 8 deletions

View File

@@ -24,6 +24,11 @@ fi
CMD_NAME="dist/artifacts/k3s${BIN_SUFFIX}"
SIZE=$(stat -c '%s' ${CMD_NAME})
if [ -n "${DEBUG}" ]; then
echo "DEBUG is set, ignoring binary size"
exit 0
fi
if [ ${SIZE} -gt ${MAX_BINARY_SIZE} ]; then
echo "k3s binary ${CMD_NAME} size ${SIZE} exceeds max acceptable size of ${MAX_BINARY_SIZE} bytes (${MAX_BINARY_MB} MiB)"
exit 1