{"record":{"id":"7969e7f8ad9cd766","repo":"zed-industries/zed","slug":"zig-not-found-on-path-install-zig-see-https-z","errorCode":null,"errorMessage":"zig not found on $PATH, install zig (see https://ziglang.org/learn/getting-started or use zigup)","messagePattern":"zig not found on \\$PATH, install zig \\(see https://ziglang\\.org/learn/getting-started or use zigup\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/remote/src/transport.rs","lineNumber":348,"sourceCode":"            new_command(\"cargo\")\n                .current_dir(concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/../..\"))\n                .args([\n                    \"build\",\n                    \"--package\",\n                    \"remote_server\",\n                    \"--features\",\n                    \"debug-embed\",\n                    \"--target-dir\",\n                    \"target/remote_server\",\n                    \"--target\",\n                    &triple,\n                ])\n                .env(\"RUSTFLAGS\", &rust_flags),\n        )\n        .await?;\n    } else {\n        if which(\"zig\", cx).await?.is_none() {\n            anyhow::bail!(if cfg!(not(windows)) {\n                \"zig not found on $PATH, install zig (see https://ziglang.org/learn/getting-started or use zigup)\"\n            } else {\n                \"zig not found on $PATH, install zig (use `winget install -e --id zig.zig` or see https://ziglang.org/learn/getting-started or use zigup)\"\n            });\n        }\n\n        let rustup = which(\"rustup\", cx)\n            .await?\n            .context(\"rustup not found on $PATH, install rustup (see https://rustup.rs/)\")?;\n        delegate.set_status(Some(\"Adding rustup target for cross-compilation\"), cx);\n        log::info!(\"adding rustup target\");\n        run_cmd(new_command(rustup).args([\"target\", \"add\"]).arg(&triple)).await?;\n\n        if which(\"cargo-zigbuild\", cx).await?.is_none() {\n            delegate.set_status(Some(\"Installing cargo-zigbuild for cross-compilation\"), cx);\n            log::info!(\"installing cargo-zigbuild\");\n            run_cmd(new_command(\"cargo\").args([\"install\", \"--locked\", \"cargo-zigbuild\"])).await?;\n        }","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/remote/src/transport.rs#L330-L366","documentation":"When Zed must build the remote server from source for a cross-compilation target (no prebuilt available, or a from-source/dev build), it uses zig as the cross toolchain. Before proceeding it probes `which zig`; if zig is absent it bails with a platform-specific install hint (crates/remote/src/transport.rs:348). rustup is required immediately after for `rustup target add`.","triggerScenarios":"Connecting to a remote platform that has no prebuilt server (or forcing a from-source build) from a machine without zig on PATH - the cross-compile path runs and the `which(\"zig\")` probe returns None.","commonSituations":"Dev builds / ZED_FROM_SOURCE workflows; remote-developing to unusual platforms; fresh dev machines that have rustup but no zig.","solutions":["Install zig - via zigup, `winget install -e --id zig.zig` on Windows, or your package manager - and make sure it is on PATH in the environment Zed launches from","Verify with `which zig` and `zig version` in that same shell","Also ensure rustup is installed, since the next step runs `rustup target add <triple>`","Prefer prebuilt servers (stable Zed on common platforms) so no build is needed"],"exampleFix":"# before\n$ which zig\n(no output)\n\n# after\n$ brew install zig   # or: winget install -e --id zig.zig / curl -L https://zigup.rs | sh\n$ zig version\n0.13.0","handlingStrategy":"validation","validationCode":"use which::which;\n\nif which(\"zig\").is_err() {\n    eprintln!(\"zig is required to cross-compile the remote server from source\");\n    // install zig (and rustup) before attempting the connection\n}\nif which(\"rustup\").is_err() {\n    eprintln!(\"rustup is required next (rustup target add <triple>)\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-install zig and rustup on machines used for from-source remote builds","Verify with `which zig` in the same shell/environment Zed launches from","Prefer prebuilt remote servers on common platforms so no toolchain is needed"],"tags":["build","zig","cross-compilation","remote-server","path","toolchain"],"backgroundTag":"missing-tool-on-path","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}