earendil-works/pi · error
No Windows cross-compiler found for
Error message
No Windows cross-compiler found for ${target.arch}. Install Microsoft C++ Build Tools on Windows, or set ${target.envCompiler} to a MinGW-compatible compiler. What it means
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.
Solutions
- Install Microsoft C++ Build Tools on Windows, or set the indicated environment variable to a MinGW-compatible compiler.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/tui/native/win32/build.mjs:171 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/9a838a1e4873c8b3.
Report an issue: GitHub.
Appendix: source
Thrown at packages/tui/native/win32/build.mjs:171
"/link",
"/NOENTRY",
"/NODEFAULTLIB",
"kernel32.lib",
"/OPT:REF",
"/OPT:ICF",
].join(" "),
"if errorlevel 1 exit /b %errorlevel%",
].join("\r\n"),
);
run("cmd.exe", ["/d", "/s", "/c", batchFile], { cwd: buildDir });
installOutput(temporaryOutput, target);
}
function buildWithMingw(target) {
const compiler = resolveMingwCompiler(target);
if (!compiler) {
throw new Error(
`No Windows cross-compiler found for ${target.arch}. Install Microsoft C++ Build Tools on Windows, or set ${target.envCompiler} to a MinGW-compatible compiler.`,
);
}
const buildDir = path.join(temporaryDir, `mingw-${target.arch}`);
const temporaryOutput = path.join(buildDir, "win32-console-mode.node");
mkdirSync(buildDir, { recursive: true });
const args = [
...(compiler.useTargetFlag ? [`--target=${target.mingwTarget}`] : []),
"-std=c11",
"-Wall",
"-Wextra",
"-Oz",
"-shared",
"-nostdlib",
"-Wl,--no-entry",
"-Wl,--strip-all",View on GitHub (pinned to 4af9d21d3b)