{"record":{"id":"a6a53e4854f04794","repo":"zed-industries/zed","slug":"build-failed","errorCode":null,"errorMessage":"build failed","messagePattern":"build failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"script/randomized-test-minimize","lineNumber":96,"sourceCode":"  process.stderr.write(`final test plan: ${outputPlanPath}\\n`);\n  process.stderr.write(`final seed: ${failingSeed}\\n`);\n  return failingSeed;\n}\n\nfunction buildTests() {\n  const { status } = spawnSync(\n    \"cargo\",\n    [\"test\", \"--no-run\", ...CARGO_TEST_ARGS],\n    {\n      stdio: \"inherit\",\n      encoding: \"utf8\",\n      env: {\n        ...process.env,\n      },\n    },\n  );\n  if (status !== 0) {\n    throw new Error(\"build failed\");\n  }\n}\n\nfunction runTests(env) {\n  const { status, stdout } = spawnSync(\n    \"cargo\",\n    [\"test\", ...CARGO_TEST_ARGS, \"random_project_collaboration\"],\n    {\n      stdio: \"pipe\",\n      encoding: \"utf8\",\n      env: {\n        ...process.env,\n        ...env,\n      },\n    },\n  );\n\n  if (status !== 0) {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/script/randomized-test-minimize#L78-L114","documentation":"Bailed by copilot_lsp_native_binary_path (copilot.rs:1403) when env::consts::ARCH is not aarch64 or x86_64 — the only CPU architectures for which GitHub ships copilot-language-server-{platform}-{arm64|x64}. Like the platform check it precedes any filesystem or network work (called from get_copilot_lsp at copilot.rs:1366), so on an unsupported architecture the download is never even attempted; the error propagates into CopilotServer::Error.","triggerScenarios":"Running the crate on 32-bit x86 (i686), 32-bit or non-Apple arm (arm, armv7, armebv7), riscv64, loongarch64, powerpc64, s390x, or wasm32 — any ARCH outside {aarch64, x86_64}. Deterministic per build target.","commonSituations":"Raspberry Pi (armv7/armhf) Linux builds; 32-bit x86 distros; emerging ports (riscv64, loongarch64) in community repos; CI jobs that accidentally build the workspace for an unsupported target; qemu-user environments reporting the guest arch.","solutions":["Do not attempt Copilot on this architecture — no server binary exists; disable edit predictions to silence the error.","Switch to a supported build: aarch64 or x86_64 toolchain/OS (e.g. 64-bit Raspberry Pi OS with aarch64 kernel and userland).","Run an x86_64/aarch64 environment via emulation or container (qemu-user, box64) so the process reports a supported ARCH.","If self-hosting a compatible binary, map the architecture in copilot_lsp_native_binary_path and place the executable at node_modules/@github/copilot-language-server-<platform>-<arch>/copilot-language-server."],"exampleFix":"// before\nlet architecture = match env::consts::ARCH {\n    \"aarch64\" => \"arm64\",\n    \"x86_64\" => \"x64\",\n    architecture => anyhow::bail!(\"unsupported architecture: {architecture}\"),\n};\n\n// after: probe with a graceful, pre-download check the caller can branch on\nfn supported_copilot_arch() -> Option<&'static str> {\n    match env::consts::ARCH {\n        \"aarch64\" => Some(\"arm64\"),\n        \"x86_64\" => Some(\"x64\"),\n        _ => None,\n    }\n}\nlet Some(arch) = supported_copilot_arch() else {\n    return Ok(None); // caller disables copilot instead of erroring\n};","handlingStrategy":"validation","validationCode":"// Same idea as the platform check: constant per build, check once.\nfn copilot_arch_supported() -> bool {\n    matches!(env::consts::ARCH, \"aarch64\" | \"x86_64\")\n}","typeGuard":"fn copilot_arch() -> Option<&'static str> {\n    match env::consts::ARCH {\n        \"aarch64\" => Some(\"arm64\"),\n        \"x86_64\" => Some(\"x64\"),\n        _ => None,\n    }\n}","tryCatchPattern":"// Prefer build-time elimination; runtime check only for clear diagnostics.\nlet Some(_arch) = copilot_arch() else {\n    anyhow::bail!(\"Copilot has no build for {}\", env::consts::ARCH);\n};","preventionTips":["Build/distribute only for aarch64 and x86_64 targets when Copilot support is required.","Use #[cfg(any(target_arch = \"aarch64\", target_arch = \"x86_64\"))] to compile the integration out elsewhere.","On armv7 hardware, use a 64-bit OS/userland so the process reports aarch64.","Pair the arch check with the OS check — both must pass before attempting download."],"tags":["copilot","zed","architecture","platform-support"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}