nodejs/node · error

Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal

Error message

Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal error.

What it means

The runtime option o->withoutAssembly is true, meaning the user requested assembly-free data building, but the pkgdata binary was compiled without the BUILD_DATA_WITHOUT_ASSEMBLY preprocessor macro defined. The code comment explicitly states 'This error should not occur.' This is a build-system configuration mismatch: pkgdata was built in a configuration that doesn't support the without-assembly code path.

Source

Thrown at deps/icu-small/source/tools/pkgdata/pkgdata.cpp:770

                        }
                        result = pkg_installLibrary(o->install, targetDir, noVersion);
                      }
                      return result;
                    }
                } else {
                    fprintf(stderr,"Assembly type \"%s\" is unknown.\n", genccodeAssembly);
                    return -1;
                }
            } else {
                if(o->verbose) {
                  fprintf(stdout, "# Writing object code to %s ..\n", gencFilePath);
                }
                if (o->withoutAssembly) {
#ifdef BUILD_DATA_WITHOUT_ASSEMBLY
                    result = pkg_createWithoutAssemblyCode(o, targetDir, mode);
#else
                    /* This error should not occur. */
                    fprintf(stderr, "Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal error.\n");
#endif
                } else {
#ifdef CAN_WRITE_OBJ_CODE
                    /* Try to detect the arch type, use nullptr if unsuccessful */
                    char optMatchArch[10] = { 0 };
                    pkg_createOptMatchArch(optMatchArch);
                    writeObjectCode(
                        datFileNamePath,
                        o->tmpDir,
                        o->entryName,
                        (optMatchArch[0] == 0 ? nullptr : optMatchArch),
                        o->cpuArch,
                        nullptr,
                        gencFilePath,
                        sizeof(gencFilePath),
                        true);
                    pkg_destroyOptMatchArch(optMatchArch);
#if U_PLATFORM_IS_LINUX_BASED

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Recompile pkgdata with -DBUILD_DATA_WITHOUT_ASSEMBLY defined (add it to CPPFLAGS or CXXFLAGS in the build system).
  2. If assembly-free building is not required, remove the --without-assembly option from the pkgdata invocation.
  3. Regenerate the build files with ICU's configure using the appropriate flags so the macro is set consistently.

Example fix

// before: Makefile missing the define
//   CXXFLAGS=-O2
// after
//   CXXFLAGS=-O2 -DBUILD_DATA_WITHOUT_ASSEMBLY
Defensive patterns

Strategy: validation

Validate before calling

// At build configuration time, check the macro is defined
#if defined(WITHOUT_ASSEMBLY) && !defined(BUILD_DATA_WITHOUT_ASSEMBLY)
#error "BUILD_DATA_WITHOUT_ASSEMBLY must be defined when building without assembly"
#endif

Prevention

When it happens

Trigger: Running pkgdata with the --without-assembly option (or UPKGOptions.withoutAssembly set to true) on a pkgdata binary that was compiled without -DBUILD_DATA_WITHOUT_ASSEMBLY. The #ifdef at line 771 guards the pkg_createWithoutAssemblyCode() call; the #else branch emits this error.

Common situations: Building ICU/Node.js with a custom Makefile that forgot to pass BUILD_DATA_WITHOUT_ASSEMBLY; using a pre-built pkgdata from a full ICU distribution against a custom build script that sets withoutAssembly.

Related errors


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