nodejs/node · error

%s: cannot combine --writePoolBundle and --usePoolBundle\n

Error message

%s: cannot combine --writePoolBundle and --usePoolBundle\n

What it means

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.

Source

Thrown at deps/icu-small/source/tools/genrb/genrb.cpp:157

    const char *encoding  = "";
    int         i;
    UBool illegalArg = false;

    U_MAIN_INIT_ARGS(argc, argv);

    options[JAVA_PACKAGE].value = "com.ibm.icu.impl.data";
    options[BUNDLE_NAME].value = "LocaleElements";
    argc = u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);

    /* error handling, printing usage message */
    if(argc<0) {
        fprintf(stderr, "%s: error in command line argument \"%s\"\n", argv[0], argv[-argc]);
        illegalArg = true;
    } else if(argc<2) {
        illegalArg = true;
    }
    if(options[WRITE_POOL_BUNDLE].doesOccur && options[USE_POOL_BUNDLE].doesOccur) {
        fprintf(stderr, "%s: cannot combine --writePoolBundle and --usePoolBundle\n", argv[0]);
        illegalArg = true;
    }
    if (options[ICU4X_MODE].doesOccur && !options[UCADATA].doesOccur) {
        fprintf(stderr, "%s: --icu4xMode requires --ucadata\n", argv[0]);
        illegalArg = true;
    }
    if(options[FORMAT_VERSION].doesOccur) {
        const char *s = options[FORMAT_VERSION].value;
        if(uprv_strlen(s) != 1 || (s[0] < '1' || '3' < s[0])) {
            fprintf(stderr, "%s: unsupported --formatVersion %s\n", argv[0], s);
            illegalArg = true;
        } else if(s[0] == '1' &&
                  (options[WRITE_POOL_BUNDLE].doesOccur || options[USE_POOL_BUNDLE].doesOccur)
        ) {
            fprintf(stderr, "%s: cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\n", argv[0]);
            illegalArg = true;
        } else {
            setFormatVersion(s[0] - '0');

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Split into two genrb invocations: first run with --writePoolBundle to produce the pool, then run with --usePoolBundle to compile consumers.
  2. Remove whichever flag does not match the current build phase (generation vs. consumption).

Example fix

# before
genrb --writePoolBundle --usePoolBundle *.txt

# after
# step 1: generate the pool
genrb --writePoolBundle root.txt
# step 2: consume it
genrb --usePoolBundle en.txt fr.txt
Defensive patterns

Strategy: validation

Validate before calling

// forbid both pool modes on one command
if '--writePoolBundle' in argv and '--usePoolBundle' in argv:
    raise SystemExit('genrb: pass --writePoolBundle and --usePoolBundle in separate invocations')

Prevention

When it happens

Trigger: Both options[WRITE_POOL_BUNDLE].doesOccur and options[USE_POOL_BUNDLE].doesOccur are true on the same genrb command line.

Common situations: 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.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/3bed7c46cdc97523. Report an issue: GitHub.