Skip to content

Commit 630a7fe

Browse files
authored
build(test): restrict gdb-15 install to amd64 architecture (#114)
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.
1 parent 9c9837c commit 630a7fe

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

test/services/nginx/install_tools.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
set -e
44

5+
get_architecture() {
6+
case "$(uname -m)" in
7+
aarch64|arm64)
8+
echo "arm64"
9+
;;
10+
x86_64|amd64)
11+
echo "amd64"
12+
;;
13+
*)
14+
echo ""
15+
;;
16+
esac
17+
}
18+
519
install_nginx_on_amazon_linux() {
620
# Older versions of Amazon Linux needed "amazon-linux-extras" in order to
721
# install nginx. Newer versions of Amazon Linux don't have
@@ -25,10 +39,13 @@ if command -v apt-get >/dev/null 2>&1; then
2539

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

0 commit comments

Comments
 (0)