Skip to content

Commit 81a5082

Browse files
committed
fix: build native JNI lib on aarch64 CI runners
The multiArch=false path skips architectures whose name doesn't match the host arch, but ARCHITECTURES uses Maven's classifier spelling 'aarch_64' while `arch` reports 'aarch64'. On the ARM runner this mismatch caused every arch to be skipped, so no .so was built and the unit tests crashed loading the native library. Normalize the host arch to 'aarch_64' before comparing.
1 parent 2444cc9 commit 81a5082

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

aws-lambda-java-runtime-interface-client/src/main/jni/build-jni-lib.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,17 @@ else
118118
declare -a ARCHITECTURES=("x86_64" "aarch_64")
119119
declare -a LIBC_IMPLS=("glibc" "musl")
120120

121+
# `arch` reports the host as `aarch64`, but we use Maven's classifier
122+
# spelling `aarch_64` in ARCHITECTURES, so normalize before comparing.
123+
host_arch=$(arch)
124+
if [ "${host_arch}" == "aarch64" ]; then
125+
host_arch="aarch_64"
126+
fi
127+
121128
for arch in "${ARCHITECTURES[@]}"; do
122129

123-
if [[ "${MULTI_ARCH}" != "true" ]] && [[ "$(arch)" != "${arch}" ]]; then
124-
echo "multi arch build not requested and host arch is $(arch), so skipping ${arch}..."
130+
if [[ "${MULTI_ARCH}" != "true" ]] && [[ "${host_arch}" != "${arch}" ]]; then
131+
echo "multi arch build not requested and host arch is ${host_arch}, so skipping ${arch}..."
125132
continue
126133
fi
127134

0 commit comments

Comments
 (0)