Clarify process.report glibcVersionRuntime semantics for statically linked glibc builds
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, linux, node.js
调研方向
从诊断报告文档以及 issue 中描述的 process.report.getReport().header 字段开始。明确当 glibc 进行静态链接时 glibcVersionRuntime 是否可能缺失,以及这种缺失并不能证明存在 musl;在文档结合现有示例定义其存在语义后即完成。
由索引模型根据 Issue 内容生成。
描述
What is the issue?
process.report.getReport().header.glibcVersionRuntime can be absent in a Node.js binary that appears to be statically linked against glibc.
That may be intentional, but the current documentation does not appear to define the presence semantics of glibcVersionRuntime, especially for statically linked glibc builds. This makes it easy for ecosystem code to interpret an absent glibcVersionRuntime as "not glibc" or "musl", even when glibcVersionCompiler is present.
Reproduction
Using Node.js v22.21.1:
$ file "$(command -v node)"
/usr/bin/node: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 4.19.0, stripped
$ ldd --version | head -n 1
ldd (GNU libc) 2.39
$ node -p "JSON.stringify({
node: process.version,
execPath: process.execPath,
glibcVersionCompiler: process.report.getReport().header.glibcVersionCompiler,
glibcVersionRuntime: process.report.getReport().header.glibcVersionRuntime,
node_target_type: process.config.variables.node_target_type,
node_shared: process.config.variables.node_shared
}, null, 2)"
{
"node": "v22.21.1",
"execPath": "/usr/bin/node",
"glibcVersionCompiler": "2.39",
"node_target_type": "static_library",
"node_shared": false
}
glibcVersionRuntime is omitted from the report object.
Why this is unclear
The diagnostic report documentation shows both fields in the example report:
"glibcVersionRuntime": "2.17",
"glibcVersionCompiler": "2.17"
The report documentation also says the report version is bumped when a key is added or removed, or when a value type changes.
However, I could not find documentation stating whether glibcVersionRuntime is guaranteed to be present on Linux glibc builds, whether it may be omitted, or whether it is expected to be omitted for statically linked glibc builds.
The implementation appears to emit glibcVersionRuntime only when dlsym(RTLD_DEFAULT, "gnu_get_libc_version") succeeds, while glibcVersionCompiler is emitted under __GLIBC__.
Expected documentation / clarification
It would be useful for the documentation to clarify one of the following:
glibcVersionRuntimeis optional and may be absent when the runtime glibc version cannot be dynamically queried, including statically linked glibc builds; orglibcVersionRuntimeshould be present for statically linked glibc builds, and its absence is a bug; or- consumers should not use absence of
glibcVersionRuntimeas evidence that the runtime is musl or non-glibc.
I am not asserting that the current runtime behavior is necessarily wrong. The issue is that the field's absence is observable, but the documented contract does not appear to define what that absence means.
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 273
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/node 的其他 Issue
-
doc
难度 2/5 1-3 小时 新手友好度 65/100
-
build
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1 小时以内 新手友好度 90/100
-
feature request
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
难度 1/5 1 小时以内 新手友好度 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
难度 2/5 1-3 小时 新手友好度 84/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·