Skip to content

Commit

Permalink
build(test): restrict gdb-15 install to amd64 architecture (#114)
Browse files Browse the repository at this point in the history
PR #71 updates gdb to a newer version that supports reading DWARF debugging
format. However, it incorrectly attempts to install the x86_64 version
regardless of the system's architecture, causing errors on non-x86_64 platforms.

This fix temporarily ensures that the updated gdb is only installed on x86_64
(amd64) systems.
  • Loading branch information
dmehala authored Sep 19, 2024
1 parent 9c9837c commit 630a7fe
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions test/services/nginx/install_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

set -e

get_architecture() {
case "$(uname -m)" in
aarch64|arm64)
echo "arm64"
;;
x86_64|amd64)
echo "amd64"
;;
*)
echo ""
;;
esac
}

install_nginx_on_amazon_linux() {
# Older versions of Amazon Linux needed "amazon-linux-extras" in order to
# install nginx. Newer versions of Amazon Linux don't have
Expand All @@ -25,10 +39,13 @@ if command -v apt-get >/dev/null 2>&1; then

if grep ^11\. /etc/debian_version; then
# the version of gdb is too old and can't handle dwarf data generated by clang 16
apt-get install -y wget
wget -O /tmp/gdb.deb https://sqreen-ci-java.s3.amazonaws.com/deb-ad-hoc/bullseye/gdb_15.1-1_amd64.deb
dpkg -i /tmp/gdb.deb
rm /tmp/gdb.deb
ARCH="$(get_architecture)"
if [ "$ARCH" = "amd64" ]; then
apt-get install -y wget
wget -O /tmp/gdb.deb https://sqreen-ci-java.s3.amazonaws.com/deb-ad-hoc/bullseye/gdb_15.1-1_amd64.deb
dpkg -i /tmp/gdb.deb
rm /tmp/gdb.deb
fi
fi
elif command -v apk >/dev/null 2>&1; then
apk update
Expand Down

0 comments on commit 630a7fe

Please sign in to comment.