{"record":{"id":"e5c078afe90c20ef","repo":"nodejs/node","slug":"t-filestream-remove-failed-to-delete-s-n","errorCode":null,"errorMessage":"T_FileStream_remove failed to delete %s\\n","messagePattern":"T_FileStream_remove failed to delete (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":2248,"sourceCode":"    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":2230,"sourceCodeEnd":2262,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L2230-L2262","documentation":"After (attempted) compilation of the arch-matching probe in pkg_createOptMatchArch, T_FileStream_remove(source) failed to delete the temporary .c file. This is a cleanup-only warning; the build continues. The name printed is the source path.","triggerScenarios":"The temp source file is read-only, held open by another process, on a read-only filesystem, or already removed; a sandbox/SELinux policy blocks unlink.","commonSituations":"Read-only build dir; antivirus or indexer holding the file open on Windows; container with a read-only bind mount of the build tree.","solutions":["Confirm the build directory is writable (the temp file must be deletable).","Close any process holding the file (antivirus, editor).","If filesystem is intentionally read-only, redirect temp output to a writable temp dir.","Treat as a benign warning if the build otherwise succeeds."],"exampleFix":"# before: read-only build mount\nmount -o remount,ro /build\n\n# after: writable build tree\nmount -o remount,rw /build","handlingStrategy":"fallback","validationCode":"// Ensure the temp source path is deletable before the compile step runs.\n#include <unistd.h>\nbool tempFileRemovable(const char *p) { return access(p, F_OK) != 0 ? true : unlink(p) == 0; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build in a writable directory.","Close editors/antivirus that lock temp files.","Remount read-only build trees as read-write.","Treat the warning as benign if the package built."],"tags":["icu","pkgdata","build-tool","file-io","filesystem","cleanup"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}