{"record":{"id":"06afba4817198d99","repo":"nodejs/node","slug":"u-illegal-argument-error-06afba","errorCode":"U_ILLEGAL_ARGUMENT_ERROR","errorMessage":"gencmn: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\\n\tBad path: '%s'\\n","messagePattern":"gencmn: Error: absolute path encountered\\. Old style paths are not supported\\. Use relative paths such as 'fur\\.res' or 'translit%cfur\\.res'\\.\\\\n\tBad path: '(.+?)'\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp","lineNumber":426,"sourceCode":"addFile(const char *filename, const char *name, const char *source, UBool sourceTOC, UBool verbose) {\n    char *s;\n    uint32_t length;\n    char *fullPath = nullptr;\n\n    if(fileCount==fileMax) {\n      fileMax += CHUNK_FILE_COUNT;\n      files = static_cast<File*>(uprv_realloc(files, fileMax * sizeof(files[0]))); /* note: never freed. */\n      if(files==nullptr) {\n        fprintf(stderr, \"pkgdata/gencmn: Could not allocate %u bytes for %d files\\n\", static_cast<unsigned int>(fileMax * sizeof(files[0])), fileCount);\n        exit(U_MEMORY_ALLOCATION_ERROR);\n      }\n    }\n\n    if(!sourceTOC) {\n        FileStream *file;\n\n        if(uprv_pathIsAbsolute(filename)) {\n            fprintf(stderr, \"gencmn: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\\n\\tBad path: '%s'\\n\", U_FILE_SEP_CHAR, filename);\n            exit(U_ILLEGAL_ARGUMENT_ERROR);\n        }\n        fullPath = pathToFullPath(filename, source);\n        /* store the pathname */\n        length = static_cast<uint32_t>(uprv_strlen(filename) + 1 + uprv_strlen(name) + 1);\n        s=allocString(length);\n        uprv_strcpy(s, name);\n        uprv_strcat(s, U_TREE_ENTRY_SEP_STRING);\n        uprv_strcat(s, filename);\n\n        /* get the basename */\n        fixDirToTreePath(s);\n        files[fileCount].basename=s;\n        files[fileCount].basenameLength=length;\n\n        files[fileCount].pathname=fullPath;\n\n        basenameTotal+=length;","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp#L408-L444","documentation":"A listed filename is absolute (uprv_pathIsAbsolute true) and gencmn rejects it: old-style absolute paths are not supported, only relative paths like 'fur.res' or 'translit/fur.res'. Prints guidance + the bad path and exit(U_ILLEGAL_ARGUMENT_ERROR).","triggerScenarios":"The input list contains an entry beginning with '/' (or a drive root on Windows), e.g. /home/user/build/icudt/fur.res. The check fires in addFile only when !sourceTOC, before pathToFullPath.","commonSituations":"A list generator that emits absolute paths instead of relative; copying a list from another machine that baked in absolute build dirs; Windows list with C:\\\\ prefixes.","solutions":["Strip the absolute prefix from list entries so they are relative to the source dir: `sed -E 's#^/##; s#^[A-Za-z]:[\\\\/]##'` is a quick fix, but better to fix the generator.","Regenerate the list using relative paths from the directory gencmn is run in.","Run gencmn from the directory the data files live in and pass relative names.","Validate the list before running: reject lines matching ^/ or ^[A-Za-z]:[\\\\/]."],"exampleFix":"# before (list line)\n/home/build/icudt75l/fur.res\n# after\nfur.res","handlingStrategy":"validation","validationCode":"# reject absolute paths in the list before invoking gencmn\nif grep -nE '^/|^[A-Za-z]:[\\\\/]' \"$LIST\"; then echo \"absolute paths forbidden\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate lists with paths relative to the source dir.","Validate list entries are relative before packaging.","Normalize separators for the target platform when moving lists between OSes.","Document the 'fur.res' / 'translit/fur.res' relative-path contract to list authors."],"tags":["icu","gencmn","path","build-tools","argument-error"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}