{"record":{"id":"97581d745b09c80d","repo":"nodejs/node","slug":"v8-enable-hugepage-is-supported-only-on-linux","errorCode":null,"errorMessage":"--v8-enable-hugepage is supported only on linux.","messagePattern":"--v8-enable-hugepage is supported only on linux\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"configure.py","lineNumber":2253,"sourceCode":"  o['variables']['force_dynamic_crt'] = 1 if options.shared else 0\n  o['variables']['node_enable_d8'] = b(options.enable_d8)\n  o['variables']['node_enable_v8windbg'] = b(options.enable_v8windbg)\n  if options.enable_d8:\n    o['variables']['test_isolation_mode'] = 'noop'  # Needed by d8.gyp.\n  if options.without_bundled_v8:\n    if options.enable_d8:\n      raise Exception('--enable-d8 is incompatible with --without-bundled-v8.')\n    if options.enable_v8windbg:\n      raise Exception('--enable-v8windbg is incompatible with --without-bundled-v8.')\n    (pkg_libs, pkg_cflags, pkg_libpath, _) = pkg_config(\"v8\")\n    if pkg_libs and pkg_libpath:\n      output['libraries'] += [pkg_libpath] + pkg_libs.split()\n    if pkg_cflags:\n      output['include_dirs'] += [flag for flag in [flag.strip() for flag in pkg_cflags.split('-I')] if flag]\n  if options.static_zoslib_gyp:\n    o['variables']['static_zoslib_gyp'] = options.static_zoslib_gyp\n  if flavor != 'linux' and options.v8_enable_hugepage:\n    raise Exception('--v8-enable-hugepage is supported only on linux.')\n  o['variables']['v8_enable_hugepage'] = 1 if options.v8_enable_hugepage else 0\n  if options.v8_enable_short_builtin_calls or o['variables']['target_arch'] == 'x64':\n    o['variables']['v8_enable_short_builtin_calls'] = 1\n  if options.v8_enable_snapshot_compression:\n    o['variables']['v8_enable_snapshot_compression'] = 1\n  if all(opt in sys.argv for opt in ['--v8-enable-object-print', '--v8-disable-object-print']):\n    raise Exception(\n        'Only one of the --v8-enable-object-print or --v8-disable-object-print options '\n        'can be specified at a time.')\n  if all(opt in sys.argv for opt in ['--v8-enable-temporal-support', '--v8-disable-temporal-support']):\n    raise Exception(\n        'Only one of the --v8-enable-temporal-support or --v8-disable-temporal-support options '\n        'can be specified at a time.')\n  if sys.platform != 'darwin':\n    if o['variables']['v8_enable_webassembly'] and o['variables']['target_arch'] == 'x64':\n      o['variables']['v8_enable_wasm_simd256_revec'] = 1\n\ndef configure_openssl(o):","sourceCodeStart":2235,"sourceCodeEnd":2271,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/configure.py#L2235-L2271","documentation":"Node's configure only allows --v8-enable-hugepage on Linux. The flag maps to v8_enable_hugepage, which toggles V8's use of transparent huge pages via Linux-specific mmap hints; on macOS/Windows/freebsd there is no equivalent path so configure hard-aborts before writing the variable.","triggerScenarios":"Raised when options.v8_enable_hugepage is truthy and flavor != 'linux'. The check runs after the bundled-v8 block and before v8_enable_hugepage is assigned to o['variables'].","commonSituations":"Cross-platform build matrix scripts that pass the same set of perf flags on every OS; Docker builds that forgot the host reports flavor 'mac' or 'win'; CI runners shared between Linux and macOS jobs with a shared flag list.","solutions":["Drop --v8-enable-hugepage on non-Linux targets (gate it on uname/OS in your build wrapper).","If you genuinely need huge pages, run that build on a Linux host.","Make the flag conditional in your build script: only emit it when the target OS is linux."],"exampleFix":"// before\n./configure --v8-enable-hugepage   # on macOS/Windows\n// after\nif [ \"$(uname)\" = \"Linux\" ]; then EXTRA=\"--v8-enable-hugepage\"; fi\n./configure $EXTRA","handlingStrategy":"validation","validationCode":"import platform, sys\nif '--v8-enable-hugepage' in sys.argv and platform.system() != 'Linux':\n    raise SystemExit('--v8-enable-hugepage is Linux-only; remove it for this OS')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate every platform-specific perf flag behind an OS check in your build wrapper.","Maintain a per-OS flag allowlist so non-Linux jobs never inherit Linux-only flags."],"tags":["nodejs","configure","v8","platform","linux","build"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}