{"record":{"id":"4babc19156a0a6d3","repo":"zed-industries/zed","slug":"failed-to-find-fxc-exe","errorCode":null,"errorMessage":"Failed to find fxc.exe","messagePattern":"Failed to find fxc\\.exe","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/build.rs","lineNumber":138,"sourceCode":"            return path;\n        }\n\n        // Try to find in PATH\n        // NOTE: This has to be `where.exe` on Windows, not `where`, it must be ended with `.exe`\n        if let Ok(output) = std::process::Command::new(\"where.exe\")\n            .arg(\"fxc.exe\")\n            .output()\n            && output.status.success()\n        {\n            let path = String::from_utf8_lossy(&output.stdout);\n            return path.trim().to_string();\n        }\n\n        if let Ok(Some(path)) = find_latest_windows_sdk_binary(\"fxc.exe\") {\n            return path.to_string_lossy().into_owned();\n        }\n\n        panic!(\"Failed to find fxc.exe\");\n    }\n\n    fn compile_shader_for_module(\n        module: &str,\n        out_dir: &str,\n        fxc_path: &str,\n        shader_path: &str,\n        rust_binding_path: &str,\n    ) {\n        // Compile vertex shader\n        let output_file = format!(\"{}/{}_vs.h\", out_dir, module);\n        let const_name = format!(\"{}_VERTEX_BYTES\", module.to_uppercase());\n        compile_shader_impl(\n            fxc_path,\n            &format!(\"{module}_vertex\"),\n            &output_file,\n            &const_name,\n            shader_path,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_windows/build.rs#L120-L156","documentation":"gpui_windows compiles its HLSL shaders at build time with fxc.exe, the DirectX shader compiler shipped with the Windows SDK. The build script first tries where fxc.exe, then scans installed Windows SDKs for the newest copy, and panics if neither finds it. This is a build-environment failure: the machine compiling the crate lacks the Windows SDK shader compiler.","triggerScenarios":"Running cargo build for gpui_windows on a machine without the Windows 10/11 SDK, with VS Build Tools that skip the SDK component, or with an SDK layout the version scan cannot see (custom install root, unusual SDK version). CI images lacking the SDK fail deterministically.","commonSituations":"Fresh dev machine or CI runner with Visual Studio Build Tools but no 'Windows SDK' workload; minimal Windows containers used for builds; SDK installed for a different architecture or only partial toolsets.","solutions":["Install the Windows SDK via Visual Studio Installer (included in 'Desktop development with C++') or as a standalone installer","Verify fxc exists: check C:\\Program Files (x86)\\Windows Kits\\10\\Bin\\<version>\\x64\\fxc.exe and run: where fxc.exe","If the SDK is installed but not found, add its Bin directory to PATH so the where-based lookup succeeds","On CI, use an image with the Windows SDK preinstalled or add an SDK install step before cargo build"],"exampleFix":"# before: only Build Tools installed\ncargo build -p gpui_windows   # build.rs panics: Failed to find fxc.exe\n\n# after: install the SDK, then rebuild\nwinget install Microsoft.WindowsSDK.10.0.26100 --silent\ncargo build -p gpui_windows","handlingStrategy":"validation","validationCode":"# fail fast in CI before building gpui_windows\n- name: Check for fxc.exe (Windows SDK)\n  shell: pwsh\n  run: |\n    $sdkBin = 'C:\\Program Files (x86)\\Windows Kits\\10\\Bin'\n    if (-not (Get-Command fxc.exe -ErrorAction SilentlyContinue) -and -not (Test-Path $sdkBin)) {\n      throw 'Windows SDK missing (fxc.exe not found) - install it before building gpui_windows'\n    }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include the Windows SDK in every image/container that builds gpui_windows","Run an fxc.exe preflight step in CI so failures name the missing component instead of a proc-macro panic","Document the SDK requirement next to the Windows build instructions"],"tags":["windows","build-script","directx","fxc","windows-sdk"],"backgroundTag":"missing-build-tool","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}