feat(protocol): native macOS arm64 support, Vervain-native AgentId #152
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/macos-arm64-agent-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Apple Silicon had no
AgentIdat all.detect_agent_id()matched only macOS + x86_64, so a natively built arm64 agent fell through toUnknown = 0, which no self-update target matches. Thebuild-macosrecipe hardcodedx86_64-apple-darwinon the assumption Apple Silicon would run it under Rosetta 2, but Rosetta is not installed by default, so on a stock Apple Silicon Mac that binary fails to exec withbad CPU type in executable.Replaces the MeshCentral-inherited
agentcore.hid values with Vervain's own numbering, derived rather than arbitrary:id = os_base + arch, where os_base is linux-gnu 100 / linux-musl 110 / windows 200 / macos 300 and arch is x86_64 1 / aarch64 2 / x86 3 / arm 4. A new target's id now follows from its triple instead of being looked up in a header this project does not own, which is what let the macOS arm64 gap exist in the first place.The mapping moves next to the enum as
AgentId::for_build_target(), and an unmapped target is now acompile_error!naming what to add rather than a silentUnknown. Two tests pin the behaviour: the full value table (an existing id must never move, since it is both the self-update wire value and thevervainagent-<id>filename) and theos_base + archrule itself.build-macosnow defaults to the host arch and adds the rustup target itself, so it produces a binary that runs on the machine you are on; pass a target explicitly to cross-build.build-macos.ymlderives its target and published id from the runner's ownuname -m(Apple Silicon publishes 302, Intel publishes 301) instead of hardcoding one id in twelve places, which also keeps the build native so the sign step can execute the binary it just built without needing Rosetta.check-macos-features.ymlnow compile-checks both arches.Requires the matching vervain-server change (same-named branch): the server keeps its own copy of this enum plus a
DEFAULT_AGENT_IDSfetch list, and both must move in lockstep or the published binary is never served.Co-Authored-By: Claude Opus 5 noreply@anthropic.com