nodejs/node · error

genccode: error building filename or entrypoint\n

Error message

genccode: error building filename or entrypoint\n

What it means

Inside getOutFilename, the output filename and entry-point name are assembled with icu::UnicodeString builders carrying a UErrorCode. If status.isFailure() after the appends (e.g. U_BUFFER_OVERFLOW_ERROR from a builder, or an allocation failure), the tool prints this generic message and exits with status.get() (pkg_genc.cpp:790).

Source

Thrown at deps/icu-small/source/tools/toolutil/pkg_genc.cpp:791

        /* replace '.' by '_' */
        outFilenameBuilder.append('_', status);
        entryNameBuilder.append('_', status);
        ++inFilename;

        /* copy suffix */
        outFilenameBuilder.append(inFilename, status);
        entryNameBuilder.append(inFilename, status);

        if(optFilename != nullptr) {
            outFilenameBuilder.truncate(saveOutFilenameLength);
            outFilenameBuilder.append(optFilename, status);
        }
        // add ".c"
        outFilenameBuilder.append(newSuffix, status);
    }

    if (status.isFailure()) {
        fprintf(stderr, "genccode: error building filename or entrypoint\n");
        exit(status.get());
    }

    if (outFilenameBuilder.length() >= outFilenameCapacity) {
        fprintf(stderr, "genccode: output filename too long\n");
        exit(U_ILLEGAL_ARGUMENT_ERROR);
    }

    if (entryNameBuilder.length() >= entryNameCapacity) {
        fprintf(stderr, "genccode: entry name too long (long filename?)\n");
        exit(U_ILLEGAL_ARGUMENT_ERROR);
    }

    outFilenameBuilder.extract(outFilename, outFilenameCapacity, status);
    entryNameBuilder.extract(entryName, entryNameCapacity, status);
}

#ifdef CAN_GENERATE_OBJECTS

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Shorten the input basename and any --filename/--entrypoint overrides.
  2. Reduce overall path depth passed to genccode.
  3. Ensure the build host has adequate memory.
Defensive patterns

Strategy: validation

Validate before calling

# Length-check the inputs that get concatenated by the builders.
total=$(( ${#INBASE} + ${#OPTNAME} + ${#SUFFIX} ))
[ "$total" -lt 256 ] || { echo "filename/entrypoint inputs too long"; exit 2; }

Prevention

When it happens

Trigger: Builder append overflows the UnicodeString's internal capacity, or memory allocation inside the builder fails; also possible with malformed/overlong filename bytes fed to append.

Common situations: Extremely long input filename combined with a long --filename/--entrypoint override; low-memory build environment; exotic/corrupt filename bytes.

Related errors


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