{"record":{"id":"9a838a1e4873c8b3","repo":"earendil-works/pi","slug":"no-windows-cross-compiler-found-for-target-arch","errorCode":null,"errorMessage":"No Windows cross-compiler found for ${target.arch}. Install Microsoft C++ Build Tools on Windows, or set ${target.envCompiler} to a MinGW-compatible compiler.","messagePattern":"No Windows cross-compiler found for (.+?)\\. Install Microsoft C\\+\\+ Build Tools on Windows, or set (.+?) to a MinGW-compatible compiler\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/tui/native/win32/build.mjs","lineNumber":171,"sourceCode":"\t\t\t\t\"/link\",\n\t\t\t\t\"/NOENTRY\",\n\t\t\t\t\"/NODEFAULTLIB\",\n\t\t\t\t\"kernel32.lib\",\n\t\t\t\t\"/OPT:REF\",\n\t\t\t\t\"/OPT:ICF\",\n\t\t\t].join(\" \"),\n\t\t\t\"if errorlevel 1 exit /b %errorlevel%\",\n\t\t].join(\"\\r\\n\"),\n\t);\n\n\trun(\"cmd.exe\", [\"/d\", \"/s\", \"/c\", batchFile], { cwd: buildDir });\n\tinstallOutput(temporaryOutput, target);\n}\n\nfunction buildWithMingw(target) {\n\tconst compiler = resolveMingwCompiler(target);\n\tif (!compiler) {\n\t\tthrow new Error(\n\t\t\t`No Windows cross-compiler found for ${target.arch}. Install Microsoft C++ Build Tools on Windows, or set ${target.envCompiler} to a MinGW-compatible compiler.`,\n\t\t);\n\t}\n\n\tconst buildDir = path.join(temporaryDir, `mingw-${target.arch}`);\n\tconst temporaryOutput = path.join(buildDir, \"win32-console-mode.node\");\n\tmkdirSync(buildDir, { recursive: true });\n\n\tconst args = [\n\t\t...(compiler.useTargetFlag ? [`--target=${target.mingwTarget}`] : []),\n\t\t\"-std=c11\",\n\t\t\"-Wall\",\n\t\t\"-Wextra\",\n\t\t\"-Oz\",\n\t\t\"-shared\",\n\t\t\"-nostdlib\",\n\t\t\"-Wl,--no-entry\",\n\t\t\"-Wl,--strip-all\",","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/tui/native/win32/build.mjs#L153-L189","documentation":"Environment-validation error in buildWithMingw: resolveMingwCompiler found no usable MinGW-compatible cross-compiler (e.g. aarch64-w64-mingw32-gcc) for the target arch on this machine. The mingw build path cannot proceed at all, so the script tells the user to either install MSVC Build Tools on Windows or point the arch-specific CC env var at a compatible compiler.","triggerScenarios":"Thrown at packages/tui/native/win32/build.mjs:171 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install Microsoft C++ Build Tools on Windows, or set the indicated environment variable to a MinGW-compatible compiler."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}