{"record":{"id":"77921f1e92918b2f","repo":"zed-industries/zed","slug":"build-failed","errorCode":null,"errorMessage":"Build failed","messagePattern":"Build failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/debugger_ui/src/session/running.rs","lineNumber":1230,"sourceCode":"                        cx,\n                    )\n                })?;\n\n                this.update_in(cx, |this, window, cx| {\n                    this.ensure_pane_item(DebuggerPaneItem::Terminal, window, cx);\n                    this.debug_terminal.update(cx, |debug_terminal, cx| {\n                        debug_terminal.terminal = Some(terminal_view);\n                        cx.notify();\n                    });\n                })?;\n\n                let exit_status = terminal\n                    .read_with(cx, |terminal, cx| terminal.wait_for_completed_task(cx))\n                    .await\n                    .context(\"Failed to wait for completed task\")?;\n\n                if !exit_status.success() {\n                    anyhow::bail!(\"Build failed\");\n                }\n                Some((task.resolved.clone(), locator_name, extra_config))\n            } else {\n                None\n            };\n\n            if config_is_valid {\n            } else if let Some((task, locator_name, extra_config)) = build_output {\n                let locator_name =\n                    locator_name.with_context(|| {\n                        format!(\"Could not find a valid locator for a build task and configure is invalid with error: {}\", request_type.err()\n                            .map(|err| err.to_string())\n                            .unwrap_or_default())\n                    })?;\n                let request = dap_store\n                    .update(cx, |this, cx| {\n                        this.run_debug_locator(&locator_name, task, cx)\n                    })?","sourceCodeStart":1212,"sourceCodeEnd":1248,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/debugger_ui/src/session/running.rs#L1212-L1248","documentation":"When a debug scenario declares a `build` task, Zed runs it in a terminal panel and awaits `wait_for_completed_task`; a non-success exit status aborts the debug session with plain `Build failed` (running.rs:1230). The build output itself is in the terminal, not in the error — the error only signals the exit code.","triggerScenarios":"The scenario's build command (cargo build, make, npm run build, go build, …) exits non-zero, is killed by a signal (SIGKILL/OOM, Ctrl-C in the terminal), or the command fails to even start correctly inside the terminal task (wrong cwd, missing binary in PATH).","commonSituations":"Compile errors at debug time; wrong working directory for the build task; toolchain not installed in the environment Zed spawns; builds cancelled mid-run; flaky builds that fail intermittently.","solutions":["Run the exact same build task manually (Zed task runner or terminal) and fix the reported errors — the failure reason is in that terminal output.","Check the build task's `command` and `cwd` match how you build the project outside Zed.","Confirm the toolchain (cargo/make/npm/go) is on PATH in the environment Zed inherits; launch Zed from a shell with the right env if needed.","If the failure was a cancelled/timeout run, simply rerun the debug scenario."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# run the build standalone before starting the debug scenario\n./script/build || echo \"fix build errors first — the debug session would abort with 'Build failed'\"","typeGuard":null,"tryCatchPattern":"Catch the non-success exit and attach the terminal's task context (task name, exit code, signal) to the error so the user can jump straight to the failing output; do not swallow and continue to the debug session.","preventionTips":["Keep build tasks green before debugging; run them standalone after edits.","Pin correct cwd and PATH in the build task definition.","Treat intermittent signal-killed builds as environment issues (OOM) and investigate, not retry blindly."],"tags":["debugger","build-task","exit-status","zed"],"backgroundTag":"build-command-failed","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}