{"record":{"id":"14e5f05d8c1aba18","repo":"nodejs/node","slug":"s-cannot-combine-formatversion-1-with-writep","errorCode":null,"errorMessage":"%s: cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\\n","messagePattern":"(.+?): cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":172,"sourceCode":"        illegalArg = true;\n    }\n    if(options[WRITE_POOL_BUNDLE].doesOccur && options[USE_POOL_BUNDLE].doesOccur) {\n        fprintf(stderr, \"%s: cannot combine --writePoolBundle and --usePoolBundle\\n\", argv[0]);\n        illegalArg = true;\n    }\n    if (options[ICU4X_MODE].doesOccur && !options[UCADATA].doesOccur) {\n        fprintf(stderr, \"%s: --icu4xMode requires --ucadata\\n\", argv[0]);\n        illegalArg = true;\n    }\n    if(options[FORMAT_VERSION].doesOccur) {\n        const char *s = options[FORMAT_VERSION].value;\n        if(uprv_strlen(s) != 1 || (s[0] < '1' || '3' < s[0])) {\n            fprintf(stderr, \"%s: unsupported --formatVersion %s\\n\", argv[0], s);\n            illegalArg = true;\n        } else if(s[0] == '1' &&\n                  (options[WRITE_POOL_BUNDLE].doesOccur || options[USE_POOL_BUNDLE].doesOccur)\n        ) {\n            fprintf(stderr, \"%s: cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\\n\", argv[0]);\n            illegalArg = true;\n        } else {\n            setFormatVersion(s[0] - '0');\n        }\n    }\n\n    if((options[JAVA_PACKAGE].doesOccur || options[BUNDLE_NAME].doesOccur) &&\n            !options[WRITE_JAVA].doesOccur) {\n        fprintf(stderr,\n                \"%s error: command line argument --java-package or --bundle-name \"\n                \"without --write-java\\n\",\n                argv[0]);\n        illegalArg = true;\n    }\n\n    if(options[VERSION].doesOccur) {\n        fprintf(stderr,\n                \"%s version %s (ICU version %s).\\n\"","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L154-L190","documentation":"genrb forbids combining formatVersion 1 with pool bundles. Pool bundles (written via --writePoolBundle or consumed via --usePoolBundle) rely on the strings-v2 layout and a keys pool that only exists in formatVersion 2 and above; formatVersion 1 predates that infrastructure. The check at genrb.cpp:169-173 catches s[0] == '1' together with either pool flag being set and sets illegalArg=true.","triggerScenarios":"Running `genrb --formatVersion 1 --writePoolBundle out/ root.txt` or `genrb --formatVersion 1 --usePoolBundle pool/ root.txt`. Either pool flag combined with formatVersion 1 triggers the branch.","commonSituations":"Trying to produce smaller backwards-compatible .res files while also adopting the pool-bundle optimization; copy-pasting a formatVersion 1 flag from an older build script into a modern data build that enables pool bundles.","solutions":["Use --formatVersion 2 or 3 (or omit it) when enabling pool bundles: `genrb --formatVersion 3 --usePoolBundle pool/ root.txt`.","Drop --writePoolBundle / --usePoolBundle if you truly must emit formatVersion 1 files.","Regenerate the pool bundle with the same or higher formatVersion as the consuming bundles."],"exampleFix":"// before\ngenrb --formatVersion 1 --usePoolBundle ./pool root.txt\n// after\ngenrb --formatVersion 3 --usePoolBundle ./pool root.txt","handlingStrategy":"validation","validationCode":"# Reject formatVersion 1 combined with pool-bundle flags\nif [ \"$FORMAT_VERSION\" = \"1\" ] && { [ -n \"$WRITE_POOL_BUNDLE\" ] || [ -n \"$USE_POOL_BUNDLE\" ]; }; then\n  echo \"ERROR: formatVersion 1 is incompatible with pool bundles\" >&2\n  exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When introducing pool bundles, bump formatVersion to 3 in the same commit.","Document the formatVersion floor for pool-bundle builds in your data build README."],"tags":["icu","genrb","cli-argument","pool-bundle","format-version"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}