{"record":{"id":"1714219992ba1c56","repo":"sxyazi/yazi","slug":"unwinding-must-be-enabled-for-windows-please-use","errorCode":null,"errorMessage":"Unwinding must be enabled for Windows. Please use `cargo build --profile release-windows --locked` instead to build Yazi.","messagePattern":"Unwinding must be enabled for Windows\\. Please use `cargo build --profile release-windows --locked` instead to build Yazi\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-fm/build.rs","lineNumber":13,"sourceCode":"use std::env;\n\nfn main() {\n\tlet dir = env::var(\"OUT_DIR\").unwrap();\n\n\t// cargo build\n\t//   C:\\Users\\Ika\\Desktop\\yazi\\target\\release\\build\\yazi-fm-cfc94820f71daa30\\out\n\t// cargo install\n\t//   C:\\Users\\Ika\\AppData\\Local\\Temp\\cargo-installTFU8cj\\release\\build\\\n\t// yazi-fm-45dffef2500eecd0\\out\n\n\tif dir.contains(r\"\\release\\build\\yazi-fm-\") {\n\t\tpanic!(\n\t\t\t\"Unwinding must be enabled for Windows. Please use `cargo build --profile release-windows --locked` instead to build Yazi.\"\n\t\t);\n\t}\n\n\tlet manifest = env::var_os(\"CARGO_MANIFEST_DIR\").unwrap().to_string_lossy().replace(r\"\\\", \"/\");\n\tif manifest.contains(\"/git/checkouts/yazi-\")\n\t\t|| manifest.contains(\"/registry/src/index.crates.io-\")\n\t{\n\t\tpanic!(\n\t\t\t\"Due to Cargo's limitations, Yazi on crates.io must be built with `cargo install --force yazi-build`\"\n\t\t);\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/sxyazi/yazi/blob/a541adde4e5b082719a0f21a87eb3eab071ece58/yazi-fm/build.rs#L1-L27","documentation":"This panic fires in yazi-fm's build script when the OUT_DIR path looks like a default Windows release build (`\\release\\build\\yazi-fm-`). The default Windows release profile disables unwinding, which Yazi requires for its control flow. The build must use the repo's `release-windows` profile instead.","triggerScenarios":"Running `cargo build --release` (or `cargo install` which builds in a temp `release` dir) on Windows with the default release profile, so OUT_DIR matches `\\release\\build\\yazi-fm-`.","commonSituations":"Windows users compiling Yazi themselves with `cargo build --release` instead of the documented command; `cargo install` creating temp release dirs (e.g. `cargo-install...\\release\\build\\yazi-fm-...`).","solutions":["Build with `cargo build --profile release-windows --locked` as the error message instructs.","If installing via cargo, use `cargo install --path yazi-fm --profile release-windows --locked` rather than the default release profile.","Alternatively use an official prebuilt Windows binary."],"exampleFix":"// before\ncargo build --release\n\n// after\ncargo build --profile release-windows --locked","handlingStrategy":"validation","validationCode":"# Verify the profile exists before building\ngrep -q 'profile.release-windows' Cargo.toml || echo 'run builds via the release-windows profile'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On Windows always use `cargo build --profile release-windows --locked`.","Do not use `cargo build --release` or `cargo install` default profiles on Windows.","Use the packaged build scripts (scripts/build.sh) or official binaries."],"tags":["windows","panic","unwinding","build-profile"],"backgroundTag":"windows-unwinding-required","analyzedSha":"a541adde4e5b082719a0f21a87eb3eab071ece58","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}