Skip to content

Commit ee714fe

Browse files
committed
adds ENV vars to dynamically locate the compiler dependent on architecture.
1 parent 98c072c commit ee714fe

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

entrypoint.sh

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
#!/bin/sh
22
set -euo pipefail
33

4-
# determine the architecture of the host machine
4+
# Determine the architecture of the host machine
55
ARCH=$(uname -m)
66

7-
# select the binary based on the architecture
7+
# Set Rust linker for ARM64 if needed
8+
if [ "$ARCH" = "aarch64" ]; then
9+
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
10+
export RUSTFLAGS="-C link-arg=-L/usr/lib/aarch64-linux-gnu"
11+
fi
12+
13+
# Select the binary based on the architecture
814
if [ "$ARCH" = "x86_64" ]; then
9-
echo "Executing AMD64 binary"
10-
exec /app/refactor_platform_rs \
11-
-l "$BACKEND_LOG_FILTER_LEVEL" \
12-
-i "$BACKEND_INTERFACE" \
13-
-p "$BACKEND_PORT" \
14-
-d "$DATABASE_URL" \
15-
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
16-
"$@"
15+
echo "Executing AMD64 binary"
16+
exec /app/refactor_platform_rs \
17+
-l "$BACKEND_LOG_FILTER_LEVEL" \
18+
-i "$BACKEND_INTERFACE" \
19+
-p "$BACKEND_PORT" \
20+
-d "$DATABASE_URL" \
21+
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
22+
"$@"
1723
elif [ "$ARCH" = "aarch64" ]; then
18-
echo "Executing ARM64 binary"
19-
exec /app/refactor_platform_rs_arm64 \
20-
-l "$BACKEND_LOG_FILTER_LEVEL" \
21-
-i "$BACKEND_INTERFACE" \
22-
-p "$BACKEND_PORT" \
23-
-d "$DATABASE_URL" \
24-
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
25-
"$@"
24+
echo "Executing ARM64 binary"
25+
exec /app/refactor_platform_rs_arm64 \
26+
-l "$BACKEND_LOG_FILTER_LEVEL" \
27+
-i "$BACKEND_INTERFACE" \
28+
-p "$BACKEND_PORT" \
29+
-d "$DATABASE_URL" \
30+
--allowed-origins="$BACKEND_ALLOWED_ORIGINS" \
31+
"$@"
2632
else
27-
echo "Unsupported architecture: $(uname -m)" >&2
28-
exit 1
33+
echo "Unsupported architecture: $(uname -m)" >&2
34+
exit 1
2935
fi

0 commit comments

Comments
 (0)