nodejs / nodejs/node

26.0.0 fails to build on NetBSD: missing include

未关闭 适合新手
#63,146 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

arm build v8 engine
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

Version

26.0.0

Platform
NetBSD virtual 11.99.6 NetBSD 11.99.6 (GENERIC64) #0: Mon May  4 09:49:31 CEST 2026
Subsystem

No response

What steps will reproduce the bug?

Build NodeJS 26.0.0 on NetBSD

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Build proceeds

What do you see instead?

Build fails with:

../deps/v8/src/base/memcopy.h: In function 'void v8::base::SimdMemCopy(void*, const void*, size_t)':
../deps/v8/src/base/memcopy.h:57:23: error: 'CHAR_BIT' was not declared in this scope
   57 |       sizeof(count) * CHAR_BIT - bits::CountLeadingZeros(count - 1);
      |                       ^~~~~~~~
../deps/v8/src/base/memcopy.h:21:1: note: 'CHAR_BIT' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Additional information

Fix:

--- deps/v8/src/base/memcopy.h.orig	2026-05-06 07:22:58.678410124 +0000
+++ deps/v8/src/base/memcopy.h
@@ -5,6 +5,7 @@
 #ifndef V8_BASE_MEMCOPY_H_
 #define V8_BASE_MEMCOPY_H_
 
+#include <climits>
 #include <stdlib.h>
 
 #include <atomic>

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 deps/v8/src/base/memcopy.h 开始,NetBSD 构建在此报告 CHAR_BIT 未声明。在 NetBSD 上复现 Node.js 26.0.0 构建,验证该头文件声明在那里可用,并确认在进行针对性更改后构建能够成功继续。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js
领域
build-system, operating-systems
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
冷清
描述清晰度
描述清楚
新手友好度
85/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。