{"record":{"id":"3bed7c46cdc97523","repo":"nodejs/node","slug":"s-cannot-combine-writepoolbundle-and-usepool","errorCode":null,"errorMessage":"%s: cannot combine --writePoolBundle and --usePoolBundle\\n","messagePattern":"(.+?): cannot combine --writePoolBundle and --usePoolBundle\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":157,"sourceCode":"    const char *encoding  = \"\";\n    int         i;\n    UBool illegalArg = false;\n\n    U_MAIN_INIT_ARGS(argc, argv);\n\n    options[JAVA_PACKAGE].value = \"com.ibm.icu.impl.data\";\n    options[BUNDLE_NAME].value = \"LocaleElements\";\n    argc = u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);\n\n    /* error handling, printing usage message */\n    if(argc<0) {\n        fprintf(stderr, \"%s: error in command line argument \\\"%s\\\"\\n\", argv[0], argv[-argc]);\n        illegalArg = true;\n    } else if(argc<2) {\n        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');","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L139-L175","documentation":"genrb forbids using --writePoolBundle and --usePoolBundle together. One mode generates a shared pool bundle from source resources; the other consumes an already-generated pool bundle. Doing both in one invocation is contradictory, so genrb records the conflict via illegalArg and exits non-zero after the usage banner.","triggerScenarios":"Both options[WRITE_POOL_BUNDLE].doesOccur and options[USE_POOL_BUNDLE].doesOccur are true on the same genrb command line.","commonSituations":"A build script that was edited to switch from write mode to use mode but left both flags; combining flags from two different tutorial examples; CI matrix that concatenates option strings.","solutions":["Split into two genrb invocations: first run with --writePoolBundle to produce the pool, then run with --usePoolBundle to compile consumers.","Remove whichever flag does not match the current build phase (generation vs. consumption)."],"exampleFix":"# before\ngenrb --writePoolBundle --usePoolBundle *.txt\n\n# after\n# step 1: generate the pool\ngenrb --writePoolBundle root.txt\n# step 2: consume it\ngenrb --usePoolBundle en.txt fr.txt","handlingStrategy":"validation","validationCode":"// forbid both pool modes on one command\nif '--writePoolBundle' in argv and '--usePoolBundle' in argv:\n    raise SystemExit('genrb: pass --writePoolBundle and --usePoolBundle in separate invocations')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Model pool generation and pool consumption as two distinct build targets.","Add an assertion in the build helper that the two flags never co-occur."],"tags":["icu","genrb","cli","mutually-exclusive","pool-bundle"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}