|
1 | 1 | #!/bin/sh
|
2 | 2 | set -euo pipefail
|
3 | 3 |
|
4 |
| -# determine the architecture of the host machine |
| 4 | +# Determine the architecture of the host machine |
5 | 5 | ARCH=$(uname -m)
|
6 | 6 |
|
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 |
8 | 14 | 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 | + "$@" |
17 | 23 | 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 | + "$@" |
26 | 32 | else
|
27 |
| - echo "Unsupported architecture: $(uname -m)" >&2 |
28 |
| - exit 1 |
| 33 | + echo "Unsupported architecture: $(uname -m)" >&2 |
| 34 | + exit 1 |
29 | 35 | fi
|
0 commit comments