feat: support arm64 Linux simulator-server binary#328
Conversation
The only Linux binary argent shipped was the x86_64 ELF (simulator-server-argent-linux), so arm64 Linux hosts (Lima/UTM VMs on Apple Silicon, arm cloud instances) had no usable simulator-server. Introduce a host platform key — process.platform everywhere except arm64 Linux, which maps to 'linux-arm64' — and apply it across the binary pipeline: - native-devtools-ios resolver exposes hostPlatformKey() and resolves bin/linux-arm64/ on arm64 Linux; darwin stays a single universal dir - argent-simulator-server.cjs npm bin dispatcher mirrors the same key - bundle-tools.cjs bundles the linux-arm64 binary when staged - download-simulator-server.sh fetches simulator-server-argent-linux-arm64 (tolerating its absence until the upstream release ships it) - dev.cjs copies the current host's binary by key - publish/publish-next/build-package-artifact workflows include linux-arm64 in the inventory, gated by the same ARGENT_REQUIRE_LINUX_BINARY flag as x86_64 Linux The upstream asset is added by the companion radon PR that matrixes the argent Linux build over ubuntu-latest and ubuntu-24.04-arm.
A wrong-arch binary in a platform dir is worse than a missing one: the resolver picks it and the user gets a bare ENOEXEC at spawn time. The download script now checks each downloaded binary with file(1) against the expected format for its platform key (darwin: Mach-O universal, linux: x86-64 ELF, linux-arm64: aarch64 ELF) and fails hard on a mismatch — unlike the missing-asset case, which stays warn-and-skip. The publish/artifact workflows' inventory also logs file(1) output per binary so the shipped architectures are visible in every run.
|
End-to-end validation against real binaries — the companion workflow (software-mansion/radon#126) was dispatched from its branch and published a complete test release including The downloaded arm64 binary was also executed on an aarch64 Linux VM (Lima): The |
Summary
The only Linux simulator-server binary argent ships today is x86_64 (
simulator-server-argent-linux— verified:ELF 64-bit … x86-64). On arm64 Linux hosts (Lima/UTM VMs on Apple Silicon, arm cloud instances, Raspberry Pi-class devices) the package has no usable binary — the x86_64 ELF would only fail withENOEXECat spawn time.This PR teaches the whole binary pipeline about a host platform key:
process.platformeverywhere, except arm64 Linux which maps tolinux-arm64. macOS keeps a singledarwin/dir because its binary is universal (lipo); Linux binaries are single-arch ELFs, so each arch gets its own platform-keyed directory. x86_64 Linux keeps the existinglinuxkey for backward compatibility.Changes
@argent/native-devtools-iosresolver — new exportedhostPlatformKey();simulatorServerBinaryPath()resolvesbin/linux-arm64/on arm64 Linux and names the searched key in its error message.argent-simulator-server.cjsdispatcher (npmbinentry) — mirrors the same key (duplicated deliberately; the dispatcher ships as a standalone file).bundle-tools.cjs—linux-arm64added to the supported host platform dirs; copied into the package when staged, warn-and-skip otherwise (same as x86_64 Linux).scripts/download-simulator-server.sh— downloadssimulator-server-argent-linux-arm64intobin/linux-arm64/; tolerates the asset being absent (warn + skip) until the upstream release ships it, so publishing keeps working in the meantime.scripts/dev.cjs— copies the current host's binary by key.linux-arm64added to the binary inventory; gated by the existingARGENT_REQUIRE_LINUX_BINARYflag (now covering both Linux keys via alinux*glob).Tests
linux+arm64→bin/linux-arm64,linux+x64→bin/linux,darwin+arm64→bin/darwin, and the missing-binary error nameslinux-arm64.process.platform/process.archin a child process to exercise the real resolution path on any host.tsc --buildclean.download-simulator-server.shexercised against the liveradon-mainrelease: downloads darwin + linux, warn-and-skips the not-yet-published arm64 asset.Dependencies
Companion PR software-mansion/radon#126 adds the
ubuntu-24.04-armbuild leg that publishessimulator-server-argent-linux-arm64tosimulator-server-releases. This PR is safe to merge first (the download script and verify steps tolerate the missing asset); arm64 hosts start working once a release containing the new asset is cut.