{"record":{"id":"e17de4d3cccf6acf","repo":"nodejs/node","slug":"failed-to-compile-s-n","errorCode":null,"errorMessage":"Failed to compile %s\\n","messagePattern":"Failed to compile (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":2245,"sourceCode":"    const char* obj = \"oma.obj\";\n    FileStream* stream = nullptr;\n\n    stream = T_FileStream_open(source,\"w\");\n    if (stream != nullptr) {\n        T_FileStream_writeLine(stream, code);\n        T_FileStream_close(stream);\n\n        char cmd[LARGE_BUFFER_MAX_SIZE];\n        snprintf(cmd, sizeof(cmd), \"%s %s -o %s\",\n            pkgDataFlags[COMPILER],\n            source,\n            obj);\n\n        if (runCommand(cmd) == 0){\n            sprintf(optMatchArch, \"%s\", obj);\n        }\n        else {\n            fprintf(stderr, \"Failed to compile %s\\n\", source);\n        }\n        if(!T_FileStream_remove(source)){\n            fprintf(stderr, \"T_FileStream_remove failed to delete %s\\n\", source);\n        }\n    }\n    else {\n        fprintf(stderr, \"T_FileStream_open failed to open %s for writing\\n\", source);\n    }\n#endif\n}\nstatic void pkg_destroyOptMatchArch(char *optMatchArch) {\n    if(T_FileStream_file_exists(optMatchArch) && !T_FileStream_remove(optMatchArch)){\n        fprintf(stderr, \"T_FileStream_remove failed to delete %s\\n\", optMatchArch);\n    }\n}\n#endif\n","sourceCodeStart":2227,"sourceCodeEnd":2262,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L2227-L2262","documentation":"In pkg_createOptMatchArch, after writing the probe source and forming a compiler command from pkgDataFlags[COMPILER], runCommand(cmd) returned non-zero — the compiler failed to produce the object file. The error names the source file; sprintf of obj into optMatchArch is skipped so architecture matching falls back. This is a non-fatal warning: the build continues but arch-specific matching is disabled.","triggerScenarios":"The C compiler named by pkgDataFlags[COMPILER] is missing, misconfigured, or rejected the probe source; pkgDataFlags (read from pkgdata.inc) are stale or for a different compiler; cross-compile CC not on PATH.","commonSituations":"Mixing compilers (e.g. pkgdata.inc generated by clang but cc is gcc); a toolchain not on PATH; incompatible compiler flags in the .inc file after an ICU upgrade.","solutions":["Check that the compiler in pkgDataFlags[COMPILER] is installed and on PATH.","Regenerate pkgdata.inc (make install) so COMPILER matches the current toolchain.","Run the exact cmd string printed in verbose mode manually to see the compiler's real error.","If harmless, this warning can be ignored; arch-matching is optional."],"exampleFix":"# before: stale pkgdata.inc points at clang\n# verbose shows: Calling: clang -arch x86_64 probe.c -o probe.o (fails)\n\n# after: regenerate inc with the installed compiler\nmake clean && make && make install  # rebuilds pkgdata.inc for current CC","handlingStrategy":"validation","validationCode":"# Check that the compiler named in pkgdata.inc is runnable before pkgdata uses it.\ncc=$(awk -F= '/^COMPILER/{gsub(/[\"\\r\\n]/,\"\",$2);print $2;exit}' pkgdata.inc 2>/dev/null)\ncommand -v \"$cc\" >/dev/null 2>&1 || { echo \"compiler $cc not found\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the toolchain named in pkgdata.inc on PATH.","Regenerate pkgdata.inc after changing compilers (make install).","Run the verbose-printed command manually to see the real compiler error.","Remember this is a warning; arch-matching is optional."],"tags":["icu","pkgdata","build-tool","compiler","configuration"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}