tools: the Discord check must not pipe into grep -q

It fired on its very first run against an APK that DID contain the library. `unzip -l | grep -q`
under `set -o pipefail` is a false-failure generator: grep exits on the first match, SIGPIPEs
unzip, and pipefail then reports the pipeline as failed. Capture the listing and match it with
`case` instead, which is what the existing notes on this already say to do.
This commit is contained in:
jpolo1224
2026-08-23 10:49:41 -04:00
parent fb80386cc8
commit e8d3530f51
2 changed files with 16 additions and 6 deletions
+8 -3
View File
@@ -82,9 +82,14 @@ echo "-- Discord Social SDK --"
# on include/discordpp.h, so an unset variable silently produces a build with no Discord. 2.6.6.8
# shipped that way and it was caught only after publishing.
if [[ -n "${DISCORD_SDK_DIR:-}" ]]; then
unzip -l "$OUTPUT_AAB" | grep -q "libdiscord_partner_sdk.so" \
|| { echo "FATAL DISCORD_SDK_DIR is set but libdiscord_partner_sdk.so is not in the bundle" >&2; exit 1; }
echo " present"
# Capture then match. Piping into `grep -q` under `set -o pipefail` is a false-failure
# generator: grep exits on the first match, SIGPIPEs unzip, and pipefail reports the whole
# pipeline as failed even though the library WAS found. That fired here on the first run.
discord_listing=$(unzip -l "$OUTPUT_AAB")
case "$discord_listing" in
*libdiscord_partner_sdk.so*) echo " present" ;;
*) echo "FATAL DISCORD_SDK_DIR is set but libdiscord_partner_sdk.so is not in the bundle" >&2; exit 1 ;;
esac
else
echo " WARNING: DISCORD_SDK_DIR unset -- this bundle has NO Discord integration." >&2
echo " Set it to the staged dir (include/ + arm64-v8a/ + .aar) before a release." >&2
+8 -3
View File
@@ -136,9 +136,14 @@ echo "-- Discord Social SDK --"
# no error, no warning, nothing in the log. A whole release shipped that way (2.6.6.8) and it
# was only noticed after publication. Make it impossible to do silently again.
if [[ -n "${DISCORD_SDK_DIR:-}" ]]; then
unzip -l "$OUTPUT_APK" | grep -q "libdiscord_partner_sdk.so" \
|| { echo "FATAL DISCORD_SDK_DIR is set but libdiscord_partner_sdk.so is not in the APK" >&2; exit 1; }
echo " present"
# Capture then match. Piping into `grep -q` under `set -o pipefail` is a false-failure
# generator: grep exits on the first match, SIGPIPEs unzip, and pipefail reports the whole
# pipeline as failed even though the library WAS found. That fired here on the first run.
discord_listing=$(unzip -l "$OUTPUT_APK")
case "$discord_listing" in
*libdiscord_partner_sdk.so*) echo " present" ;;
*) echo "FATAL DISCORD_SDK_DIR is set but libdiscord_partner_sdk.so is not in the APK" >&2; exit 1 ;;
esac
else
echo " WARNING: DISCORD_SDK_DIR unset -- this build has NO Discord integration." >&2
echo " Set it to the staged dir (include/ + arm64-v8a/ + .aar) before a release." >&2