{"record":{"id":"108667e28b6947ba","repo":"nodejs/node","slug":"error-build-data-without-assembly-is-not-defined","errorCode":null,"errorMessage":"Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal error.\n","messagePattern":"Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined\\. Internal error\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":770,"sourceCode":"                        }\n                        result = pkg_installLibrary(o->install, targetDir, noVersion);\n                      }\n                      return result;\n                    }\n                } else {\n                    fprintf(stderr,\"Assembly type \\\"%s\\\" is unknown.\\n\", genccodeAssembly);\n                    return -1;\n                }\n            } else {\n                if(o->verbose) {\n                  fprintf(stdout, \"# Writing object code to %s ..\\n\", gencFilePath);\n                }\n                if (o->withoutAssembly) {\n#ifdef BUILD_DATA_WITHOUT_ASSEMBLY\n                    result = pkg_createWithoutAssemblyCode(o, targetDir, mode);\n#else\n                    /* This error should not occur. */\n                    fprintf(stderr, \"Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal error.\\n\");\n#endif\n                } else {\n#ifdef CAN_WRITE_OBJ_CODE\n                    /* Try to detect the arch type, use nullptr if unsuccessful */\n                    char optMatchArch[10] = { 0 };\n                    pkg_createOptMatchArch(optMatchArch);\n                    writeObjectCode(\n                        datFileNamePath,\n                        o->tmpDir,\n                        o->entryName,\n                        (optMatchArch[0] == 0 ? nullptr : optMatchArch),\n                        o->cpuArch,\n                        nullptr,\n                        gencFilePath,\n                        sizeof(gencFilePath),\n                        true);\n                    pkg_destroyOptMatchArch(optMatchArch);\n#if U_PLATFORM_IS_LINUX_BASED","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L752-L788","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Recompile pkgdata with -DBUILD_DATA_WITHOUT_ASSEMBLY defined (add it to CPPFLAGS or CXXFLAGS in the build system).","If assembly-free building is not required, remove the --without-assembly option from the pkgdata invocation.","Regenerate the build files with ICU's configure using the appropriate flags so the macro is set consistently."],"exampleFix":"// before: Makefile missing the define\n//   CXXFLAGS=-O2\n// after\n//   CXXFLAGS=-O2 -DBUILD_DATA_WITHOUT_ASSEMBLY","handlingStrategy":"validation","validationCode":"// At build configuration time, check the macro is defined\n#if defined(WITHOUT_ASSEMBLY) && !defined(BUILD_DATA_WITHOUT_ASSEMBLY)\n#error \"BUILD_DATA_WITHOUT_ASSEMBLY must be defined when building without assembly\"\n#endif","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep build configuration consistent: if the runtime requests --without-assembly, ensure the compile-time macro is set.","Use ICU's configure script rather than hand-editing Makefiles to avoid macro mismatches.","Add a CI check that verifies preprocessor macros match runtime options."],"tags":["icu","pkgdata","build-config","preprocessor","internal-error"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}