mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user