Skip to content

fix(install): pre-check glibc version and fail early on too-old systems#269

Closed
qiaoshi-dot wants to merge 8 commits into
XiaomiMiMo:mainfrom
qiaoshi-dot:fix/install-glibc-precheck
Closed

fix(install): pre-check glibc version and fail early on too-old systems#269
qiaoshi-dot wants to merge 8 commits into
XiaomiMiMo:mainfrom
qiaoshi-dot:fix/install-glibc-precheck

Conversation

@qiaoshi-dot

Copy link
Copy Markdown

背景

mimocode 的二进制由 bun 编译,链接 glibc ≥ 2.27。国产化/老旧 Linux 发行版(麒麟 Kylin、统信 UOS,部分基于 Ubuntu 16.04 时代底子)可能自带更老的 glibc。

当前 install 脚本不检测 glibc 版本,会照常下载安装,用户直到首次运行才撞上动态链接器的天书报错:

mimo: /lib/.../libc.so.6: version `GLIBC_2.27' not found (required by mimo)

(本问题在 #162 的麒麟 ARM64 环境讨论中暴露。)

改动

在确定下载目标前,对 Linux(非 musl)增加 glibc 版本预检:解析 ldd --version,低于 2.27 时提前中止并给出可操作的指引,而不是让用户事后撞天书。

  • 保守策略:ldd 缺失或版本无法解析时不动作(绝不误伤本可正常运行的系统)。
  • 逃生口:MIMOCODE_SKIP_GLIBC_CHECK=1 可跳过(高级用户自担风险)。

验证

  • bash -n install 语法通过。
  • 版本比较:1.9 / 2.17 / 2.23 / 2.26 → 拦截;2.27 / 2.28 / 2.31 / 2.35 / 3.0 → 放行(边界 2.27 正确放行)。
  • ldd --version 解析在 Ubuntu / Debian / CentOS7 / Kylin 多种输出格式下均取到正确版本号(并在真实 Debian 容器 ldd 2.41 上验证)。

说明

这是 #162 麒麟环境暴露出的独立健壮性改进(与 TUI 花屏的 #246 不同),故单独提 PR、不直接 close #162。对老 glibc 的国产化环境普惠:把"装完跑不起来 + 天书报错"变成"装之前清晰告知 + 给方案"。

Related to #162

qiaozongming and others added 8 commits June 11, 2026 01:23
docs: correct OpenCode repository URL in README files
…-qrcode

docs: update community group chat QR code
mimocode's binary is compiled with bun, which links against glibc >= 2.27.
Older localized/enterprise Linux distros common in China (Kylin / UOS built on
an Ubuntu 16.04-era base) may ship an older glibc. Today the installer downloads
and installs the binary regardless, and the user only discovers the
incompatibility at first run as a cryptic dynamic-linker error, e.g.:

    mimo: /lib/.../libc.so.6: version `GLIBC_2.27' not found (required by mimo)

This adds a glibc pre-check (Linux, non-musl) that parses `ldd --version` and
aborts before download with an actionable message and concrete options. Set
MIMOCODE_SKIP_GLIBC_CHECK=1 to bypass.

The check is conservative: if ldd is missing or the version cannot be parsed it
does nothing, so it never blocks a system that would actually work. Verified the
version comparison (2.17/2.23/2.26 blocked, 2.27+ allowed) and the ldd parsing
across Ubuntu/Debian/CentOS/Kylin `ldd --version` output formats.

Related to XiaomiMiMo#162

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@qiaozongming

Copy link
Copy Markdown
Collaborator

#965

@qiaozongming

Copy link
Copy Markdown
Collaborator

#1096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI 在基于 VTE 的终端(MATE Terminal 等)上花屏,大量显示 ]66;w=1; 乱码,中文显示为方块

5 participants