fix: auto-detect architecture in main.py if TARGET_ARCH environment variable is missing
CI / build-and-test (push) Has been cancelled

This commit is contained in:
joshpatra committed 2026-07-08 10:32:04 -04:00
1 parent 0d0349728d
commit 228af068c3
1 file changed
+7 -2
+7 -2
View File
@@ -42,10 +42,15 @@ SYSTEM_LIBS_DIR = ROOTFS_DIR / "system" / "lib64"
DATA_DIR = PROJECT_ROOT / "data"
DATA_DIR.mkdir(exist_ok=True)
import platform
# Environment settings
HTTP_PORT = int(os.getenv("HTTP_PORT", "8080"))
TARGET_ARCH = os.getenv("TARGET_ARCH", "arm64-v8a")
if TARGET_ARCH == "amd64" or TARGET_ARCH == "x86_64":
arch_env = os.getenv("TARGET_ARCH")
if not arch_env:
arch_env = platform.machine().lower()
if "x86_64" in arch_env or "amd64" in arch_env:
TARGET_ARCH = "x86_64"
else:
TARGET_ARCH = "arm64-v8a"